如何使用从泛型反射中得到的Enum?

问题描述

说我知道了

Performing hot restart...
Syncing files to device AOSP on IA Emulator...
Restarted application in 2,914ms.

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
RenderPointerListener object was given an infinite size during layout.

This probably means that it is a render object that tries to be as big as possible,but it was put inside another render object that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: _RenderSingleChildViewport#c6080 relayoutBoundary=up10 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...  needs compositing
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(0.0<=w<=392.7,0.0<=h<=759.3)
...  size: MISSING
The constraints that applied to the RenderPointerListener were: BoxConstraints(0.0<=w<=392.7,0.0<=h<=Infinity)
The exact size it was given was: Size(392.7,Infinity)

See https://flutter.dev/docs/development/ui/layout/box-constraints for more information.

The relevant error-causing widget was: 
  PageLink file:///C:/Users/aayus/Desktop/xdflutter/lib/fourth.dart:516:24
When the exception was thrown,this was the stack: 
#0      RenderBox.debugAssertDoesMeetConstraints.<anonymous closure> (package:flutter/src/rendering/box.dart:1967:9)
#1      RenderBox.debugAssertDoesMeetConstraints (package:flutter/src/rendering/box.dart:2035:6)
#2      RenderBox.size=.<anonymous closure> (package:flutter/src/rendering/box.dart:1752:7)
#3      RenderBox.size= (package:flutter/src/rendering/box.dart:1754:6)
#4      RenderPointerListener.performResize (package:flutter/src/rendering/proxy_box.dart:2609:5)
...
The following RenderObject was being processed when the exception was fired: RenderPointerListener#99b51 relayoutBoundary=up14 NEEDS-LAYOUT NEEDS-PAINT
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(0.0<=w<=392.7,0.0<=h<=Infinity)
...  size: Size(392.7,Infinity)
...  behavior: translucent
...  listeners: down
RenderObject: RenderPointerListener#99b51 relayoutBoundary=up14 NEEDS-LAYOUT NEEDS-PAINT
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=392.7,0.0<=h<=Infinity)
  size: Size(392.7,Infinity)
  behavior: translucent
  listeners: down
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderSemanticsGestureHandler object was given an infinite size during layout.
The relevant error-causing widget was: 
  PageLink file:///C:/Users/aayus/Desktop/xdflutter/lib/fourth.dart:516:24
The following RenderObject was being processed when the exception was fired: RenderSemanticsGestureHandler#9150f relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=392.7,Infinity)
  gestures: tap
  child: RenderPointerListener#99b51 relayoutBoundary=up14 NEEDS-PAINT
    parentData: <none> (can use size)
    constraints: BoxConstraints(0.0<=w<=392.7,0.0<=h<=Infinity)
    size: Size(392.7,Infinity)
    behavior: translucent
    listeners: down
RenderObject: RenderSemanticsGestureHandler#9150f relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=392.7,Infinity)
    behavior: translucent
    listeners: down
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderTransform object was given an infinite size during layout.
The relevant error-causing widget was: 
  Transform file:///C:/Users/aayus/Desktop/xdflutter/lib/fourth.dart:514:27
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderFlex object was given an infinite size during layout.
The relevant error-causing widget was: 
  Column file:///C:/Users/aayus/Desktop/xdflutter/lib/fourth.dart:24:18
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The method '>' was called on null.
Receiver: null
Tried calling: >(1e-10)
The relevant error-causing widget was: 
  Column file:///C:/Users/aayus/Desktop/xdflutter/lib/fourth.dart:24:18
════════════════════════════════════════════════════════════════════════════════════════════════════

由于某些原因,我想这样做:

String someEnumClassName = "some.enum.name";
Class someEnumClass = Class.forName(someEnumClassName);

我该怎么做?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...