You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the opened issues and there are no duplicates
Describe the bug
In Flutter 3.27, API breaking change introduced, as a part of attempt to "normalize" Material's theme API. Reference is here for TabBarTheme – ThemeData's tabBarTheme property is now TabBarThemeData instead of TabBarTheme.
These changes breaks flet because theme utils now have incompatible types. Consider this example:
This method returns TabBarTheme? because it returns result of copyWith method. But this method now returns TabBarThemeData. Thus errors like this:
../../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:356:28: Error: A
value of type 'TabBarThemeData' can't be returned from a function with return type 'TabBarTheme?'.
- 'TabBarThemeData' is from 'package:flutter/src/material/tab_bar_theme.dart'
('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/tab_bar_theme.da
rt').
- 'TabBarTheme' is from 'package:flutter/src/material/tab_bar_theme.dart'
('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/tab_bar_theme.da
rt').
return theme.tabBarTheme.copyWith(
^
Same for other API apart from TabBarTheme, such as DialogTheme, CardTheme, etc ....
Code sample
Code
Considerr this code:
// Current TabBarTheme API in stable channel version: 3.24.5finalTabBarTheme tabTheme =Theme.of(context).tabBarTheme;
This will works on 3.24.5, but breaks on 3.27
To reproduce
See code sample
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
macOS
Operating system details
Sonoma 14.7
Flet version
0.25.1
Regression
No, it isn't
Suggestions
Hard to say. Since it's hard breakage of public API of Flutter itself, maybe it'll require to set minimal flutter version for 3.27 for flet package and update usages accordingly in new version of flet
Logs
Logs
❯ flet build macos[22:01:43] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.25.1 ✅ Customized app icons and splash images ✅[22:01:45] Generated app icons ✅[22:01:51] Packaged Python app ✅[22:02:13] Updating project for Xcode compatibility. Upgrading project.pbxproj Upgrading Runner.xcscheme Running pod install... 4.3s Building macOS application... macos/Runner/AppDelegate.swift uses the deprecated @NSApplicationMain attribute, updating. macos/Runner/AppDelegate.swift does not override applicationSupportsSecureRestorableState. Updating. .gitignore does not ignore Swift Package Manager build directories, updating. --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, arch:arm64, id:00008103-001C55920A33001E, name:My Mac } { platform:macOS, arch:x86_64, id:00008103-001C55920A33001E, name:My Mac } ../../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:356:28: Error: A value of type 'TabBarThemeData' can't be returned from a function with return type 'TabBarTheme?'. - 'TabBarThemeData' is from 'package:flutter/src/material/tab_bar_theme.dart' ('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/tab_bar_theme.da rt'). - 'TabBarTheme' is from 'package:flutter/src/material/tab_bar_theme.dart' ('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/tab_bar_theme.da rt'). return theme.tabBarTheme.copyWith( ^ ../../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:438:28: Error: A value of type 'DialogThemeData' can't be returned from a function with return type 'DialogTheme?'. - 'DialogThemeData' is from 'package:flutter/src/material/dialog_theme.dart' ('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/dialog_theme.dar t'). - 'DialogTheme' is from 'package:flutter/src/material/dialog_theme.dart' ('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/dialog_theme.dar t'). return theme.dialogTheme.copyWith( ^ ../../../../../.pub-cache/hosted/pub.dev/flet-0.25.1/lib/src/utils/theme.dart:482:26: Error: A value of type 'CardThemeData' can't be returned from a function with return type 'CardTheme?'. - 'CardThemeData' is from 'package:flutter/src/material/card_theme.dart' ('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/card_theme.dart' ). - 'CardTheme' is from 'package:flutter/src/material/card_theme.dart' ('/opt/homebrew/Caskroom/flutter/3.27.0/flutter/packages/flutter/lib/src/material/card_theme.dart' ). return theme.cardTheme.copyWith( ^ Target kernel_snapshot_program failed: Exception Command PhaseScriptExecution failed with a nonzero exit code warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner') ** BUILD FAILED ** Build process failed Error building Flet app - see the log of failed command above.[22:02:26] Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B91 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4) [✓] Xcode - develop for iOS and macOS (Xcode 16.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.2) [✓] Connected device (3 available) [✓] Network resources • No issues found!
Additional details
No response
The text was updated successfully, but these errors were encountered:
Duplicate Check
Describe the bug
In Flutter 3.27, API breaking change introduced, as a part of attempt to "normalize" Material's theme API. Reference is here for
TabBarTheme
–ThemeData
'stabBarTheme
property is nowTabBarThemeData
instead ofTabBarTheme
.These changes breaks
flet
because theme utils now have incompatible types. Consider this example:This method returns
TabBarTheme?
because it returns result ofcopyWith
method. But this method now returnsTabBarThemeData
. Thus errors like this:Sadly, there is already questions on SO on this matter, for example: https://stackoverflow.com/questions/79273727/materialtheme-normalization-breaks-tabbartheme-cardtheme-dialogtheme-api/79273907#79273907
Same for other API apart from
TabBarTheme
, such asDialogTheme
,CardTheme
, etc ....Code sample
Code
Considerr this code:This will works on 3.24.5, but breaks on 3.27
To reproduce
See code sample
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
macOS
Operating system details
Sonoma 14.7
Flet version
0.25.1
Regression
No, it isn't
Suggestions
Hard to say. Since it's hard breakage of public API of Flutter itself, maybe it'll require to set minimal flutter version for 3.27 for
flet
package and update usages accordingly in new version offlet
Logs
Logs
Additional details
No response
The text was updated successfully, but these errors were encountered: