微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决如何使用从泛型反射中得到的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 举报,一经查实,本站将立刻删除。