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

I think dependency analysis issue #283

Open
tayyabmajeed855 opened this issue Nov 3, 2023 · 10 comments
Open

I think dependency analysis issue #283

tayyabmajeed855 opened this issue Nov 3, 2023 · 10 comments

Comments

@tayyabmajeed855
Copy link

Launching lib\main.dart on M2006C3MG in debug mode...
Running Gradle task 'assembleDebug'...
../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_neumorphic-3.2.0/lib/src/widget/app_bar.dart:183:29: Error: The getter 'textTheme' isn't defined for the class 'AppBarTheme'.

  • 'AppBarTheme' is from 'package:flutter/src/material/app_bar_theme.dart' ('/C:/src/flutter/packages/flutter/lib/src/material/app_bar_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'textTheme'.
    style: (appBarTheme.textTheme?.headline5 ??
    ^^^^^^^^^
    ../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_neumorphic-3.2.0/lib/src/widget/app.dart:89:7: Error: No named parameter with the name 'accentColor'.
    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({
    ^
    Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1297

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

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

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 10s
Exception: Gradle task assembleDebug failed with exit code 1

@astheras
Copy link

same here
3.16.5 Flutter SDK

@astheras
Copy link

i don't know if this is the same author but https://pub.dev/packages/flutter_neumorphic_plus

@bridgetsarahbrand
Copy link

Fix, temp work around

'''

import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

class NeumorphicApp extends StatelessWidget {
final String title;
final ThemeMode themeMode;
final NeumorphicThemeData theme;
final NeumorphicThemeData darkTheme;
final ThemeData? materialDarkTheme;
final ThemeData? materialTheme;
final String? initialRoute;
final Color? color;
final Iterable<LocalizationsDelegate>? localizationsDelegates;
final Locale? locale;
final Widget? home;
final Iterable supportedLocales;
final Map<String, WidgetBuilder> routes;
final RouteFactory? onGenerateRoute;
final RouteFactory? onUnknownRoute;
final GenerateAppTitle? onGenerateTitle;
final GlobalKey? navigatorKey;
final List navigatorObservers;
final InitialRouteListFactory? onGenerateInitialRoutes;
final bool debugShowCheckedModeBanner;
final Widget Function(BuildContext, Widget?)? builder;
final Locale? Function(Locale?, Iterable)? localeResolutionCallback;
final ThemeData? highContrastTheme;
final ThemeData? highContrastDarkTheme;
final LocaleListResolutionCallback? localeListResolutionCallback;
final bool showPerformanceOverlay;
final bool checkerboardRasterCacheImages;
final bool checkerboardOffscreenLayers;
final bool showSemanticsDebugger;
final Map<LogicalKeySet, Intent>? shortcuts;
final Map<Type, Action>? actions;

final bool debugShowMaterialGrid;

const NeumorphicApp({
Key? key,
this.title = '',
this.color,
this.initialRoute,
this.routes = const {},
this.home,
this.debugShowCheckedModeBanner = true,
this.navigatorKey,
this.navigatorObservers = const [],
this.onGenerateRoute,
this.onGenerateTitle,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
this.theme = neumorphicDefaultTheme,
this.darkTheme = neumorphicDefaultDarkTheme,
this.locale,
this.localizationsDelegates,
this.supportedLocales = const [Locale('en', 'US')],
this.themeMode = ThemeMode.system,
this.materialDarkTheme,
this.materialTheme,
this.builder,
this.localeResolutionCallback,
this.highContrastTheme,
this.highContrastDarkTheme,
this.localeListResolutionCallback,
this.showPerformanceOverlay = false,
this.checkerboardRasterCacheImages = false,
this.checkerboardOffscreenLayers = false,
this.showSemanticsDebugger = false,
this.debugShowMaterialGrid = false,
this.shortcuts,
this.actions,
}) : super(key: key);

ThemeData _getMaterialTheme(NeumorphicThemeData theme) {
final color = theme.accentColor;

if (color is MaterialColor) {
  return ThemeData(
    primarySwatch: color,
    textTheme: theme.textTheme,
    iconTheme: theme.iconTheme,
    scaffoldBackgroundColor: theme.baseColor,
  );
}

return ThemeData(
  primaryColor: theme.accentColor,
  primarySwatch: MaterialColor(theme.variantColor.value, <int, Color>{
    50: theme.variantColor.withOpacity(0.1),
    100: theme.variantColor.withOpacity(0.2),
    200: theme.variantColor.withOpacity(0.3),
    300: theme.variantColor.withOpacity(0.4),
    400: theme.variantColor.withOpacity(0.5),
    500: theme.variantColor.withOpacity(0.6),
    600: theme.variantColor.withOpacity(0.7),
    700: theme.variantColor.withOpacity(0.8),
    800: theme.variantColor.withOpacity(0.9),
    900: theme.variantColor,
  }),
  iconTheme: theme.iconTheme,
  brightness: ThemeData.estimateBrightnessForColor(theme.baseColor),
  textTheme: theme.textTheme,
  scaffoldBackgroundColor: theme.baseColor,
);

}

@OverRide
Widget build(BuildContext context) {
final materialTheme = this.materialTheme ?? _getMaterialTheme(theme);
final materialDarkTheme =
this.materialDarkTheme ?? _getMaterialTheme(darkTheme);
return NeumorphicTheme(
theme: theme,
darkTheme: darkTheme,
themeMode: themeMode,
child: Builder(
builder: (context) => IconTheme(
data: NeumorphicTheme.currentTheme(context).iconTheme,
child: MaterialApp(
title: title,
color: color,
theme: materialTheme,
darkTheme: materialDarkTheme,
initialRoute: initialRoute,
routes: routes,
themeMode: themeMode,
localizationsDelegates: localizationsDelegates,
supportedLocales: supportedLocales,
locale: locale,
home: home,
onGenerateRoute: onGenerateRoute,
onUnknownRoute: onUnknownRoute,
onGenerateTitle: onGenerateTitle,
onGenerateInitialRoutes: onGenerateInitialRoutes,
navigatorKey: navigatorKey,
navigatorObservers: navigatorObservers,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
builder: builder,
localeResolutionCallback: localeResolutionCallback,
highContrastTheme: highContrastTheme,
highContrastDarkTheme: highContrastDarkTheme,
localeListResolutionCallback: localeListResolutionCallback,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
shortcuts: shortcuts,
actions: actions,
debugShowMaterialGrid: debugShowMaterialGrid),
),
),
);
}
}

'''

@rak-dev
Copy link

rak-dev commented Oct 2, 2024

Is this issue fixed? because I am getting the same issue. @bridgetsarahbrand Can you share some more details about the fix you provide? I tried that but its not working. Sorry, I am a newbie to Flutter.

`/C:/Users/UserSystem-01/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_neumorphic-3.2.0/lib/src/widget/app.dart:89:7: Error: No named parameter with the name 'accentColor'.
accentColor: theme.variantColor,
^^^^^^^^^^^
/C:/FlutterSdk/flutter/packages/flutter/lib/src/material/theme_data.dart:252:11: Context: Found this candidate, but the arguments don't match.
factory ThemeData({
^
/C:/Users/UserSystem-01/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_neumorphic-3.2.0/lib/src/widget/app_bar.dart:183:29: Error: The getter 'textTheme' isn't defined for the class 'AppBarTheme'.

  • 'AppBarTheme' is from 'package:flutter/src/material/app_bar_theme.dart' ('/C:/FlutterSdk/flutter/packages/flutter/lib/src/material/app_bar_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'textTheme'.
    style: (appBarTheme.textTheme?.headline5 ??
    ^^^^^^^^^
    /C:/Users/UserSystem-01/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_neumorphic-3.2.0/lib/src/widget/app_bar.dart:184:45: Error: The getter 'headline5' isn't defined for the class 'TextTheme'.
  • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/FlutterSdk/flutter/packages/flutter/lib/src/material/text_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline5'.
    Theme.of(context).textTheme.headline5!)
    ^^^^^^^^^
    /C:/Users/UserSystem-01/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_neumorphic-3.2.0/lib/src/widget/container.dart:121:69: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
  • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/FlutterSdk/flutter/packages/flutter/lib/src/material/text_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText2'.
    style: this.textStyle ?? material.Theme.of(context).textTheme.bodyText2!,
    ^^^^^^^^^
    Target kernel_snapshot_program failed: Exception

FAILURE: Build failed with an exception.

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

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

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 8s
Error: Gradle task assembleDebug failed with exit code 1
`

@rak-dev
Copy link

rak-dev commented Oct 2, 2024

i don't know if this is the same author but https://pub.dev/packages/flutter_neumorphic_plus

Thanks, @astheras for sharing this. This library seems to be working fine with sdk: ">=3.0.0"

@SquishyWubbles
Copy link

SquishyWubbles commented Oct 2, 2024

I have the same problems as OP. And I don't understand why the package has not been updated yet to reflect the changes Flutter itself made for "material.Theme.of(context).textTheme.bodyText2!," etc... these changes have been made months ago and are easy to implement/fix, as far as I can see.

I could fork the package and just edit the things myself, but I would rather not.

EDIT: I forked it to see if I could update stuff so it would work, but the problems are deeper. Since there seem to also be packages that this one uses that are not properly updated yet. I'm going to just let this go and build my own widgets probably.

@bridgetsarahbrand
Copy link

bridgetsarahbrand commented Oct 3, 2024

fixes.zip
Please see the fixes, these files are patched and just booted up my app, if you have a problem please feel free to drop me a message at [email protected]. - Files need to replace those of the cached directory - but please be aware when Flutter upgrades, they get wiped and you'll need to copy and paste or modify these files.

@rak-dev

@bridgetsarahbrand
Copy link

I have the same problems as OP. And I don't understand why the package has not been updated yet to reflect the changes Flutter itself made for "material.Theme.of(context).textTheme.bodyText2!," etc... these changes have been made months ago and are easy to implement/fix, as far as I can see.

I could fork the package and just edit the things myself, but I would rather not.

EDIT: I forked it to see if I could update stuff so it would work, but the problems are deeper. Since there seem to also be packages that this one uses that are not properly updated yet. I'm going to just let this go and build my own widgets probably.

Just with the 'Building own widgets', not a bad idea, since this started happening earlier this year, I've started doing this, bit by bit, hopefully in the end we will have our own framework

@bridgetsarahbrand
Copy link

ssue fixed? because I am getting the same issue. @bridgetsarahbrand Can you share some more details about the fix you provide? I tried that but its not working. Sorry, I am a newbie to Flutter.

`/C:/Users/UserSystem-01/AppData/Local/Pub/Cache/hosted

Its not a dependency issue, its because when Flutter was released the code was broken within this package quite a bit, it happened when Flutter released at 3.0.0 , hope this helps :)

@SquishyWubbles
Copy link

fixes.zip Please see the fixes, these files are patched and just booted up my app, if you have a problem please feel free to drop me a message at [email protected]. - Files need to replace those of the cached directory - but please be aware when Flutter upgrades, they get wiped and you'll need to copy and paste or modify these files.

@rak-dev

Thank you for the comment (and file), but since I've had some bad experience with other packages that werent actively kept up to date I've decided to move on and build my own. I rather not rely on the package in its current state.

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

5 participants