Idean / Flutter-Neumorphic

A complete, ready to use, Neumorphic ui kit for Flutter, πŸ•ΆοΈ dark mode compatible
https://pub.dev/packages/flutter_neumorphic
Apache License 2.0
2.05k stars 374 forks source link

[Web Error]: Expected a value of type 'SkDeletable', but got one of type 'Null' #213

Open romain-bajoit-iot-d opened 3 years ago

romain-bajoit-iot-d commented 3 years ago

Cannot paint some neumorphic widgets. Neumorphic of depth=0, disabled NeumorphicButton, pressed NeumorphicButton ...

Error ``` ======== Exception caught by rendering library ===================================================== The following TypeErrorImpl was thrown during paint(): Expected a value of type 'SkDeletable', but got one of type 'Null' The relevant error-causing widget was: AnimatedContainer file:///Users/romainbajoit/Documents/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_neumorphic-3.1.0/lib/src/widget/container.dart:122:14 When the exception was thrown, this was the stack: dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 236:49 throw_ dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 84:3 castError dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart 266:34 as lib/_engine/engine/canvaskit/skia_object_cache.dart 146:55 new lib/_engine/engine/canvaskit/mask_filter.dart 10:3 blur ... The following RenderObject was being processed when the exception was fired: RenderDecoratedBox#532e5 relayoutBoundary=up5 ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=884.0) ... size: Size(23.0, 16.0) ... decoration: NeumorphicDecoration ... configuration: ImageConfiguration(bundle: PlatformAssetBundle#bb91a(), devicePixelRatio: 2.0, locale: en_US, textDirection: TextDirection.ltr, platform: macOS) RenderObject: RenderDecoratedBox#532e5 relayoutBoundary=up5 parentData: (can use size) constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=884.0) size: Size(23.0, 16.0) decoration: NeumorphicDecoration configuration: ImageConfiguration(bundle: PlatformAssetBundle#bb91a(), devicePixelRatio: 2.0, locale: en_US, textDirection: TextDirection.ltr, platform: macOS) ... child: RenderPadding#4e4b6 relayoutBoundary=up6 NEEDS-PAINT ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=884.0) ... size: Size(23.0, 16.0) ... padding: EdgeInsets.zero ... textDirection: ltr ... child: RenderClipPath#31c31 relayoutBoundary=up7 NEEDS-PAINT ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=884.0) ... size: Size(23.0, 16.0) ... child: RenderPadding#df819 relayoutBoundary=up8 NEEDS-PAINT ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=884.0) ... size: Size(23.0, 16.0) ... padding: EdgeInsets.zero ... textDirection: ltr ... child: RenderParagraph#2ddeb relayoutBoundary=up9 NEEDS-PAINT ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=884.0) ... size: Size(23.0, 16.0) ... textAlign: start ... textDirection: ltr ... softWrap: wrapping at box width ... overflow: clip ... locale: en_US ... maxLines: unlimited ==================================================================================================== ======== Exception caught by rendering library ===================================================== Expected a value of type 'SkDeletable', but got one of type 'Null' The relevant error-causing widget was: AnimatedContainer file:///Users/romainbajoit/Documents/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_neumorphic-3.1.0/lib/src/widget/container.dart:122:14 ==================================================================================================== ```
Code to reproduce the error The error is triggered **on build** for the `Neumorpic`. It is not displayed on screen. The error is triggered **when the button is pressed on**. ``` import 'package:flutter_neumorphic/flutter_neumorphic.dart'; void main() => runApp(MainApp()); class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { return NeumorphicApp( title: 'abc', home: ABC(), ); } } class ABC extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Row( children: [ NeumorphicButton( child: Text('abc'), onPressed: () => print('a'), ), Neumorphic( child: Text('abc'), style: NeumorphicStyle(depth: 0.0), ), ], ), ), ); } } ```
Excecution environment Executed with and without `--no-sound-null-safety`, it does not change the behavior ``` [βœ“] Flutter (Channel beta, 2.0.2, on macOS 11.0.1 20B29 darwin-x64, locale en-BE) β€’ Flutter version 2.0.2 at /Users/romainbajoit/Documents/dev/flutter β€’ Framework revision 8962f6dc68 (3 weeks ago), 2021-03-11 13:22:20 -0800 β€’ Engine revision 5d8bf811b3 β€’ Dart version 2.12.1 [βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.1) β€’ Android SDK at /Users/romainbajoit/Library/Android/sdk β€’ Platform android-30, build-tools 30.0.1 β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) β€’ All Android licenses accepted. [βœ“] Xcode - develop for iOS and macOS β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ Xcode 12.4, Build version 12D4e β€’ CocoaPods version 1.10.1 [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [βœ“] Android Studio (version 4.1) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [βœ“] IntelliJ IDEA Ultimate Edition (version 2020.2) β€’ IntelliJ at /Applications/IntelliJ IDEA.app β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin version 202.6397.47 [βœ“] Connected device (1 available) β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 89.0.4389.114 β€’ No issues found! ```
ppshah2023 commented 3 years ago

What is this problem with people closing their issues. I say this because the problem still remains. Specifically, the issue is still (to keep it brief) an issue.

AryashDubey commented 3 years ago

I also got this issue with the tab bar widget. Hope this issue resolves soon!