Flutter-Neumorphic
Flutter-Neumorphic copied to clipboard
[Flutter Web] Can't use Text or Icons
Using NeumorphicText or NeumorphicIcon throws the assertation error color == null || foreground == null
Tried on flutter beta & dev (brand new project)
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during paint():
Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/text/paragraph.dart:795:13
color == null || foreground == null
"Cannot provide both a color and a foreground\nThe color argument is just a shorthand for \"foreground: new Paint()..color = color\"."
The relevant error-causing widget was:
AnimatedContainer file:///C:/Users/cyberpwn/Documents/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_neumorphic-3.0.2/lib/src/widget/text.dart:226:16
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 216:49 throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 24:3 assertFailed
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/text/paragraph.dart 795:44 new
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/text/paragraph.dart 1224:45 [_tryBuildPlainText]
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/text/paragraph.dart 1128:12 build
...
The following RenderObject was being processed when the exception was fired: RenderDecoratedBox#f2ccf relayoutBoundary=up12
... parentData: offset=Offset(0.0, 0.0) (can use size)
... constraints: BoxConstraints(0.0<=w<=576.0, 0.0<=h<=Infinity)
... size: Size(59.0, 28.0)
... decoration: NeumorphicTextDecoration
... configuration: ImageConfiguration(bundle: PlatformAssetBundle#ec34a(), devicePixelRatio: 1.0, locale: en_US, textDirection: TextDirection.ltr, platform: windows)
child: RenderConstrainedBox#39932 relayoutBoundary=up13
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=576.0, 0.0<=h<=Infinity)
size: Size(59.0, 28.0)
additionalConstraints: BoxConstraints(w=59.0, h=28.0)
RenderObject: RenderDecoratedBox#f2ccf relayoutBoundary=up12
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=576.0, 0.0<=h<=Infinity)
size: Size(59.0, 28.0)
decoration: NeumorphicTextDecoration
configuration: ImageConfiguration(bundle: PlatformAssetBundle#ec34a(), devicePixelRatio: 1.0, locale: en_US, textDirection: TextDirection.ltr, platform: windows)
child: RenderConstrainedBox#39932 relayoutBoundary=up13
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=576.0, 0.0<=h<=Infinity)
size: Size(59.0, 28.0)
additionalConstraints: BoxConstraints(w=59.0, h=28.0)
════════════════════════════════════════════════════════════════════════════════════════════════════
Same here, seems foreground is written as default in NeumorphicTextStyle