-
-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
When trying to use TextStyle.copyWith in evaluated code, the compiler throws an error saying that the method is unknown.
Minimal reproducible code:
abstract class AppThemeStyles {
ThemeData get themeData;
TextTheme get textTheme => themeData.textTheme;
get smallBannerTitleSmall =>
themeData.textTheme.titleSmall?.copyWith(color: colors.white);
}
Error log:
CompileError: Unknown method TextStyle.copyWith at "themeData.textTheme...." (file package:hot_part/theme/app_theme_styles.dart)
#0 resolveInstanceMethod (package:dart_eval/src/eval/compiler/expression/method_invocation.dart:355:9)
#1 resolveInstanceMethod (package:dart_eval/src/eval/compiler/expression/method_invocation.dart:360:14)
#2 resolveInstanceMethod (package:dart_eval/src/eval/compiler/expression/method_invocation.dart:360:14)
#3 _invokeWithTarget (package:dart_eval/src/eval/compiler/expression/method_invocation.dart:260:12)
#4 compileMethodInvocation.<anonymous closure> (package:dart_eval/src/eval/compiler/expression/method_invocation.dart:48:19)
...
Expected behavior:
TextStyle.copyWith should be available inside flutter_eval, since it’s a core Flutter method used for theming.
Actual behavior:
Compilation fails with Unknown method TextStyle.copyWith.
Metadata
Metadata
Assignees
Labels
No labels