From 03cad9d6923b1261fa6fb05b8242f98d8e7227ed Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Mon, 30 Nov 2026 19:16:36 +0800 Subject: [PATCH 1/8] Migrate to material_ui and raise SDK floor (3.0.0) Replace package:flutter/material.dart with package:material_ui/material_ui.dart in lib/ and the example, add material_ui ^1.0.0, and raise the SDK floor to Dart ^3.12.0 / Flutter >=3.44.0 (FPL-48). The template now builds a material_ui MaterialApp, so material_ui widgets inside example pages find their MaterialLocalizations. Public types now come from material_ui, hence 3.0.0. Adds a widget test that pumps BaseflowPluginExample with a material_ui TextField and DropdownMenu; it fails with "No MaterialLocalizations found" on 2.2.1. Linear: FPL-58 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 ++++ README.md | 8 ++++++- example/lib/main.dart | 2 +- example/pubspec.yaml | 5 ++-- lib/src/app.dart | 2 +- lib/src/globals.dart | 2 +- lib/src/home.dart | 2 +- lib/src/info_page.dart | 2 +- pubspec.yaml | 7 +++--- test/material_ui_compat_test.dart | 38 +++++++++++++++++++++++++++++++ 10 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 test/material_ui_compat_test.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index a4f0f0a..17e7569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.0.0 + +- **BREAKING CHANGE**: Migrates from `package:flutter/material.dart` to the `material_ui` package (`package:material_ui/material_ui.dart`). `BaseflowPluginExample` now builds a `material_ui` `MaterialApp`, so example pages built with `material_ui` widgets (such as `TextField` and `DropdownMenu`) find their `MaterialLocalizations`. Public types such as the `MaterialColor` returned by `BaseflowPluginExample.createMaterialColor` now come from `material_ui`; examples should import `package:material_ui/material_ui.dart` instead of `package:flutter/material.dart`. +- Raises the minimum SDK to Dart 3.12.0 and Flutter 3.44.0. + ## 2.2.1 - Fixes complile error on latest versions of Flutter. diff --git a/README.md b/README.md index 06cad20..bfec66c 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,15 @@ Add the dependency in the yaml of the example: ```yaml dependencies: - baseflow_plugin_template: ^2.2.0 + baseflow_plugin_template: ^3.0.0 + material_ui: ^1.0.0 ``` +Version 3.0.0 and up require Dart 3.12.0 and Flutter 3.44.0 or newer, and build on the +[material_ui](https://pub.dev/packages/material_ui) package. Import +`package:material_ui/material_ui.dart` in your example instead of +`package:flutter/material.dart`, so your pages and the template use the same Material library. + And run the template app: ```dart diff --git a/example/lib/main.dart b/example/lib/main.dart index 72aa8ed..94056bf 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,5 @@ import 'package:baseflow_plugin_template/baseflow_plugin_template.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; void main() { runApp(BaseflowPluginExample( diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 374312f..3b56275 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -5,12 +5,13 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0 environment: - sdk: ^3.0.0 - flutter: ">=3.19.0" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: sdk: flutter + material_ui: ^1.0.0 baseflow_plugin_template: path: ../ diff --git a/lib/src/app.dart b/lib/src/app.dart index c1c4c15..8871a4d 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -1,6 +1,6 @@ import 'package:baseflow_plugin_template/src/info_page.dart'; import 'package:baseflow_plugin_template/src/page.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'home.dart'; diff --git a/lib/src/globals.dart b/lib/src/globals.dart index a400794..2cba594 100644 --- a/lib/src/globals.dart +++ b/lib/src/globals.dart @@ -1,6 +1,6 @@ import 'dart:core'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'info_page.dart'; diff --git a/lib/src/home.dart b/lib/src/home.dart index 00bb3f5..eefbba3 100644 --- a/lib/src/home.dart +++ b/lib/src/home.dart @@ -1,5 +1,5 @@ import 'package:baseflow_plugin_template/src/page.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; /// A Flutter example demonstrating how the [pluginName] plugin could be used class AppHome extends StatefulWidget { diff --git a/lib/src/info_page.dart b/lib/src/info_page.dart index 2451ac3..1647909 100644 --- a/lib/src/info_page.dart +++ b/lib/src/info_page.dart @@ -1,5 +1,5 @@ import 'package:baseflow_plugin_template/src/page.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:url_launcher/url_launcher.dart'; import 'globals.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 5ec13ff..add7caa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,15 +1,16 @@ name: baseflow_plugin_template description: A template for plugin examples -version: 2.2.1 +version: 3.0.0 repository: https://github.com/Baseflow/baseflow_plugin_template environment: - sdk: ^3.0.0 - flutter: '>=3.19.0' + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: sdk: flutter + material_ui: ^1.0.0 url_launcher: ^6.3.0 dev_dependencies: diff --git a/test/material_ui_compat_test.dart b/test/material_ui_compat_test.dart new file mode 100644 index 0000000..2135d94 --- /dev/null +++ b/test/material_ui_compat_test.dart @@ -0,0 +1,38 @@ +import 'package:baseflow_plugin_template/baseflow_plugin_template.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; + +void main() { + testWidgets( + 'material_ui widgets inside an ExamplePage find MaterialLocalizations', + (tester) async { + await tester.pumpWidget(BaseflowPluginExample( + pluginName: 'test plugin', + githubURL: 'https://github.com/baseflow/baseflow_plugin_template', + pubDevURL: 'https://pub.dev/publishers/baseflow.com/packages', + pages: [ + ExamplePage( + Icons.text_fields, + (context) => Scaffold( + body: Column( + children: [ + const TextField(), + DropdownMenu( + dropdownMenuEntries: const >[ + DropdownMenuEntry(value: 'a', label: 'A'), + DropdownMenuEntry(value: 'b', label: 'B'), + ], + ), + ], + ), + ), + ), + ], + )); + await tester.pumpAndSettle(); + + expect(tester.takeException(), isNull); + expect(find.byType(TextField), findsWidgets); + expect(find.byType(DropdownMenu), findsOneWidget); + }); +} From 99dcd093f4cff49e83deddc8447ddda6a6df788e Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Mon, 30 Nov 2026 19:16:50 +0800 Subject: [PATCH 2/8] Apply dart format (Dart 3.12 tall style) Co-Authored-By: Claude Opus 5.5 --- example/lib/main.dart | 18 +++++----- lib/src/app.dart | 28 +++++----------- lib/src/globals.dart | 10 +++--- lib/src/home.dart | 14 +++++--- lib/src/info_page.dart | 47 ++++++++++---------------- test/material_ui_compat_test.dart | 55 ++++++++++++++++--------------- 6 files changed, 79 insertions(+), 93 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 94056bf..4a51f79 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -2,12 +2,14 @@ import 'package:baseflow_plugin_template/baseflow_plugin_template.dart'; import 'package:material_ui/material_ui.dart'; void main() { - runApp(BaseflowPluginExample( - pluginName: 'test plugin', - githubURL: 'https://github.com/baseflow/baseflow_plugin_template', - pubDevURL: 'https://pub.dev/publishers/baseflow.com/packages', - pages: [CenteredText.createPage()], - )); + runApp( + BaseflowPluginExample( + pluginName: 'test plugin', + githubURL: 'https://github.com/baseflow/baseflow_plugin_template', + pubDevURL: 'https://pub.dev/publishers/baseflow.com/packages', + pages: [CenteredText.createPage()], + ), + ); } class CenteredText extends StatelessWidget { @@ -19,8 +21,6 @@ class CenteredText extends StatelessWidget { @override Widget build(BuildContext context) { - return const Center( - child: Text('Very simple example'), - ); + return const Center(child: Text('Very simple example')); } } diff --git a/lib/src/app.dart b/lib/src/app.dart index 8871a4d..51e65d1 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -11,8 +11,9 @@ class BaseflowPluginExample extends StatelessWidget { final List? appBarActions; /// [MaterialColor] to be used in the app [ThemeData] - final MaterialColor themeMaterialColor = - createMaterialColor(const Color.fromRGBO(48, 49, 60, 1)); + final MaterialColor themeMaterialColor = createMaterialColor( + const Color.fromRGBO(48, 49, 60, 1), + ); BaseflowPluginExample({ super.key, @@ -31,9 +32,9 @@ class BaseflowPluginExample extends StatelessWidget { title: 'Baseflow $pluginName', theme: ThemeData( colorScheme: Theme.of(context).colorScheme.copyWith( - secondary: Colors.white60, - surface: const Color.fromRGBO(48, 49, 60, 0.8), - ), + secondary: Colors.white60, + surface: const Color.fromRGBO(48, 49, 60, 0.8), + ), buttonTheme: ButtonThemeData( buttonColor: themeMaterialColor.shade500, disabledColor: themeMaterialColor.withRed(200), @@ -46,21 +47,10 @@ class BaseflowPluginExample extends StatelessWidget { hintColor: themeMaterialColor.shade500, primarySwatch: createMaterialColor(const Color.fromRGBO(48, 49, 60, 1)), textTheme: const TextTheme( - bodyLarge: TextStyle( - color: Colors.white, - fontSize: 16, - height: 1.3, - ), - bodyMedium: TextStyle( - color: Colors.white, - fontSize: 18, - height: 1.2, - ), + bodyLarge: TextStyle(color: Colors.white, fontSize: 16, height: 1.3), + bodyMedium: TextStyle(color: Colors.white, fontSize: 18, height: 1.2), labelLarge: TextStyle(color: Colors.white), - displayLarge: TextStyle( - color: Colors.white, - fontSize: 18, - ), + displayLarge: TextStyle(color: Colors.white, fontSize: 18), ), visualDensity: VisualDensity.adaptivePlatformDensity, inputDecorationTheme: const InputDecorationTheme( diff --git a/lib/src/globals.dart b/lib/src/globals.dart index 2cba594..034f171 100644 --- a/lib/src/globals.dart +++ b/lib/src/globals.dart @@ -8,14 +8,12 @@ import 'info_page.dart'; const String baseflowUrl = 'https://baseflow.com'; /// [EdgeInsets] to define horizontal padding throughout the application. -const EdgeInsets defaultHorizontalPadding = - EdgeInsets.symmetric(horizontal: 24); +const EdgeInsets defaultHorizontalPadding = EdgeInsets.symmetric( + horizontal: 24, +); /// [EdgeInsets] to define vertical padding throughout the application. const EdgeInsets defaultVerticalPadding = EdgeInsets.symmetric(vertical: 24); /// Returns a [List] with [IconData] to show in the [AppHome] [AppBar]. -final List icons = [ - Icons.save_alt, - Icons.info_outline, -]; +final List icons = [Icons.save_alt, Icons.info_outline]; diff --git a/lib/src/home.dart b/lib/src/home.dart index eefbba3..3783c92 100644 --- a/lib/src/home.dart +++ b/lib/src/home.dart @@ -36,8 +36,11 @@ class _AppHomeState extends State { backgroundColor: Theme.of(context).bottomAppBarTheme.color, actions: _currentPage == 0 ? widget.appBarActions : null, title: Center( - child: Image.asset('assets/logo.png', - width: 140, package: 'baseflow_plugin_template'), + child: Image.asset( + 'assets/logo.png', + width: 140, + package: 'baseflow_plugin_template', + ), ), ), backgroundColor: Theme.of(context).bottomAppBarTheme.color, @@ -78,8 +81,11 @@ class _AppHomeState extends State { } void _animateToPage(int page) { - _pageController.animateToPage(page, - duration: const Duration(milliseconds: 200), curve: Curves.linear); + _pageController.animateToPage( + page, + duration: const Duration(milliseconds: 200), + curve: Curves.linear, + ); } Color _bottomAppBarIconColor(int page) { diff --git a/lib/src/info_page.dart b/lib/src/info_page.dart index 1647909..6869fa4 100644 --- a/lib/src/info_page.dart +++ b/lib/src/info_page.dart @@ -12,12 +12,13 @@ class InfoPage extends StatelessWidget { String pubDevUrl, ) { return ExamplePage( - Icons.info_outline, - (context) => InfoPage._( - pluginName: pluginName, - githubUrl: githubUrl, - pubDevUrl: pubDevUrl, - )); + Icons.info_outline, + (context) => InfoPage._( + pluginName: pluginName, + githubUrl: githubUrl, + pubDevUrl: pubDevUrl, + ), + ); } final String pluginName; @@ -44,14 +45,14 @@ class InfoPage extends StatelessWidget { children: [ Align( alignment: Alignment.centerLeft, - child: Image.asset('assets/poweredByBaseflow.png', - width: 250, - alignment: Alignment.centerLeft, - package: 'baseflow_plugin_template'), - ), - const Padding( - padding: EdgeInsets.symmetric(vertical: 24), + child: Image.asset( + 'assets/poweredByBaseflow.png', + width: 250, + alignment: Alignment.centerLeft, + package: 'baseflow_plugin_template', + ), ), + const Padding(padding: EdgeInsets.symmetric(vertical: 24)), Text( 'This app showcases the possibilities of the $pluginName ' 'plugin, powered by Baseflow. ' @@ -61,27 +62,15 @@ class InfoPage extends StatelessWidget { 'apps? Contact us at hello@baseflow.com', style: Theme.of(context).textTheme.bodyLarge, ), - const Padding( - padding: EdgeInsets.symmetric(vertical: 8), - ), - _launcherRaisedButton( - 'Find us on Github', - githubUrl, - context, - ), - _launcherRaisedButton( - 'Find us on pub.dev', - pubDevUrl, - context, - ), + const Padding(padding: EdgeInsets.symmetric(vertical: 8)), + _launcherRaisedButton('Find us on Github', githubUrl, context), + _launcherRaisedButton('Find us on pub.dev', pubDevUrl, context), _launcherRaisedButton( 'Visit baseflow.com', baseflowUrl, context, ), - const Padding( - padding: EdgeInsets.only(bottom: 30), - ), + const Padding(padding: EdgeInsets.only(bottom: 30)), ], ), ), diff --git a/test/material_ui_compat_test.dart b/test/material_ui_compat_test.dart index 2135d94..15a6848 100644 --- a/test/material_ui_compat_test.dart +++ b/test/material_ui_compat_test.dart @@ -4,35 +4,38 @@ import 'package:material_ui/material_ui.dart'; void main() { testWidgets( - 'material_ui widgets inside an ExamplePage find MaterialLocalizations', - (tester) async { - await tester.pumpWidget(BaseflowPluginExample( - pluginName: 'test plugin', - githubURL: 'https://github.com/baseflow/baseflow_plugin_template', - pubDevURL: 'https://pub.dev/publishers/baseflow.com/packages', - pages: [ - ExamplePage( - Icons.text_fields, - (context) => Scaffold( - body: Column( - children: [ - const TextField(), - DropdownMenu( - dropdownMenuEntries: const >[ - DropdownMenuEntry(value: 'a', label: 'A'), - DropdownMenuEntry(value: 'b', label: 'B'), + 'material_ui widgets inside an ExamplePage find MaterialLocalizations', + (tester) async { + await tester.pumpWidget( + BaseflowPluginExample( + pluginName: 'test plugin', + githubURL: 'https://github.com/baseflow/baseflow_plugin_template', + pubDevURL: 'https://pub.dev/publishers/baseflow.com/packages', + pages: [ + ExamplePage( + Icons.text_fields, + (context) => Scaffold( + body: Column( + children: [ + const TextField(), + DropdownMenu( + dropdownMenuEntries: const >[ + DropdownMenuEntry(value: 'a', label: 'A'), + DropdownMenuEntry(value: 'b', label: 'B'), + ], + ), ], ), - ], + ), ), - ), + ], ), - ], - )); - await tester.pumpAndSettle(); + ); + await tester.pumpAndSettle(); - expect(tester.takeException(), isNull); - expect(find.byType(TextField), findsWidgets); - expect(find.byType(DropdownMenu), findsOneWidget); - }); + expect(tester.takeException(), isNull); + expect(find.byType(TextField), findsWidgets); + expect(find.byType(DropdownMenu), findsOneWidget); + }, + ); } From dfa504d129e82624fba73d8152d26b4101f2643e Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Mon, 30 Nov 2026 19:16:50 +0800 Subject: [PATCH 3/8] Import flutter/widgets.dart in page.dart package:flutter/cupertino.dart is deprecated since Flutter 3.47 in favour of cupertino_ui; ExamplePage only needs IconData and WidgetBuilder, which widgets.dart provides. Fixes the deprecated_member_use info on Flutter 3.50.1. Co-Authored-By: Claude Opus 5.5 --- lib/src/page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/page.dart b/lib/src/page.dart index b4f76cf..7d15230 100644 --- a/lib/src/page.dart +++ b/lib/src/page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/cupertino.dart'; +import 'package:flutter/widgets.dart'; class ExamplePage { final IconData icon; From 2cf2fc0676eb450e6b0c90efd1f92a1b123745dc Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Mon, 30 Nov 2026 19:30:57 +0800 Subject: [PATCH 4/8] Replace dead medium.com link in CHANGELOG medium.com answers 403 to bots, which fails the linkinator step in CI. Point the 2.0.0-nullsafety entry at dart.dev/null-safety instead. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17e7569..32e8166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ ## 2.0.0-nullsafety -- Migrates the templates to support sound null safety. Details are described in the [Announcing Dart null safety beta](https://medium.com/flutter/announcing-dart-null-safety-beta-4491da22077a) article. +- Migrates the templates to support sound null safety. Details are described in the [Announcing Dart null safety beta](https://dart.dev/null-safety) article. ## 1.0.0 From c29e23ee347e5c51edc61aecf072bde6284f5813 Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Mon, 30 Nov 2026 19:37:08 +0800 Subject: [PATCH 5/8] Update example Android build to Gradle 9.9.2 / AGP 9.3.1 CI's stable Flutter builds with Java 25, which Gradle 7.6.3 cannot run ("Unsupported class file major version 69"). Move the example's Android project to the current Flutter template: Kotlin DSL build scripts, Gradle 9.9.2, AGP 9.3.1, Kotlin 2.4.20, Java 17 target. applicationId and namespace stay com.example.example. Builds with Flutter 3.44.9 and 3.50.1. Co-Authored-By: Claude Opus 5.5 --- example/android/app/build.gradle | 58 ------------------- example/android/app/build.gradle.kts | 49 ++++++++++++++++ example/android/build.gradle | 18 ------ example/android/build.gradle.kts | 24 ++++++++ example/android/gradle.properties | 7 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 25 -------- example/android/settings.gradle.kts | 26 +++++++++ 8 files changed, 105 insertions(+), 104 deletions(-) delete mode 100644 example/android/app/build.gradle create mode 100644 example/android/app/build.gradle.kts delete mode 100644 example/android/build.gradle create mode 100644 example/android/build.gradle.kts delete mode 100644 example/android/settings.gradle create mode 100644 example/android/settings.gradle.kts diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index 2a2d082..0000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file("local.properties") -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader("UTF-8") { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty("flutter.versionCode") -if (flutterVersionCode == null) { - flutterVersionCode = "1" -} - -def flutterVersionName = localProperties.getProperty("flutter.versionName") -if (flutterVersionName == null) { - flutterVersionName = "1.0" -} - -android { - namespace = "com.example.example" - compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.example" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdk = flutter.minSdkVersion - targetSdk = flutter.targetSdkVersion - versionCode = flutterVersionCode.toInteger() - versionName = flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug - } - } -} - -flutter { - source = "../.." -} diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 0000000..74caf01 --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,49 @@ +plugins { + id("com.android.application") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + // Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION + // is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions) + // You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true` + // flag during build. + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index d2ffbff..0000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = "../build" -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/example/android/build.gradle.kts b/example/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/example/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 3b5b324..e96108c 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,6 @@ -org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574..4307e1c 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.2-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 536165d..0000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false -} - -include ":app" diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts new file mode 100644 index 0000000..989ac5e --- /dev/null +++ b/example/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "9.3.1" apply false + id("org.jetbrains.kotlin.android") version "2.4.20" apply false +} + +include(":app") From 903b92e948c28fa987f17dbadbcd909961125e31 Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Tue, 1 Dec 2026 00:35:45 -0600 Subject: [PATCH 6/8] Run tests in ci --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 239dab8..fad17b3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,6 +48,9 @@ jobs: - name: Analyze static code run: dart analyze + - name: Run test(s) + run: flutter test + - name: Check publish warnings run: dart pub publish --dry-run From 62c4a4044b0bff637b686c87740ea6d3e6f66e7f Mon Sep 17 00:00:00 2001 From: Rick van Dijk Date: Tue, 1 Dec 2026 14:41:01 +0800 Subject: [PATCH 7/8] Exclude build/ in analysis_options.yaml Flutter rewrites analysis_options.yaml during `flutter test` to exclude build/**. In CI that left a modified checked-in file, so the publish dry run that follows the test step failed. Commit the rewritten file so the tree stays clean. Co-Authored-By: Claude Opus 5.5 --- analysis_options.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/analysis_options.yaml b/analysis_options.yaml index a3be6b8..a0be23c 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1,4 @@ +analyzer: + exclude: + - build/** include: package:flutter_lints/flutter.yaml \ No newline at end of file From 5da89b956d20ae9f3befe5ddf7c0b9af0b947f1b Mon Sep 17 00:00:00 2001 From: Maurits van Beusekom Date: Tue, 1 Dec 2026 09:20:49 +0100 Subject: [PATCH 8/8] Apply suggestion from @rickdijk Co-authored-by: Rick van Dijk --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32e8166..e057001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ ## 2.0.0-nullsafety -- Migrates the templates to support sound null safety. Details are described in the [Announcing Dart null safety beta](https://dart.dev/null-safety) article. +- Migrates the templates to support sound null safety. Details are described in the [Dart null safety](https://dart.dev/null-safety) documentation. ## 1.0.0