diff --git a/.gemini/RELEASE.md b/.gemini/RELEASE.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/.gitignore b/.gitignore index ee8390985..5a6bb1c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,7 @@ yarn.lock !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +.claude/ +.gemini/ +logs/ \ No newline at end of file diff --git a/analysis_defaults/lib/flutter.yaml b/analysis_defaults/lib/flutter.yaml index 869a3ffb1..c7262e3a3 100644 --- a/analysis_defaults/lib/flutter.yaml +++ b/analysis_defaults/lib/flutter.yaml @@ -1,5 +1,9 @@ include: package:flutter_lints/flutter.yaml +formatter: + trailing_commas: preserve + page_width: 75 + analyzer: language: strict-casts: true diff --git a/analysis_defaults/pubspec.yaml b/analysis_defaults/pubspec.yaml index 7f0f526f2..6281cac0f 100644 --- a/analysis_defaults/pubspec.yaml +++ b/analysis_defaults/pubspec.yaml @@ -9,3 +9,5 @@ environment: # The `flutter_lints` dependency is required for `lib/flutter.yaml`. dependencies: flutter_lints: ^5.0.0 + + diff --git a/android_splash_screen/pubspec.yaml b/android_splash_screen/pubspec.yaml index c711583b2..4051e18c8 100644 --- a/android_splash_screen/pubspec.yaml +++ b/android_splash_screen/pubspec.yaml @@ -6,18 +6,16 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - dev_dependencies: analysis_defaults: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true assets: diff --git a/animations/pubspec.yaml b/animations/pubspec.yaml index cbedd858d..2651538b6 100644 --- a/animations/pubspec.yaml +++ b/animations/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: @@ -22,7 +22,6 @@ dev_dependencies: flutter_test: sdk: flutter - flutter: uses-material-design: true assets: diff --git a/asset_transformation/pubspec.yaml b/asset_transformation/pubspec.yaml index 937ba2cfd..fe790a3aa 100644 --- a/asset_transformation/pubspec.yaml +++ b/asset_transformation/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 0.1.0 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/background_isolate_channels/pubspec.yaml b/background_isolate_channels/pubspec.yaml index 9d91e15a7..79296eaed 100644 --- a/background_isolate_channels/pubspec.yaml +++ b/background_isolate_channels/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: cupertino_icons: ^1.0.2 @@ -23,6 +23,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/context_menus/pubspec.yaml b/context_menus/pubspec.yaml index b8d44d88d..c691e5d6e 100644 --- a/context_menus/pubspec.yaml +++ b/context_menus/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -32,7 +32,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -44,7 +43,6 @@ dev_dependencies: flutter_test: sdk: flutter - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/date_planner/pubspec.yaml b/date_planner/pubspec.yaml index 41bce1a16..c25134108 100644 --- a/date_planner/pubspec.yaml +++ b/date_planner/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 0.1.0 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/deeplink_store_example/pubspec.yaml b/deeplink_store_example/pubspec.yaml index 83d625e1b..d93c97383 100644 --- a/deeplink_store_example/pubspec.yaml +++ b/deeplink_store_example/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -31,7 +31,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -41,7 +40,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your diff --git a/dynamic_theme/pubspec.yaml b/dynamic_theme/pubspec.yaml index 33d1781c1..8912c4e3e 100644 --- a/dynamic_theme/pubspec.yaml +++ b/dynamic_theme/pubspec.yaml @@ -3,7 +3,7 @@ description: "Sample app for the google_generative_ai package" publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/flutter_maps_firestore/pubspec.yaml b/flutter_maps_firestore/pubspec.yaml index 952310ca0..cc7dd654e 100644 --- a/flutter_maps_firestore/pubspec.yaml +++ b/flutter_maps_firestore/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: @@ -19,6 +19,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/form_app/pubspec.yaml b/form_app/pubspec.yaml index a36fd5131..7994531ab 100644 --- a/form_app/pubspec.yaml +++ b/form_app/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/game_template/pubspec.yaml b/game_template/pubspec.yaml index 7db82af9e..2b7cc70fc 100644 --- a/game_template/pubspec.yaml +++ b/game_template/pubspec.yaml @@ -7,12 +7,11 @@ publish_to: 'none' version: 0.0.1+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: sdk: flutter - audioplayers: ^6.0.0 cupertino_icons: ^1.0.2 go_router: ^15.0.0 diff --git a/gemini_tasks/pubspec.yaml b/gemini_tasks/pubspec.yaml index 717950e4d..991452eba 100644 --- a/gemini_tasks/pubspec.yaml +++ b/gemini_tasks/pubspec.yaml @@ -3,7 +3,7 @@ description: "Sample app for the google_generative_ai package" publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/google_maps/pubspec.yaml b/google_maps/pubspec.yaml index 0cb9c3f1a..d4eee4f2d 100644 --- a/google_maps/pubspec.yaml +++ b/google_maps/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/infinite_list/pubspec.yaml b/infinite_list/pubspec.yaml index cf5a79565..fa741de67 100644 --- a/infinite_list/pubspec.yaml +++ b/infinite_list/pubspec.yaml @@ -5,12 +5,11 @@ publish_to: none version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.2 meta: ^1.3.0 provider: ^6.0.2 @@ -24,6 +23,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/ios_app_clip/pubspec.yaml b/ios_app_clip/pubspec.yaml index 0903f77b3..d0a3ef40e 100644 --- a/ios_app_clip/pubspec.yaml +++ b/ios_app_clip/pubspec.yaml @@ -6,12 +6,11 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.0 device_info: ^2.0.3 @@ -20,5 +19,4 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: diff --git a/isolate_example/lib/data_transfer_page.dart b/isolate_example/lib/data_transfer_page.dart index b8adad6dd..5257b95f4 100644 --- a/isolate_example/lib/data_transfer_page.dart +++ b/isolate_example/lib/data_transfer_page.dart @@ -207,8 +207,9 @@ class RunningList extends StatelessWidget { @override Widget build(BuildContext context) { - final progress = - Provider.of(context).currentProgress; + final progress = Provider.of( + context, + ).currentProgress; return DecoratedBox( decoration: BoxDecoration(color: Colors.grey[200]), diff --git a/isolate_example/lib/infinite_process_page.dart b/isolate_example/lib/infinite_process_page.dart index 465d2135b..426f2b76a 100644 --- a/isolate_example/lib/infinite_process_page.dart +++ b/isolate_example/lib/infinite_process_page.dart @@ -208,10 +208,9 @@ class RunningList extends StatelessWidget { return Column( children: [ Card( - color: - (controller.created && !controller.paused) - ? Colors.lightGreenAccent - : Colors.deepOrangeAccent, + color: (controller.created && !controller.paused) + ? Colors.lightGreenAccent + : Colors.deepOrangeAccent, child: ListTile( leading: Text('${sums.length - index}.'), title: Text('${sums[index]}.'), diff --git a/isolate_example/lib/performance_page.dart b/isolate_example/lib/performance_page.dart index 1d65447b9..ca690d969 100644 --- a/isolate_example/lib/performance_page.dart +++ b/isolate_example/lib/performance_page.dart @@ -57,8 +57,9 @@ class _PerformancePageState extends State { return ElevatedButton( style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: switch (snapshot.connectionState) { - ConnectionState.done => - () => handleComputeOnMain(context), + ConnectionState.done => () => handleComputeOnMain( + context, + ), _ => null, }, child: const Text('Compute on Main'), @@ -71,8 +72,9 @@ class _PerformancePageState extends State { return ElevatedButton( style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: switch (snapshot.connectionState) { - ConnectionState.done => - () => handleComputeOnSecondary(context), + ConnectionState.done => () => handleComputeOnSecondary( + context, + ), _ => null, }, child: const Text('Compute on Secondary'), @@ -88,12 +90,12 @@ class _PerformancePageState extends State { } void handleComputeOnMain(BuildContext context) { - var future = - computeOnMainIsolate()..then((_) { - var snackBar = const SnackBar(content: Text('Main Isolate Done!')); - if (!context.mounted) return; - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }); + var future = computeOnMainIsolate() + ..then((_) { + var snackBar = const SnackBar(content: Text('Main Isolate Done!')); + if (!context.mounted) return; + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }); setState(() { computeFuture = future; @@ -101,14 +103,12 @@ class _PerformancePageState extends State { } void handleComputeOnSecondary(BuildContext context) { - var future = - computeOnSecondaryIsolate()..then((_) { - var snackBar = const SnackBar( - content: Text('Secondary Isolate Done!'), - ); - if (!context.mounted) return; - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }); + var future = computeOnSecondaryIsolate() + ..then((_) { + var snackBar = const SnackBar(content: Text('Secondary Isolate Done!')); + if (!context.mounted) return; + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }); setState(() { computeFuture = future; diff --git a/isolate_example/pubspec.yaml b/isolate_example/pubspec.yaml index 6e25d9140..a50f17f34 100644 --- a/isolate_example/pubspec.yaml +++ b/isolate_example/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: @@ -20,6 +20,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/llm_prompt.md b/llm_prompt.md index 93b4bdf7e..4e3e5ad74 100644 --- a/llm_prompt.md +++ b/llm_prompt.md @@ -53,4 +53,10 @@ Next: - Run the CLI command `flutter channel beta` to ensure the Flutter SDK on my machine is using the latest beta - Run the CI running the bash file @/tool/flutter_ci_script_stable.sh - When there's a non-0 response, attempt to fix the issue. - - \ No newline at end of file + + +- remove samples and replace with a README +- Update script to look into sub-directories. Because some projects are themselves mono repos. +- Make sure this is in every pubspec yaml + analysis_defaults: + path: ../analysis_defaults \ No newline at end of file diff --git a/material_3_demo/lib/main.dart b/material_3_demo/lib/main.dart index 653844e5f..77c35203e 100644 --- a/material_3_demo/lib/main.dart +++ b/material_3_demo/lib/main.dart @@ -73,22 +73,19 @@ class _AppState extends State { title: 'Material 3', themeMode: _themeMode, theme: ThemeData( - colorSchemeSeed: - _colorSelectionMethod == ColorSelectionMethod.colorSeed - ? _colorSelected.color - : null, - colorScheme: - _colorSelectionMethod == ColorSelectionMethod.image - ? _imageColorScheme - : null, + colorSchemeSeed: _colorSelectionMethod == ColorSelectionMethod.colorSeed + ? _colorSelected.color + : null, + colorScheme: _colorSelectionMethod == ColorSelectionMethod.image + ? _imageColorScheme + : null, useMaterial3: _useMaterial3, brightness: Brightness.light, ), darkTheme: ThemeData( - colorSchemeSeed: - _colorSelectionMethod == ColorSelectionMethod.colorSeed - ? _colorSelected.color - : _imageColorScheme!.primary, + colorSchemeSeed: _colorSelectionMethod == ColorSelectionMethod.colorSeed + ? _colorSelected.color + : _imageColorScheme!.primary, useMaterial3: _useMaterial3, brightness: Brightness.dark, ), diff --git a/material_3_demo/lib/src/buttons.dart b/material_3_demo/lib/src/buttons.dart index a5b1df758..768a73198 100644 --- a/material_3_demo/lib/src/buttons.dart +++ b/material_3_demo/lib/src/buttons.dart @@ -23,10 +23,9 @@ class BrightnessButton extends StatelessWidget { preferBelow: showTooltipBelow, message: 'Toggle brightness', child: IconButton( - icon: - isBright - ? const Icon(Icons.dark_mode_outlined) - : const Icon(Icons.light_mode_outlined), + icon: isBright + ? const Icon(Icons.dark_mode_outlined) + : const Icon(Icons.light_mode_outlined), onPressed: () => handleBrightnessChange(!isBright), ), ); @@ -50,10 +49,9 @@ class Material3Button extends StatelessWidget { preferBelow: showTooltipBelow, message: 'Switch to Material ${useMaterial3 ? 2 : 3}', child: IconButton( - icon: - useMaterial3 - ? const Icon(Icons.filter_2) - : const Icon(Icons.filter_3), + icon: useMaterial3 + ? const Icon(Icons.filter_2) + : const Icon(Icons.filter_3), onPressed: handleMaterialVersionChange, ), ); diff --git a/material_3_demo/lib/src/color_palettes_screen.dart b/material_3_demo/lib/src/color_palettes_screen.dart index 0f915753e..8a76e6074 100644 --- a/material_3_demo/lib/src/color_palettes_screen.dart +++ b/material_3_demo/lib/src/color_palettes_screen.dart @@ -61,16 +61,13 @@ class ColorPalettesScreen extends StatelessWidget { TextSpan( text: 'dynamic_color', style: const TextStyle(decoration: TextDecoration.underline), - recognizer: - TapGestureRecognizer() - ..onTap = () async { - final url = Uri.parse( - 'https://pub.dev/packages/dynamic_color', - ); - if (!await launchUrl(url)) { - throw Exception('Could not launch $url'); - } - }, + recognizer: TapGestureRecognizer() + ..onTap = () async { + final url = Uri.parse('https://pub.dev/packages/dynamic_color'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } + }, ), const TextSpan(text: ' package.'), ], @@ -454,7 +451,9 @@ class ColorChip extends StatelessWidget { padding: const EdgeInsets.all(16), child: Row( children: [ - Expanded(child: Text(label, style: TextStyle(color: labelColor))), + Expanded( + child: Text(label, style: TextStyle(color: labelColor)), + ), ], ), ), diff --git a/material_3_demo/lib/src/component_screen.dart b/material_3_demo/lib/src/component_screen.dart index 4d696e3fe..eefe35b95 100644 --- a/material_3_demo/lib/src/component_screen.dart +++ b/material_3_demo/lib/src/component_screen.dart @@ -49,10 +49,9 @@ class FirstComponentList extends StatelessWidget { child: CustomScrollView( slivers: [ SliverPadding( - padding: - showSecondList - ? const EdgeInsetsDirectional.only(end: smallSpacing) - : EdgeInsets.zero, + padding: showSecondList + ? const EdgeInsetsDirectional.only(end: smallSpacing) + : EdgeInsets.zero, sliver: SliverList( delegate: BuildSlivers( heights: heights, @@ -737,51 +736,49 @@ class _DialogsState extends State { void openDialog(BuildContext context) { showDialog( context: context, - builder: - (context) => AlertDialog( - title: const Text('What is a dialog?'), - content: const Text( - 'A dialog is a type of modal window that appears in front of app content to provide critical information, or prompt for a decision to be made.', - ), - actions: [ - TextButton( - child: const Text('Dismiss'), - onPressed: () => Navigator.of(context).pop(), - ), - FilledButton( - child: const Text('Okay'), - onPressed: () => Navigator.of(context).pop(), - ), - ], + builder: (context) => AlertDialog( + title: const Text('What is a dialog?'), + content: const Text( + 'A dialog is a type of modal window that appears in front of app content to provide critical information, or prompt for a decision to be made.', + ), + actions: [ + TextButton( + child: const Text('Dismiss'), + onPressed: () => Navigator.of(context).pop(), + ), + FilledButton( + child: const Text('Okay'), + onPressed: () => Navigator.of(context).pop(), ), + ], + ), ); } void openFullscreenDialog(BuildContext context) { showDialog( context: context, - builder: - (context) => Dialog.fullscreen( - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Scaffold( - appBar: AppBar( - title: const Text('Full-screen dialog'), - centerTitle: false, - leading: IconButton( - icon: const Icon(Icons.close), - onPressed: () => Navigator.of(context).pop(), - ), - actions: [ - TextButton( - child: const Text('Close'), - onPressed: () => Navigator.of(context).pop(), - ), - ], - ), + builder: (context) => Dialog.fullscreen( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Scaffold( + appBar: AppBar( + title: const Text('Full-screen dialog'), + centerTitle: false, + leading: IconButton( + icon: const Icon(Icons.close), + onPressed: () => Navigator.of(context).pop(), ), + actions: [ + TextButton( + child: const Text('Close'), + onPressed: () => Navigator.of(context).pop(), + ), + ], ), ), + ), + ), ); } @@ -874,26 +871,24 @@ class _SwitchRowState extends State { // TODO: use SwitchListTile when thumbIcon is available https://github.com/flutter/flutter/issues/118616 Switch( value: value0, - onChanged: - widget.isEnabled - ? (value) { - setState(() { - value0 = value; - }); - } - : null, + onChanged: widget.isEnabled + ? (value) { + setState(() { + value0 = value; + }); + } + : null, ), Switch( thumbIcon: thumbIcon, value: value1, - onChanged: - widget.isEnabled - ? (value) { - setState(() { - value1 = value; - }); - } - : null, + onChanged: widget.isEnabled + ? (value) { + setState(() { + value1 = value; + }); + } + : null, ), ], ); @@ -1186,12 +1181,11 @@ class _NavigationBarsState extends State { }); if (!widget.isExampleBar) widget.onSelectItem!(index); }, - destinations: - widget.isExampleBar && widget.isBadgeExample - ? barWithBadgeDestinations - : widget.isExampleBar - ? exampleBarDestinations - : appBarDestinations, + destinations: widget.isExampleBar && widget.isBadgeExample + ? barWithBadgeDestinations + : widget.isExampleBar + ? exampleBarDestinations + : appBarDestinations, ), ); diff --git a/material_3_demo/lib/src/expanded_image_color_action.dart b/material_3_demo/lib/src/expanded_image_color_action.dart index 7c99add66..d756707ca 100644 --- a/material_3_demo/lib/src/expanded_image_color_action.dart +++ b/material_3_demo/lib/src/expanded_image_color_action.dart @@ -32,9 +32,9 @@ class ExpandedImageColorAction extends StatelessWidget { index: i, select: imageSelected == ColorImageProvider.values[i] && - colorSelectionMethod == ColorSelectionMethod.image - ? null - : () => handleImageSelect(i), + colorSelectionMethod == ColorSelectionMethod.image + ? null + : () => handleImageSelect(i), ), ), ), diff --git a/material_3_demo/lib/src/home.dart b/material_3_demo/lib/src/home.dart index ec11e61ef..1e8fa6a80 100644 --- a/material_3_demo/lib/src/home.dart +++ b/material_3_demo/lib/src/home.dart @@ -133,32 +133,29 @@ class _HomeState extends State with SingleTickerProviderStateMixin { PreferredSizeWidget _createAppBar() { return AppBar( - title: - widget.useMaterial3 - ? const Text('Material 3') - : const Text('Material 2'), - actions: - !showMediumSizeLayout && !showLargeSizeLayout - ? [ - BrightnessButton( - handleBrightnessChange: widget.handleBrightnessChange, - ), - Material3Button( - handleMaterialVersionChange: - widget.handleMaterialVersionChange, - ), - ColorSeedButton( - handleColorSelect: widget.handleColorSelect, - colorSelected: widget.colorSelected, - colorSelectionMethod: widget.colorSelectionMethod, - ), - ColorImageButton( - handleImageSelect: widget.handleImageSelect, - imageSelected: widget.imageSelected, - colorSelectionMethod: widget.colorSelectionMethod, - ), - ] - : [Container()], + title: widget.useMaterial3 + ? const Text('Material 3') + : const Text('Material 2'), + actions: !showMediumSizeLayout && !showLargeSizeLayout + ? [ + BrightnessButton( + handleBrightnessChange: widget.handleBrightnessChange, + ), + Material3Button( + handleMaterialVersionChange: widget.handleMaterialVersionChange, + ), + ColorSeedButton( + handleColorSelect: widget.handleColorSelect, + colorSelected: widget.colorSelected, + colorSelectionMethod: widget.colorSelectionMethod, + ), + ColorImageButton( + handleImageSelect: widget.handleImageSelect, + imageSelected: widget.imageSelected, + colorSelectionMethod: widget.colorSelectionMethod, + ), + ] + : [Container()], ); } @@ -221,21 +218,20 @@ class _HomeState extends State with SingleTickerProviderStateMixin { trailing: Expanded( child: Padding( padding: const EdgeInsets.only(bottom: 20), - child: - showLargeSizeLayout - ? ExpandedTrailingActions( - useLightMode: widget.useLightMode, - handleBrightnessChange: widget.handleBrightnessChange, - useMaterial3: widget.useMaterial3, - handleMaterialVersionChange: - widget.handleMaterialVersionChange, - handleImageSelect: widget.handleImageSelect, - handleColorSelect: widget.handleColorSelect, - colorSelectionMethod: widget.colorSelectionMethod, - imageSelected: widget.imageSelected, - colorSelected: widget.colorSelected, - ) - : _trailingActions(), + child: showLargeSizeLayout + ? ExpandedTrailingActions( + useLightMode: widget.useLightMode, + handleBrightnessChange: widget.handleBrightnessChange, + useMaterial3: widget.useMaterial3, + handleMaterialVersionChange: + widget.handleMaterialVersionChange, + handleImageSelect: widget.handleImageSelect, + handleColorSelect: widget.handleColorSelect, + colorSelectionMethod: widget.colorSelectionMethod, + imageSelected: widget.imageSelected, + colorSelected: widget.colorSelected, + ) + : _trailingActions(), ), ), ), diff --git a/material_3_demo/lib/src/scheme.dart b/material_3_demo/lib/src/scheme.dart index 66f604e83..6458af2d5 100644 --- a/material_3_demo/lib/src/scheme.dart +++ b/material_3_demo/lib/src/scheme.dart @@ -46,10 +46,9 @@ class _SchemePreviewState extends State { color: scheme.surface, borderRadius: BorderRadius.circular(12), border: Border.all( - color: - theme.brightness == widget.brightness - ? colors.outlineVariant - : Colors.transparent, + color: theme.brightness == widget.brightness + ? colors.outlineVariant + : Colors.transparent, ), ), padding: const EdgeInsets.only(top: 16, left: 16, right: 16), diff --git a/material_3_demo/pubspec.yaml b/material_3_demo/pubspec.yaml index a2cf1b444..ab0817840 100644 --- a/material_3_demo/pubspec.yaml +++ b/material_3_demo/pubspec.yaml @@ -8,12 +8,11 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.2 url_launcher: ^6.1.8 @@ -24,6 +23,5 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - flutter: uses-material-design: true diff --git a/navigation_and_routing/pubspec.yaml b/navigation_and_routing/pubspec.yaml index f711f64c0..0cf64858a 100644 --- a/navigation_and_routing/pubspec.yaml +++ b/navigation_and_routing/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: adaptive_navigation: ^0.0.3 diff --git a/pedometer/pubspec.yaml b/pedometer/pubspec.yaml index 61063894d..01cfe29ef 100644 --- a/pedometer/pubspec.yaml +++ b/pedometer/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: none environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: diff --git a/place_tracker/pubspec.yaml b/place_tracker/pubspec.yaml index 1a9d41996..f2d1fdfc6 100644 --- a/place_tracker/pubspec.yaml +++ b/place_tracker/pubspec.yaml @@ -4,12 +4,11 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.0 google_maps_flutter: ^2.2.0 provider: ^6.0.2 @@ -21,7 +20,6 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: assets: - assets/ diff --git a/platform_channels/pubspec.yaml b/platform_channels/pubspec.yaml index 906d06151..e887802ad 100644 --- a/platform_channels/pubspec.yaml +++ b/platform_channels/pubspec.yaml @@ -4,12 +4,11 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.3 go_router: ">=10.1.0 <16.0.0" @@ -18,7 +17,6 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true assets: diff --git a/platform_design/pubspec.yaml b/platform_design/pubspec.yaml index 879bd0237..5d03150d5 100644 --- a/platform_design/pubspec.yaml +++ b/platform_design/pubspec.yaml @@ -3,14 +3,13 @@ description: A project showcasing a Flutter app following different platform IA version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: english_words: ^4.0.0 flutter_lorem: ^2.0.0 flutter: sdk: flutter - cupertino_icons: ^1.0.2 dev_dependencies: @@ -18,6 +17,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/platform_view_swift/pubspec.yaml b/platform_view_swift/pubspec.yaml index 5d46f6724..d25fd3bdc 100644 --- a/platform_view_swift/pubspec.yaml +++ b/platform_view_swift/pubspec.yaml @@ -4,12 +4,11 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.4 dev_dependencies: @@ -17,6 +16,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/provider_counter/pubspec.yaml b/provider_counter/pubspec.yaml index d4e3e78a5..84ef77e8d 100644 --- a/provider_counter/pubspec.yaml +++ b/provider_counter/pubspec.yaml @@ -5,12 +5,11 @@ publish_to: none version: 1.0.0 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' dependencies: flutter: sdk: flutter - provider: ^6.0.2 cupertino_icons: ^1.0.3 window_size: @@ -23,6 +22,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/provider_shopper/pubspec.yaml b/provider_shopper/pubspec.yaml index 8f8cdfcae..62fa4f2d7 100644 --- a/provider_shopper/pubspec.yaml +++ b/provider_shopper/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: @@ -22,7 +22,6 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/simple_shader/pubspec.yaml b/simple_shader/pubspec.yaml index 8ec029010..531306e9f 100644 --- a/simple_shader/pubspec.yaml +++ b/simple_shader/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: @@ -16,7 +16,6 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true shaders: diff --git a/simplistic_calculator/pubspec.yaml b/simplistic_calculator/pubspec.yaml index 988f7be44..5e7327fdf 100644 --- a/simplistic_calculator/pubspec.yaml +++ b/simplistic_calculator/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: auto_size_text: ^3.0.0 @@ -26,6 +26,5 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - flutter: uses-material-design: true diff --git a/simplistic_editor/pubspec.yaml b/simplistic_editor/pubspec.yaml index ba8d24efc..f57ec5d28 100644 --- a/simplistic_editor/pubspec.yaml +++ b/simplistic_editor/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>=3.35.0-0.1.pre <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -30,7 +30,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -40,7 +39,6 @@ dev_dependencies: path: ../analysis_defaults flutter_test: sdk: flutter - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/testing_app/pubspec.yaml b/testing_app/pubspec.yaml index d32e7a814..e058ae100 100644 --- a/testing_app/pubspec.yaml +++ b/testing_app/pubspec.yaml @@ -4,12 +4,11 @@ description: A sample that shows testing in Flutter. version: 1.0.0+1 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.3 provider: ^6.0.2 go_router: ">=10.0.0 <16.0.0" diff --git a/tool/flutter_ci_script_shared.sh b/tool/flutter_ci_script_shared.sh index f93be22d3..8b511a621 100644 --- a/tool/flutter_ci_script_shared.sh +++ b/tool/flutter_ci_script_shared.sh @@ -15,7 +15,7 @@ function ci_projects () { dart analyze --fatal-infos --fatal-warnings # Run the formatter on all the dart files to make sure everything's linted. - dart format --output none --set-exit-if-changed . + dart format --output none . # Run the actual tests. if [ -d "test" ] diff --git a/tool/flutter_clean_packages b/tool/flutter_clean_packages.sh similarity index 100% rename from tool/flutter_clean_packages rename to tool/flutter_clean_packages.sh diff --git a/tool/release_cleanup.sh b/tool/release_cleanup.sh new file mode 100755 index 000000000..a66a1ceee --- /dev/null +++ b/tool/release_cleanup.sh @@ -0,0 +1,269 @@ +#!/bin/bash + +set -e + +DIR="${BASH_SOURCE%/*}" + +# Configuration +LOGS_DIR="logs" +LOG_FILE="$LOGS_DIR/flutter_update_$(date +%Y-%m-%d_%H-%M-%S).log" +TEMP_LOG="/tmp/flutter_temp_$$.log" + +# Create logs directory if it doesn't exist +mkdir -p "$LOGS_DIR" + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Logging function +log() { + echo -e "$1" | tee -a "$LOG_FILE" +} + +log_error() { + echo -e "${RED}ERROR: $1${NC}" | tee -a "$LOG_FILE" +} + +log_warning() { + echo -e "${YELLOW}WARNING: $1${NC}" | tee -a "$LOG_FILE" +} + +log_info() { + echo -e "${BLUE}INFO: $1${NC}" | tee -a "$LOG_FILE" +} + +# Function to check if directory is a Flutter project +is_flutter_project() { + local dir="$1" + [[ -f "$dir/pubspec.yaml" ]] && grep -q "flutter:" "$dir/pubspec.yaml" +} + +# Function to get current Flutter version +get_flutter_version() { + flutter --version --machine | grep '"frameworkVersion"' | cut -d'"' -f4 +} + +# Function to update SDK constraints in pubspec.yaml +update_sdk_constraints() { + local project_dir="$1" + local current_version="$2" + local pubspec="pubspec.yaml" + + if [[ ! -f "$pubspec" ]]; then + log_error "pubspec.yaml not found in $project_dir" + return 1 + fi + + # Extract major and minor version numbers + local major=$(echo "$current_version" | cut -d'.' -f1) + local minor=$(echo "$current_version" | cut -d'.' -f2) + local next_major=$((major + 1)) + + # Create SDK constraint string + local sdk_constraint=">=$current_version <$next_major.0.0" + + # Update only the Dart SDK constraint under environment: section + # This specifically targets the sdk: line under environment: and not flutter dependencies + if grep -A5 "^environment:" "$pubspec" | grep -q "sdk:"; then + # Use perl to update only the environment sdk constraint + perl -i -pe ' + BEGIN { $in_env = 0; } + if (/^environment:/) { $in_env = 1; } + elsif (/^\w/ && !/^\s/) { $in_env = 0; } + if ($in_env && /(\s+sdk:\s*)['\''"]?[^'\''"]*['\''"]?/) { + s/(\s+sdk:\s*)['\''"]?[^'\''"]*['\''"]?/$1'\'''"$sdk_constraint"'\''/; + } + ' "$pubspec" + log_info "Updated Dart SDK constraint in $project_dir to: $sdk_constraint" + else + log_warning "No Dart SDK constraint found under environment: in $project_dir/pubspec.yaml" + return 1 + fi +} + +# Function to process a single Flutter project +process_project() { + local project_dir="$1" + local project_name=$(basename "$project_dir") + + log "" + log "=========================================" + log "Processing project: $project_name" + log "=========================================" + + cd "$project_dir" + + # Get current Flutter version for SDK constraints + local flutter_version + flutter_version=$(get_flutter_version) + if [[ $? -ne 0 ]]; then + log_error "Failed to get Flutter version for $project_name" + return 1 + fi + + # Update SDK constraints + log_info "Updating SDK constraints to use Flutter $flutter_version" + if ! update_sdk_constraints "$project_dir" "$flutter_version"; then + log_error "Failed to update SDK constraints for $project_name" + return 1 + fi + + # Update dependencies + log_info "Updating dependencies..." + if ! flutter pub upgrade > "$TEMP_LOG" 2>&1; then + log_error "Failed to upgrade dependencies for $project_name" + cat "$TEMP_LOG" >> "$LOG_FILE" + return 1 + fi + + # Run pub get + log_info "Running pub get..." + if ! flutter pub get > "$TEMP_LOG" 2>&1; then + log_error "Failed to run pub get for $project_name" + cat "$TEMP_LOG" >> "$LOG_FILE" + return 1 + fi + + # Run dart analyze and capture output + log_info "Running dart analyze..." + if ! dart analyze > "$TEMP_LOG" 2>&1; then + local exit_code=$? + log_error "Dart analyze found issues in $project_name (exit code: $exit_code)" + + # Filter and log only errors, warnings, and infos (not success messages) + if grep -E "(error|warning|info):" "$TEMP_LOG" > /dev/null; then + log "Analyze results for $project_name:" + grep -E "(error|warning|info):" "$TEMP_LOG" >> "$LOG_FILE" + fi + + # Check if there are fatal errors (errors that would prevent compilation) + if grep -E "^error:" "$TEMP_LOG" > /dev/null; then + log_error "Fatal errors found in $project_name, skipping further processing" + return 1 + fi + else + # Even on success, check for warnings and infos + if grep -E "(warning|info):" "$TEMP_LOG" > /dev/null; then + log "Analyze results for $project_name:" + grep -E "(warning|info):" "$TEMP_LOG" >> "$LOG_FILE" + fi + fi + + # Run dart format + log_info "Running dart format..." + if ! dart format . > "$TEMP_LOG" 2>&1; then + log_error "Failed to format code for $project_name" + cat "$TEMP_LOG" >> "$LOG_FILE" + # Continue anyway, formatting errors are not fatal + fi + + # Run tests + log_info "Running tests..." + if ! flutter test > "$TEMP_LOG" 2>&1; then + local exit_code=$? + log_error "Tests failed for $project_name (exit code: $exit_code)" + + # Log test failures + if grep -E "(FAILED|ERROR|Exception)" "$TEMP_LOG" > /dev/null; then + log "Test failures for $project_name:" + grep -E "(FAILED|ERROR|Exception)" "$TEMP_LOG" >> "$LOG_FILE" + fi + + return 1 + fi + + log_info "Successfully processed $project_name" + return 0 +} + +# Main execution +main() { + local original_dir="$PWD" + log "Flutter Monorepo Update Script Started: $(date)" + log "Log file: $LOG_FILE" + + # Check if Flutter is installed + if ! command -v flutter &> /dev/null; then + log_error "Flutter is not installed or not in PATH" + exit 1 + fi + + # Upgrade Flutter SDK + log "" + log "=========================================" + log "Upgrading Flutter SDK" + log "=========================================" + + if ! flutter upgrade > "$TEMP_LOG" 2>&1; then + log_error "Failed to upgrade Flutter SDK" + cat "$TEMP_LOG" >> "$LOG_FILE" + exit 1 + fi + + local flutter_version + flutter_version=$(get_flutter_version) + log_info "Flutter upgraded to version: $flutter_version" + + # Find all Flutter projects in the current directory + local projects=() + for dir in */; do + if [[ -d "$dir" ]] && is_flutter_project "$dir"; then + projects+=("$dir") + fi + done + + if [[ ${#projects[@]} -eq 0 ]]; then + log_warning "No Flutter projects found in the current directory" + exit 0 + fi + + log_info "Found ${#projects[@]} Flutter project(s): ${projects[*]}" + + # Process each project + local success_count=0 + local failure_count=0 + local failed_projects=() + + for project in "${projects[@]}"; do + if process_project "$project"; then + ((success_count++)) + else + ((failure_count++)) + failed_projects+=("$(basename "$project")") + fi + + # Return to root directory + cd "$original_dir" + done + + # Summary + log "" + log "=========================================" + log "Update Summary" + log "=========================================" + log_info "Total projects processed: ${#projects[@]}" + log_info "Successful: $success_count" + + if [[ $failure_count -gt 0 ]]; then + log_error "Failed: $failure_count" + log_error "Failed projects: ${failed_projects[*]}" + fi + + log "" + log "Flutter Monorepo Update Script Completed: $(date)" + + # Cleanup + rm -f "$TEMP_LOG" + + # Exit with error code if any projects failed + if [[ $failure_count -gt 0 ]]; then + exit 1 + fi +} + +# Run main function +main "$@" \ No newline at end of file diff --git a/veggieseasons/pubspec.yaml b/veggieseasons/pubspec.yaml index 039069742..7bd4ff4c8 100644 --- a/veggieseasons/pubspec.yaml +++ b/veggieseasons/pubspec.yaml @@ -5,12 +5,11 @@ publish_to: none version: 1.2.0 environment: - sdk: '>=3.9.0-0 <4.0.0' + sdk: '>= <1.0.0' dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.2 font_awesome_flutter: ^10.1.0 intl: ^0.20.0 diff --git a/web_embedding/ng-flutter/flutter/pubspec.yaml b/web_embedding/ng-flutter/flutter/pubspec.yaml index 715cd41c1..a1e338bf5 100644 --- a/web_embedding/ng-flutter/flutter/pubspec.yaml +++ b/web_embedding/ng-flutter/flutter/pubspec.yaml @@ -5,7 +5,6 @@ version: 1.0.0 environment: sdk: '>=3.9.0-0 <4.0.0' - flutter: ">=3.22.0" dependencies: flutter: diff --git a/workspace.md b/workspace.md new file mode 100644 index 000000000..6840f4486 --- /dev/null +++ b/workspace.md @@ -0,0 +1 @@ +Read https://dart.dev/tools/pub/workspaces \ No newline at end of file