Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flutter][3.22.0] fix accentColor & textTheme #276

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

den0206
Copy link

@den0206 den0206 commented May 13, 2023

fix two property

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

Fixed to build with Flutter 3.10.0.

@thomasnappee
Copy link

thomasnappee commented May 13, 2023

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

@den0206 den0206 force-pushed the feature/remoce_accentcolor branch from 7c9c810 to ad0b488 Compare May 13, 2023 05:52
@den0206
Copy link
Author

den0206 commented May 13, 2023

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

@thomasnappee
Copy link

NeumorphicApp

Works perfectly 👍

@AAverin
Copy link

AAverin commented Jun 10, 2023

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

@gmckesey
Copy link

gmckesey commented Jun 13, 2023

@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?

@lorriman
Copy link

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.

@gmckesey
Copy link

@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.

kakaojp added a commit to kakaojp/Flutter-Neumorphic that referenced this pull request Aug 20, 2023
@den0206 den0206 changed the title [Flutter][3.10.0] fix accentColor & textTheme [Flutter][3.22.0] fix accentColor & textTheme May 18, 2024
@fcampos-raodsystem
Copy link

i need this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants