Flutter-Neumorphic icon indicating copy to clipboard operation
Flutter-Neumorphic copied to clipboard

[Flutter][3.22.0] fix accentColor & textTheme

Open den0206 opened this issue 1 year ago • 7 comments

fix two property

  • accentColor(depracated) => Theme.of(context).colorScheme.secondary ref
  • textTheme(depracated)

Fixed to build with Flutter 3.10.0.

den0206 avatar May 13 '23 03:05 den0206

Got this error with the fix, even with an "empty" NeumorphicApp() (using Flutter 3.10 and Dart3)

If someone is blocked with this and dont want to downgrade Flutter SDK, just use a MaterialApp for testing


The following assertion was thrown building NeumorphicApp(dirty): Assertion failed: file:///dev/flutter/packages/flutter/lib/src/material/theme_data.dart:459:12 colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness is not true

The relevant error-causing widget was: NeumorphicApp NeumorphicApp:file:///dev/webui/lib/main.dart:20:12

When the exception was thrown, this was the stack: dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49 throw dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed packages/flutter/src/material/theme_data.dart 459:106 new packages/flutter_neumorphic/src/widget/app.dart 86:12 [_getMaterialTheme] packages/flutter_neumorphic/src/widget/app.dart 101:35 build packages/flutter/src/widgets/framework.dart 5156:22 build packages/flutter/src/widgets/framework.dart 5086:15 performRebuild packages/flutter/src/widgets/framework.dart 4805:7 rebuild packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 5062:5 mount packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget packages/flutter/src/widgets/framework.dart 3708:18 updateChild packages/flutter/src/widgets/framework.dart 5111:16 performRebuild packages/flutter/src/widgets/framework.dart 4805:7 rebuild packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 5062:5 mount packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget packages/flutter/src/widgets/framework.dart 3708:18 updateChild packages/flutter/src/widgets/framework.dart 5111:16 performRebuild packages/flutter/src/widgets/framework.dart 4805:7 rebuild packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 5062:5 mount packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget packages/flutter/src/widgets/framework.dart 3708:18 updateChild packages/flutter/src/widgets/framework.dart 5111:16 performRebuild packages/flutter/src/widgets/framework.dart 5251:11 performRebuild packages/flutter/src/widgets/framework.dart 4805:7 rebuild packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 5242:11 [_firstBuild] packages/flutter/src/widgets/framework.dart 5062:5 mount packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget packages/flutter/src/widgets/framework.dart 3708:18 updateChild packages/flutter/src/widgets/framework.dart 5111:16 performRebuild packages/flutter/src/widgets/framework.dart 4805:7 rebuild packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 5062:5 mount packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget packages/flutter/src/widgets/framework.dart 3708:18 updateChild packages/flutter/src/widgets/framework.dart 5111:16 performRebuild packages/flutter/src/widgets/framework.dart 4805:7 rebuild packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 5062:5 mount packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget packages/flutter/src/widgets/framework.dart 3708:18 updateChild packages/flutter/src/widgets/binding.dart 1240:16 [_rebuild] packages/flutter/src/widgets/binding.dart 1209:5 mount packages/flutter/src/widgets/binding.dart 1156:16 packages/flutter/src/widgets/framework.dart 2720:19 buildScope packages/flutter/src/widgets/binding.dart 1155:12 attachToRenderTree packages/flutter/src/widgets/binding.dart 987:24 attachRootWidget packages/flutter/src/widgets/binding.dart 968:7 dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19 internalCallback

thomasnappee avatar May 13 '23 04:05 thomasnappee

@thomasnappee fix it, pls check wrap NeumorphicApp or MaterialApp.

den0206 avatar May 13 '23 05:05 den0206

NeumorphicApp

Works perfectly :+1:

thomasnappee avatar May 13 '23 06:05 thomasnappee

@florent37 while the project doesn't seem to be actively maintained, could you please still take a look at this critical compatibility PR?

AAverin avatar Jun 10 '23 11:06 AAverin

@florent37 while the project doesn't seem to be actively maintained, could you please still take a look at this critical compatibility PR?

Should this project be forked so that these issues can be fixed, otherwise this package is likely to die?

gmckesey avatar Jun 13 '23 16:06 gmckesey

A fork published on pub.dev means people willing to continue maintaining it.

For my own purposes I forked and then applied "dart fix" which did a fine job as far as I can see with no effort required from me. So now my project refers to my fork, and unless a graver and more difficult update is required, that should do for the foreseeable future.

lorriman avatar Jun 13 '23 18:06 lorriman

@scttbloom, you can fork this project into your own repository, make the fix, for example using @den0206 changes then replace the pub.dev version of the package with you github version. An example of how to do this is in this link https://stackoverflow.com/questions/54022704/how-to-add-a-package-from-github-in-flutter.

gmckesey avatar Jul 17 '23 13:07 gmckesey

i need this fix

fcampos-raodsystem avatar Jun 15 '24 05:06 fcampos-raodsystem