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

getter textTheme isn't defined for type AppBarTheme #275

Open
gmckesey opened this issue May 11, 2023 · 5 comments
Open

getter textTheme isn't defined for type AppBarTheme #275

gmckesey opened this issue May 11, 2023 · 5 comments

Comments

@gmckesey
Copy link

As of at least Flutter 3.10.0 - In the file app_bar.dart:183, the attribute textTheme is not defined for class AppBarTheme. Further, the TextTheme attribute headline5 is deprecated and shouldn't be removed.

@noahvelasco
Copy link

To temporarily solve this issue run in your project directory -

"flutter downgrade"

then accept the changes. You might have a few issues (const keywords, or others) but they are solvable by you and not the package. This should suffice until they fix this issue.

@den0206
Copy link

den0206 commented May 13, 2023

temporary fix was sent out to PR.

  flutter_neumorphic: 
    git:
      url: https://github.com/den0206/Flutter-Neumorphic.git
      ref: feature/remoce_accentcolor

@ghost
Copy link

ghost commented May 16, 2023

Actually I was also getting that type of error... I spent 7 whole days just going through my lines of code and and finally I managed to fix it.... I just used one neumorphic button and everything just went down hill...
This was the error(s) I got when I was using this package:

`Error: No named parameter with the name 'accentColor'.
app.dart:89
accentColor: theme.variantColor,
^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/material/theme_data.dart:290:11: Context: Found this candidate, but the arguments don't match.
factory ThemeData({
^
: Error: The getter 'textTheme' isn't defined for the class 'AppBarTheme'.
app_bar.dart:183

  • 'AppBarTheme' is from 'package:flutter/src/material/app_bar_theme.dart' ('/C:/src/flutter/packages/flutter/lib/src/material/app_bar_theme.dart').
    app_bar_theme.dart:1
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'textTheme'.
    style: (appBarTheme.textTheme?.headline5 ??
    ^^^^^^^^^

Target kernel_snapshot failed: Exception
2

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1`

Solution:
It seems this neumorphic package was conflicting with the material.dart package, after I deleted the imported flutter neumorphic package everything started working.... Hope this helps somebody, if you got a fix kindly share....

@benyawmin
Copy link

benyawmin commented Sep 30, 2023

temporary fix was sent out to PR.

  flutter_neumorphic: 
    git:
      url: https://github.com/den0206/Flutter-Neumorphic.git
      ref: feature/remoce_accentcolor

I am using the latest version of flutter right now(3.13.0), after adding this line I get this error:
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _TypeError was thrown building NeumorphicAppBar(dirty, dependencies: [_InheritedTheme,
_LocalizationsScope-[GlobalKey#e350a], _ModalScopeStatus], state: NeumorphicAppBarState#a16ce):
Null check operator used on a null value

The relevant error-causing widget was:
NeumorphicAppBar
NeumorphicAppBar:file:///C:/Users/Benyamin/Desktop/wordcraft/lib/features/wordcraft/presentation/pages/home_page.dart:9:15

When the exception was thrown, this was the stack:
#0 NeumorphicAppBarState.build (package:flutter_neumorphic/src/widget/app_bar.dart:235:66)
#1 StatefulElement.build (package:flutter/src/widgets/framework.dart:5409:27)
#2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5297:15)
#3 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5462:11)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:5016:7)
#5 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5279:5)
#6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5453:11)
#7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5273:5)
... Normal element mounting (22 frames)
#29 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4182:16)
#30 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6569:36)
#31 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6581:32)
... Normal element mounting (330 frames)
#361 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4182:16)
#362 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6569:36)
#363 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6581:32)
... Normal element mounting (435 frames)
#798 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4182:16)
#799 Element.updateChild (package:flutter/src/widgets/framework.dart:3707:18)
#800 _LayoutBuilderElement._layout.layoutCallback (package:flutter/src/widgets/layout_builder.dart:135:18)
#801 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2719:19)
#802 _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:153:12)
#803 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:2604:59)
#804 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:1059:15)
#805 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:2604:14)
#806 RenderConstrainedLayoutBuilder.rebuildIfNecessary (package:flutter/src/widgets/layout_builder.dart:228:7)
#807 _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:313:5)
#808 RenderObject.layout (package:flutter/src/rendering/object.dart:2493:7)
#809 RenderBox.layout (package:flutter/src/rendering/box.dart:2382:11)
#810 _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:315:14)
#811 RenderObject.layout (package:flutter/src/rendering/object.dart:2493:7)
#812 RenderBox.layout (package:flutter/src/rendering/box.dart:2382:11)
#813 RenderView.performLayout (package:flutter/src/rendering/view.dart:178:14)
#814 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:2332:7)
#815 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1013:18)
#816 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:494:19)
#817 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:918:13)
#818 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:360:5)
#819 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1297:15)
#820 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
#821 SchedulerBinding.scheduleWarmUpFrame. (package:flutter/src/scheduler/binding.dart:952:7)
#825 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
(elided 3 frames from class _Timer and dart:async-patch)

@den0206
Copy link

den0206 commented Oct 1, 2023

@benyawmin

I am using the latest version of flutter right now(3.13.0), after adding this line I get this error:

fix it : 07f44e0

Try reinstalling it.

  flutter_neumorphic: 
    git:
      url: https://github.com/den0206/Flutter-Neumorphic.git
      ref: feature/remoce_accentcolor

also check pubspec.lock commit hash :

  flutter_neumorphic:
    dependency: "direct main"
    description:
      path: "."
      ref: "feature/remoce_accentcolor"
      resolved-ref: "07f44e0ae36cf68452ed65f0516352da262c9814"   // update it
      url: "https://github.com/den0206/Flutter-Neumorphic.git"
スクリーンショット 2023-10-01 10 31 10

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

No branches or pull requests

4 participants