diff --git a/.github/workflows/verify-web-demos.yml b/.github/workflows/verify-web-demos.yml index 7329aa694..1db6e7b0c 100644 --- a/.github/workflows/verify-web-demos.yml +++ b/.github/workflows/verify-web-demos.yml @@ -8,6 +8,11 @@ jobs: verify-web-demos: runs-on: ubuntu-latest if: github.repository == 'flutter/samples' + strategy: + matrix: + flutter_version: + - stable + - beta steps: - name: Checkout uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf @@ -16,7 +21,7 @@ jobs: fetch-depth: 0 - uses: subosito/flutter-action@d8687e6979e8ef66d2b2970e2c92c1d8e801d7bf with: - channel: stable + channel: ${{ matrix.flutter_version }} - name: Init scripts run: dart pub get working-directory: web/_tool diff --git a/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart b/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart index 98bf686e8..15e6da3c8 100644 --- a/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart +++ b/add_to_app/android_view/flutter_module_using_plugin/lib/cell.dart @@ -41,13 +41,13 @@ class _CellState extends State with WidgetsBindingObserver { } }); // Keep track of what the current platform lifecycle state is. - WidgetsBinding.instance!.addObserver(this); + WidgetsBinding.instance.addObserver(this); super.initState(); } @override void dispose() { - WidgetsBinding.instance!.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); super.dispose(); } diff --git a/add_to_app/android_view/flutter_module_using_plugin/pubspec.lock b/add_to_app/android_view/flutter_module_using_plugin/pubspec.lock index 4776949f3..a948f2b3f 100644 --- a/add_to_app/android_view/flutter_module_using_plugin/pubspec.lock +++ b/add_to_app/android_view/flutter_module_using_plugin/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -78,7 +78,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: @@ -99,7 +99,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -120,7 +120,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -153,7 +153,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -188,14 +188,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" url_launcher: dependency: "direct main" description: @@ -209,7 +202,7 @@ packages: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.16" url_launcher_ios: dependency: transitive description: @@ -258,7 +251,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=2.10.0" diff --git a/add_to_app/books/flutter_module_books/lib/main.dart b/add_to_app/books/flutter_module_books/lib/main.dart index 0f15d5b9f..dc0c040e4 100644 --- a/add_to_app/books/flutter_module_books/lib/main.dart +++ b/add_to_app/books/flutter_module_books/lib/main.dart @@ -8,7 +8,7 @@ import 'package:flutter_module_books/api.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { - const MyApp({Key key}) : super(key: key); + const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -30,30 +30,28 @@ class FlutterBookApiHandler extends FlutterBookApi { @override void displayBookDetails(Book book) { - assert( - book != null, - 'Non-null book expected from FlutterBookApi.displayBookDetails call.', - ); callback(book); } } class BookDetail extends StatefulWidget { - const BookDetail({this.hostApi, this.flutterApi, Key key}) : super(key: key); + const BookDetail({Key? key, this.hostApi, this.flutterApi, this.book}) + : super(key: key); // These are the outgoing and incoming APIs that are here for injection for // tests. - final HostBookApi hostApi; - final FlutterBookApi flutterApi; + final HostBookApi? hostApi; + final FlutterBookApi? flutterApi; + final Book? book; @override - _BookDetailState createState() => _BookDetailState(); + State createState() => _BookDetailState(); } class _BookDetailState extends State { - Book book; + Book? book; - HostBookApi hostApi; + late HostBookApi hostApi; FocusNode textFocusNode = FocusNode(); TextEditingController titleTextController = TextEditingController(); @@ -63,6 +61,7 @@ class _BookDetailState extends State { @override void initState() { super.initState(); + book = widget.book; // This `HostBookApi` class instance lets us make outgoing calls to the // platform. @@ -80,19 +79,19 @@ class _BookDetailState extends State { // This book model is what we're going to return to Kotlin eventually. // Keep it bound to the UI. this.book = book; - titleTextController.text = book.title; + titleTextController.text = book.title ?? ''; titleTextController.addListener(() { - this.book?.title = titleTextController.text; + this.book!.title = titleTextController.text; }); // Subtitle could be null. // TODO(gaaclarke): https://github.com/flutter/flutter/issues/59118. subtitleTextController.text = book.subtitle ?? ''; subtitleTextController.addListener(() { - this.book?.subtitle = subtitleTextController.text; + this.book!.subtitle = subtitleTextController.text; }); - authorTextController.text = book.author; + authorTextController.text = book.author ?? ''; authorTextController.addListener(() { - this.book?.author = authorTextController.text; + this.book!.author = authorTextController.text; }); }); })); @@ -123,10 +122,12 @@ class _BookDetailState extends State { IconButton( icon: const Icon(Icons.check), // Pressing save sends the updated book to the platform. - onPressed: () { - hostApi.finishEditingBook(book); - clear(); - }, + onPressed: book != null + ? () { + hostApi.finishEditingBook(book!); + clear(); + } + : null, ), ], ), @@ -134,70 +135,98 @@ class _BookDetailState extends State { // Draw a spinner until the platform gives us the book to show details // for. ? const Center(child: CircularProgressIndicator()) - : Focus( + : BookForm( + book: book!, focusNode: textFocusNode, - child: ListView( - padding: const EdgeInsets.all(24), - children: [ - TextField( - controller: titleTextController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - filled: true, - hintText: "Title", - labelText: "Title", - ), - ), - const SizedBox(height: 24), - TextField( - controller: subtitleTextController, - maxLines: 2, - decoration: const InputDecoration( - border: OutlineInputBorder(), - filled: true, - hintText: "Subtitle", - labelText: "Subtitle", - ), - ), - const SizedBox(height: 24), - TextField( - controller: authorTextController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - filled: true, - hintText: "Author", - labelText: "Author", - ), - ), - const SizedBox(height: 32), - const Divider(), - Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - '${book.pageCount} pages ~ published ${book.publishDate}'), - ), - ), - const Divider(), - const SizedBox(height: 32), - const Center( - child: Text( - 'BOOK DESCRIPTION', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - decoration: TextDecoration.underline, - ), - ), - ), - const SizedBox(height: 12), - Text( - book.summary, - style: TextStyle(color: Colors.grey.shade600, height: 1.24), - ), - ], - ), + authorTextController: authorTextController, + subtitleTextController: subtitleTextController, + titleTextController: titleTextController, ), ); } } + +class BookForm extends StatelessWidget { + const BookForm({ + Key? key, + required this.book, + required this.focusNode, + required this.authorTextController, + required this.subtitleTextController, + required this.titleTextController, + }) : super(key: key); + + final Book book; + final FocusNode focusNode; + final TextEditingController titleTextController; + final TextEditingController subtitleTextController; + final TextEditingController authorTextController; + + @override + Widget build(BuildContext context) { + return Focus( + focusNode: focusNode, + child: ListView( + padding: const EdgeInsets.all(24), + children: [ + TextField( + controller: titleTextController, + decoration: const InputDecoration( + border: OutlineInputBorder(), + filled: true, + hintText: "Title", + labelText: "Title", + ), + ), + const SizedBox(height: 24), + TextField( + controller: subtitleTextController, + maxLines: 2, + decoration: const InputDecoration( + border: OutlineInputBorder(), + filled: true, + hintText: "Subtitle", + labelText: "Subtitle", + ), + ), + const SizedBox(height: 24), + TextField( + controller: authorTextController, + decoration: const InputDecoration( + border: OutlineInputBorder(), + filled: true, + hintText: "Author", + labelText: "Author", + ), + ), + const SizedBox(height: 32), + const Divider(), + Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + '${book.pageCount} pages ~ published ${book.publishDate}'), + ), + ), + const Divider(), + const SizedBox(height: 32), + const Center( + child: Text( + 'BOOK DESCRIPTION', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ), + ), + ), + const SizedBox(height: 12), + Text( + book.summary ?? '', + style: TextStyle(color: Colors.grey.shade600, height: 1.24), + ), + ], + ), + ); + } +} diff --git a/add_to_app/books/flutter_module_books/pigeon/schema.dart b/add_to_app/books/flutter_module_books/pigeon/schema.dart index 8f02b5114..9203e764e 100644 --- a/add_to_app/books/flutter_module_books/pigeon/schema.dart +++ b/add_to_app/books/flutter_module_books/pigeon/schema.dart @@ -2,22 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter_module_books/api.dart'; import 'package:pigeon/pigeon.dart'; -class Book { - String title; - String subtitle; - String author; - String summary; - String publishDate; - int pageCount; - Thumbnail thumbnail; -} - -class Thumbnail { - String url; -} - @FlutterApi() abstract class FlutterBookApi { void displayBookDetails(Book book); diff --git a/add_to_app/books/flutter_module_books/pubspec.lock b/add_to_app/books/flutter_module_books/pubspec.lock index 0d444170e..60ba9a11b 100644 --- a/add_to_app/books/flutter_module_books/pubspec.lock +++ b/add_to_app/books/flutter_module_books/pubspec.lock @@ -70,7 +70,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -84,14 +84,14 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" file: dependency: transitive description: @@ -110,7 +110,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -129,7 +129,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -143,7 +143,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -164,7 +164,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" pigeon: dependency: "direct dev" description: @@ -190,7 +190,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -225,7 +225,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -239,7 +239,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -255,4 +255,4 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/add_to_app/books/flutter_module_books/pubspec.yaml b/add_to_app/books/flutter_module_books/pubspec.yaml index 38c80c483..98ddc2ee5 100644 --- a/add_to_app/books/flutter_module_books/pubspec.yaml +++ b/add_to_app/books/flutter_module_books/pubspec.yaml @@ -6,7 +6,7 @@ description: A Flutter module using the Pigeon package to demonstrate version: 1.0.0+1 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -16,7 +16,7 @@ dev_dependencies: pigeon: ">=2.0.2 <4.0.0" flutter_test: sdk: flutter - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/add_to_app/books/flutter_module_books/test/widget_test.dart b/add_to_app/books/flutter_module_books/test/widget_test.dart index 6ff5eb5a5..cbf1b8aef 100644 --- a/add_to_app/books/flutter_module_books/test/widget_test.dart +++ b/add_to_app/books/flutter_module_books/test/widget_test.dart @@ -27,7 +27,7 @@ void main() { await tester.pumpWidget( MaterialApp( - home: BookDetail(hostApi: mockHostApi), + home: BookDetail(book: Book(), hostApi: mockHostApi), ), ); diff --git a/add_to_app/fullscreen/flutter_module/pubspec.lock b/add_to_app/fullscreen/flutter_module/pubspec.lock index db1491506..25bf4ff51 100644 --- a/add_to_app/fullscreen/flutter_module/pubspec.lock +++ b/add_to_app/fullscreen/flutter_module/pubspec.lock @@ -7,7 +7,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.1.11" async: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" file: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -111,7 +111,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -125,7 +125,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -146,7 +146,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" platform: dependency: transitive description: @@ -179,7 +179,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -221,7 +221,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -235,14 +235,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.5.0" + version: "8.2.2" webdriver: dependency: transitive description: @@ -251,5 +251,5 @@ packages: source: hosted version: "3.0.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.0.0" diff --git a/add_to_app/fullscreen/flutter_module/pubspec.yaml b/add_to_app/fullscreen/flutter_module/pubspec.yaml index d9939e359..de393b656 100644 --- a/add_to_app/fullscreen/flutter_module/pubspec.yaml +++ b/add_to_app/fullscreen/flutter_module/pubspec.yaml @@ -4,7 +4,7 @@ description: An example Flutter module. version: 1.0.0+1 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -17,7 +17,7 @@ dev_dependencies: flutter_driver: sdk: flutter espresso: ^0.2.0 - flutter_lints: ^1.0.3 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart b/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart index 237cb11c1..b7a00dcdb 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart +++ b/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart @@ -36,7 +36,7 @@ class MyHomePage extends StatefulWidget { final String title; @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } class _MyHomePageState extends State { diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock index 65f07c52c..780db2036 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock +++ b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -85,14 +85,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -106,7 +106,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -120,7 +120,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -139,7 +139,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -174,14 +174,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" url_launcher: dependency: "direct main" description: @@ -195,7 +188,7 @@ packages: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.16" url_launcher_ios: dependency: transitive description: @@ -244,7 +237,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.10.0" diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml index 26b8bed63..8c8fbb757 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml +++ b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml @@ -4,7 +4,7 @@ description: A module that is embedded in the multiple_flutters_ios and multiple version: 1.0.0+1 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart index f4ca0b3d7..4c59ffdcd 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart +++ b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart @@ -15,7 +15,7 @@ void main() { } class Cell extends StatefulWidget { - const Cell({Key key}) : super(key: key); + const Cell({Key? key}) : super(key: key); @override State createState() => _CellState(); @@ -26,8 +26,8 @@ class _CellState extends State with WidgetsBindingObserver { static final AccelerometerEvent defaultPosition = AccelerometerEvent(0, 0, 0); int cellNumber = 0; - Random _random; - AppLifecycleState appLifecycleState; + Random? _random; + AppLifecycleState? appLifecycleState; @override void initState() { @@ -62,8 +62,8 @@ class _CellState extends State with WidgetsBindingObserver { Color randomLightColor() { _random ??= Random(cellNumber); - return Color.fromARGB(255, _random.nextInt(50) + 205, - _random.nextInt(50) + 205, _random.nextInt(50) + 205); + return Color.fromARGB(255, _random!.nextInt(50) + 205, + _random!.nextInt(50) + 205, _random!.nextInt(50) + 205); } @override @@ -113,15 +113,20 @@ class _CellState extends State with WidgetsBindingObserver { : Stream.value(defaultPosition), initialData: defaultPosition, builder: (context, snapshot) { + final data = snapshot.data; + if (data == null) { + return const CircularProgressIndicator.adaptive(); + } return Transform( - // Figure out the phone's orientation relative - // to gravity's direction. Ignore the z vector. - transform: Matrix4.rotationX( - snapshot.data.y / gravity * pi / 2) - ..multiply(Matrix4.rotationY( - snapshot.data.x / gravity * pi / 2)), - alignment: Alignment.center, - child: const FlutterLogo(size: 72)); + // Figure out the phone's orientation relative + // to gravity's direction. Ignore the z vector. + transform: Matrix4.rotationX( + data.y / gravity * pi / 2, + )..multiply( + Matrix4.rotationY(data.x / gravity * pi / 2)), + alignment: Alignment.center, + child: const FlutterLogo(size: 72), + ); }, ), ), diff --git a/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart index 57a47a700..69aacdc6f 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart +++ b/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart @@ -69,7 +69,7 @@ class CounterModel extends ChangeNotifier { /// It offers two routes, one suitable for displaying as a full screen and /// another designed to be part of a larger UI. class MyApp extends StatelessWidget { - const MyApp({Key key}) : super(key: key); + const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -86,7 +86,7 @@ class MyApp extends StatelessWidget { /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// full-screen. class FullScreenView extends StatelessWidget { - const FullScreenView({Key key}) : super(key: key); + const FullScreenView({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -108,7 +108,7 @@ class FullScreenView extends StatelessWidget { class Contents extends StatelessWidget { final bool showExit; - const Contents({this.showExit = false, Key key}) : super(key: key); + const Contents({Key? key, this.showExit = false}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/add_to_app/plugin/flutter_module_using_plugin/pubspec.lock b/add_to_app/plugin/flutter_module_using_plugin/pubspec.lock index 4776949f3..66e3f76b1 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/pubspec.lock +++ b/add_to_app/plugin/flutter_module_using_plugin/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -61,7 +61,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -78,14 +78,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -99,7 +99,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -120,7 +120,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -153,7 +153,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -188,14 +188,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" url_launcher: dependency: "direct main" description: @@ -209,7 +202,7 @@ packages: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.16" url_launcher_ios: dependency: transitive description: @@ -258,7 +251,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.10.0" diff --git a/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml b/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml index b5e10a79c..cb3e2917f 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml +++ b/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml @@ -4,7 +4,7 @@ description: An example Flutter module that uses a plugin. version: 1.0.0+1 environment: - sdk: ">=2.6.0-dev <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/add_to_app/prebuilt_module/flutter_module/lib/main.dart b/add_to_app/prebuilt_module/flutter_module/lib/main.dart index 5a2246e14..3a327a9f7 100644 --- a/add_to_app/prebuilt_module/flutter_module/lib/main.dart +++ b/add_to_app/prebuilt_module/flutter_module/lib/main.dart @@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier { /// It offers two routes, one suitable for displaying as a full screen and /// another designed to be part of a larger UI.class MyApp extends StatelessWidget { class MyApp extends StatelessWidget { - const MyApp({Key key}) : super(key: key); + const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -75,7 +75,7 @@ class MyApp extends StatelessWidget { /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// full-screen. class FullScreenView extends StatelessWidget { - const FullScreenView({Key key}) : super(key: key); + const FullScreenView({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget { class Contents extends StatelessWidget { final bool showExit; - const Contents({this.showExit = false, Key key}) : super(key: key); + const Contents({Key? key, this.showExit = false}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/add_to_app/prebuilt_module/flutter_module/pubspec.lock b/add_to_app/prebuilt_module/flutter_module/pubspec.lock index db1491506..25bf4ff51 100644 --- a/add_to_app/prebuilt_module/flutter_module/pubspec.lock +++ b/add_to_app/prebuilt_module/flutter_module/pubspec.lock @@ -7,7 +7,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.1.11" async: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" file: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -111,7 +111,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -125,7 +125,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -146,7 +146,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" platform: dependency: transitive description: @@ -179,7 +179,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -221,7 +221,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -235,14 +235,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.5.0" + version: "8.2.2" webdriver: dependency: transitive description: @@ -251,5 +251,5 @@ packages: source: hosted version: "3.0.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.0.0" diff --git a/add_to_app/prebuilt_module/flutter_module/pubspec.yaml b/add_to_app/prebuilt_module/flutter_module/pubspec.yaml index 0d61ba562..de393b656 100644 --- a/add_to_app/prebuilt_module/flutter_module/pubspec.yaml +++ b/add_to_app/prebuilt_module/flutter_module/pubspec.yaml @@ -4,7 +4,7 @@ description: An example Flutter module. version: 1.0.0+1 environment: - sdk: ">=2.6.0-dev <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -17,7 +17,7 @@ dev_dependencies: flutter_driver: sdk: flutter espresso: ^0.2.0 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/android_splash_screen/lib/main.dart b/android_splash_screen/lib/main.dart index 7e7a4fe7c..3b75c659b 100644 --- a/android_splash_screen/lib/main.dart +++ b/android_splash_screen/lib/main.dart @@ -42,7 +42,7 @@ class MyHomePage extends StatefulWidget { final String title; @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } class _MyHomePageState extends State { diff --git a/android_splash_screen/pubspec.yaml b/android_splash_screen/pubspec.yaml index 4b53126cc..4d6975354 100644 --- a/android_splash_screen/pubspec.yaml +++ b/android_splash_screen/pubspec.yaml @@ -1,12 +1,12 @@ name: splash_screen_sample description: A sample Flutter app with animated splash screen on Android 12. -publish_to: 'none' +publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/animations/lib/main.dart b/animations/lib/main.dart index c30dbad21..659d3fa4f 100644 --- a/animations/lib/main.dart +++ b/animations/lib/main.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +// ignore: depend_on_referenced_packages import 'package:window_size/window_size.dart'; import 'src/basics/01_animated_container.dart'; diff --git a/animations/lib/src/basics/01_animated_container.dart b/animations/lib/src/basics/01_animated_container.dart index 2b6d47fd6..dd499abd5 100644 --- a/animations/lib/src/basics/01_animated_container.dart +++ b/animations/lib/src/basics/01_animated_container.dart @@ -15,7 +15,7 @@ class AnimatedContainerDemo extends StatefulWidget { static String routeName = '/basics/01_animated_container'; @override - _AnimatedContainerDemoState createState() => _AnimatedContainerDemoState(); + State createState() => _AnimatedContainerDemoState(); } class _AnimatedContainerDemoState extends State { diff --git a/animations/lib/src/basics/03_animation_controller.dart b/animations/lib/src/basics/03_animation_controller.dart index 9d05d4477..2cde3f785 100644 --- a/animations/lib/src/basics/03_animation_controller.dart +++ b/animations/lib/src/basics/03_animation_controller.dart @@ -9,7 +9,7 @@ class AnimationControllerDemo extends StatefulWidget { static const String routeName = '/basics/animation_controller'; @override - _AnimationControllerDemoState createState() => + State createState() => _AnimationControllerDemoState(); } diff --git a/animations/lib/src/basics/04_tweens.dart b/animations/lib/src/basics/04_tweens.dart index acf9a07ea..4806c6c1d 100644 --- a/animations/lib/src/basics/04_tweens.dart +++ b/animations/lib/src/basics/04_tweens.dart @@ -9,7 +9,7 @@ class TweenDemo extends StatefulWidget { static const String routeName = '/basics/tweens'; @override - _TweenDemoState createState() => _TweenDemoState(); + State createState() => _TweenDemoState(); } class _TweenDemoState extends State diff --git a/animations/lib/src/basics/05_animated_builder.dart b/animations/lib/src/basics/05_animated_builder.dart index 78dca83c6..9387f887c 100644 --- a/animations/lib/src/basics/05_animated_builder.dart +++ b/animations/lib/src/basics/05_animated_builder.dart @@ -9,7 +9,7 @@ class AnimatedBuilderDemo extends StatefulWidget { static const String routeName = '/basics/animated_builder'; @override - _AnimatedBuilderDemoState createState() => _AnimatedBuilderDemoState(); + State createState() => _AnimatedBuilderDemoState(); } class _AnimatedBuilderDemoState extends State diff --git a/animations/lib/src/basics/06_custom_tween.dart b/animations/lib/src/basics/06_custom_tween.dart index bc1ac567b..d9c005a20 100644 --- a/animations/lib/src/basics/06_custom_tween.dart +++ b/animations/lib/src/basics/06_custom_tween.dart @@ -20,7 +20,7 @@ class CustomTweenDemo extends StatefulWidget { static const String routeName = '/basics/custom_tweens'; @override - _CustomTweenDemoState createState() => _CustomTweenDemoState(); + State createState() => _CustomTweenDemoState(); } class _CustomTweenDemoState extends State @@ -51,11 +51,6 @@ class _CustomTweenDemoState extends State title: const Text('Custom Tween'), actions: [ MaterialButton( - child: Text( - controller.status == AnimationStatus.completed - ? 'Delete Essay' - : 'Write Essay', - ), textColor: Colors.white, onPressed: () { if (controller.status == AnimationStatus.completed) { @@ -68,6 +63,11 @@ class _CustomTweenDemoState extends State }); } }, + child: Text( + controller.status == AnimationStatus.completed + ? 'Delete Essay' + : 'Write Essay', + ), ), ], ), diff --git a/animations/lib/src/basics/07_tween_sequence.dart b/animations/lib/src/basics/07_tween_sequence.dart index 97bdc49ea..0c59c1e26 100644 --- a/animations/lib/src/basics/07_tween_sequence.dart +++ b/animations/lib/src/basics/07_tween_sequence.dart @@ -9,7 +9,7 @@ class TweenSequenceDemo extends StatefulWidget { static const String routeName = '/basics/chaining_tweens'; @override - _TweenSequenceDemoState createState() => _TweenSequenceDemoState(); + State createState() => _TweenSequenceDemoState(); } class _TweenSequenceDemoState extends State diff --git a/animations/lib/src/basics/08_fade_transition.dart b/animations/lib/src/basics/08_fade_transition.dart index 0aa1bd3f5..87a66c47f 100644 --- a/animations/lib/src/basics/08_fade_transition.dart +++ b/animations/lib/src/basics/08_fade_transition.dart @@ -11,7 +11,7 @@ class FadeTransitionDemo extends StatefulWidget { static const String routeName = '/basics/fade_transition'; @override - _FadeTransitionDemoState createState() => _FadeTransitionDemoState(); + State createState() => _FadeTransitionDemoState(); } class _FadeTransitionDemoState extends State diff --git a/animations/lib/src/misc/animated_list.dart b/animations/lib/src/misc/animated_list.dart index 1f963c49e..bf9d1056a 100644 --- a/animations/lib/src/misc/animated_list.dart +++ b/animations/lib/src/misc/animated_list.dart @@ -9,7 +9,7 @@ class AnimatedListDemo extends StatefulWidget { static String routeName = '/misc/animated_list'; @override - _AnimatedListDemoState createState() => _AnimatedListDemoState(); + State createState() => _AnimatedListDemoState(); } class _AnimatedListDemoState extends State { diff --git a/animations/lib/src/misc/animated_positioned.dart b/animations/lib/src/misc/animated_positioned.dart index 8dbf7c0c9..1e6455cda 100644 --- a/animations/lib/src/misc/animated_positioned.dart +++ b/animations/lib/src/misc/animated_positioned.dart @@ -11,7 +11,7 @@ class AnimatedPositionedDemo extends StatefulWidget { static String routeName = '/basics/09_animated_positioned'; @override - _AnimatedPositionedDemoState createState() => _AnimatedPositionedDemoState(); + State createState() => _AnimatedPositionedDemoState(); } class _AnimatedPositionedDemoState extends State { @@ -62,6 +62,7 @@ class _AnimatedPositionedDemoState extends State { alignment: Alignment.center, width: 150, height: 50, + color: Theme.of(context).primaryColor, child: Text( 'Click Me', style: TextStyle( @@ -69,7 +70,6 @@ class _AnimatedPositionedDemoState extends State { Theme.of(context).buttonTheme.colorScheme!.onPrimary, ), ), - color: Theme.of(context).primaryColor, ), ), ), diff --git a/animations/lib/src/misc/animated_switcher.dart b/animations/lib/src/misc/animated_switcher.dart index aaa4269f3..be391c39e 100644 --- a/animations/lib/src/misc/animated_switcher.dart +++ b/animations/lib/src/misc/animated_switcher.dart @@ -27,7 +27,7 @@ class AnimatedSwitcherDemo extends StatefulWidget { static String routeName = '/basics/10_animated_switcher'; @override - _AnimatedSwitcherDemoState createState() => _AnimatedSwitcherDemoState(); + State createState() => _AnimatedSwitcherDemoState(); } class _AnimatedSwitcherDemoState extends State { @@ -67,8 +67,8 @@ class _AnimatedSwitcherDemoState extends State { duration: const Duration(seconds: 1), child: container, transitionBuilder: (child, animation) => ScaleTransition( - child: child, scale: animation, + child: child, ), ), ), diff --git a/animations/lib/src/misc/card_swipe.dart b/animations/lib/src/misc/card_swipe.dart index cda4e1472..c358b4e66 100644 --- a/animations/lib/src/misc/card_swipe.dart +++ b/animations/lib/src/misc/card_swipe.dart @@ -10,7 +10,7 @@ class CardSwipeDemo extends StatefulWidget { static String routeName = '/misc/card_swipe'; @override - _CardSwipeDemoState createState() => _CardSwipeDemoState(); + State createState() => _CardSwipeDemoState(); } class _CardSwipeDemoState extends State { @@ -105,7 +105,7 @@ class SwipeableCard extends StatefulWidget { : super(key: key); @override - _SwipeableCardState createState() => _SwipeableCardState(); + State createState() => _SwipeableCardState(); } class _SwipeableCardState extends State diff --git a/animations/lib/src/misc/carousel.dart b/animations/lib/src/misc/carousel.dart index 0df484fa2..41d500f5f 100644 --- a/animations/lib/src/misc/carousel.dart +++ b/animations/lib/src/misc/carousel.dart @@ -49,7 +49,7 @@ class Carousel extends StatefulWidget { const Carousel({Key? key, required this.itemBuilder}) : super(key: key); @override - _CarouselState createState() => _CarouselState(); + State createState() => _CarouselState(); } class _CarouselState extends State { diff --git a/animations/lib/src/misc/curved_animation.dart b/animations/lib/src/misc/curved_animation.dart index 4f0c7621d..fcf469f2f 100644 --- a/animations/lib/src/misc/curved_animation.dart +++ b/animations/lib/src/misc/curved_animation.dart @@ -10,7 +10,7 @@ class CurvedAnimationDemo extends StatefulWidget { static const String routeName = '/misc/curved_animation'; @override - _CurvedAnimationDemoState createState() => _CurvedAnimationDemoState(); + State createState() => _CurvedAnimationDemoState(); } class CurveChoice { diff --git a/animations/lib/src/misc/expand_card.dart b/animations/lib/src/misc/expand_card.dart index 6867c5eee..8cbd014da 100644 --- a/animations/lib/src/misc/expand_card.dart +++ b/animations/lib/src/misc/expand_card.dart @@ -24,7 +24,7 @@ class ExpandCardDemo extends StatelessWidget { class ExpandCard extends StatefulWidget { const ExpandCard({Key? key}) : super(key: key); @override - _ExpandCardState createState() => _ExpandCardState(); + State createState() => _ExpandCardState(); } class _ExpandCardState extends State diff --git a/animations/lib/src/misc/physics_card_drag.dart b/animations/lib/src/misc/physics_card_drag.dart index 3399274a7..90e3763c4 100644 --- a/animations/lib/src/misc/physics_card_drag.dart +++ b/animations/lib/src/misc/physics_card_drag.dart @@ -31,7 +31,7 @@ class DraggableCard extends StatefulWidget { final Widget child; @override - _DraggableCardState createState() => _DraggableCardState(); + State createState() => _DraggableCardState(); } class _DraggableCardState extends State diff --git a/animations/lib/src/misc/repeating_animation.dart b/animations/lib/src/misc/repeating_animation.dart index 3c083b1c6..500328399 100644 --- a/animations/lib/src/misc/repeating_animation.dart +++ b/animations/lib/src/misc/repeating_animation.dart @@ -9,10 +9,10 @@ class RepeatingAnimationDemo extends StatefulWidget { static String routeName = '/misc/repeating_animation'; @override - RepeatingAnimationDemoState createState() => RepeatingAnimationDemoState(); + State createState() => _RepeatingAnimationDemoState(); } -class RepeatingAnimationDemoState extends State +class _RepeatingAnimationDemoState extends State with SingleTickerProviderStateMixin { late final AnimationController _controller; late final Animation _borderRadius; diff --git a/animations/linux/flutter/generated_plugins.cmake b/animations/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/animations/linux/flutter/generated_plugins.cmake +++ b/animations/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/animations/macos/Podfile.lock b/animations/macos/Podfile.lock index 37545b33a..ff91536ac 100644 --- a/animations/macos/Podfile.lock +++ b/animations/macos/Podfile.lock @@ -19,4 +19,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/animations/pubspec.lock b/animations/pubspec.lock index 6035775a0..4d73d8db2 100644 --- a/animations/pubspec.lock +++ b/animations/pubspec.lock @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -173,4 +173,4 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/animations/pubspec.yaml b/animations/pubspec.yaml index 001f48415..4f1330bd0 100644 --- a/animations/pubspec.yaml +++ b/animations/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -14,7 +14,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 # plugin is not yet part of the flutter framework window_size: diff --git a/desktop_photo_search/fluent_ui/analysis_options.yaml b/desktop_photo_search/fluent_ui/analysis_options.yaml index f04c6cf0f..09405a34a 100644 --- a/desktop_photo_search/fluent_ui/analysis_options.yaml +++ b/desktop_photo_search/fluent_ui/analysis_options.yaml @@ -1 +1,4 @@ include: ../../analysis_options.yaml + +analyzer: + exclude: [lib/src/**.g.dart] diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart index 89a05c8fc..37862907f 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/photo_details.dart @@ -26,7 +26,7 @@ class PhotoDetails extends StatefulWidget { final PhotoDetailsPhotoSaveCallback onPhotoSave; @override - _PhotoDetailsState createState() => _PhotoDetailsState(); + State createState() => _PhotoDetailsState(); } class _PhotoDetailsState extends State { diff --git a/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart b/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart index c4e98608c..d98b68e3a 100644 --- a/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart +++ b/desktop_photo_search/fluent_ui/lib/src/widgets/unsplash_notice.dart @@ -27,7 +27,7 @@ class _UnsplashNoticeState extends State { @override void initState() { super.initState(); - WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { showDialog( context: context, builder: (context) { diff --git a/desktop_photo_search/fluent_ui/linux/flutter/generated_plugins.cmake b/desktop_photo_search/fluent_ui/linux/flutter/generated_plugins.cmake index 44f809bcf..555ea5b5f 100644 --- a/desktop_photo_search/fluent_ui/linux/flutter/generated_plugins.cmake +++ b/desktop_photo_search/fluent_ui/linux/flutter/generated_plugins.cmake @@ -9,6 +9,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -17,3 +20,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/desktop_photo_search/fluent_ui/pubspec.lock b/desktop_photo_search/fluent_ui/pubspec.lock index 412155337..58f037f18 100644 --- a/desktop_photo_search/fluent_ui/pubspec.lock +++ b/desktop_photo_search/fluent_ui/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "38.0.0" + version: "39.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "4.0.0" archive: dependency: transitive description: @@ -30,7 +30,7 @@ packages: source: hosted version: "2.3.0" async: - dependency: transitive + dependency: "direct dev" description: name: async url: "https://pub.dartlang.org" @@ -70,7 +70,7 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.8" build_runner: dependency: "direct dev" description: @@ -161,7 +161,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -175,14 +175,14 @@ packages: name: cross_file url: "https://pub.dartlang.org" source: hosted - version: "0.3.2" + version: "0.3.3" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -203,14 +203,14 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -299,7 +299,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_localizations: dependency: transitive description: flutter @@ -398,21 +398,21 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.5.0" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: "direct main" description: @@ -433,7 +433,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" menubar: dependency: "direct main" description: @@ -456,7 +456,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" msix: dependency: "direct dev" description: @@ -484,14 +484,14 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" plugin_platform_interface: dependency: transitive description: @@ -533,7 +533,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "3.1.0" recase: dependency: transitive description: @@ -573,14 +573,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -622,7 +622,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" timing: dependency: transitive description: @@ -657,7 +657,7 @@ packages: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.16" url_launcher_ios: dependency: transitive description: @@ -713,7 +713,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -727,14 +727,14 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.5.1" + version: "2.5.2" window_size: dependency: "direct main" description: @@ -750,7 +750,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.1" yaml: dependency: transitive description: @@ -759,5 +759,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.10.0" diff --git a/desktop_photo_search/fluent_ui/pubspec.yaml b/desktop_photo_search/fluent_ui/pubspec.yaml index c6118cfac..7e350ce85 100644 --- a/desktop_photo_search/fluent_ui/pubspec.yaml +++ b/desktop_photo_search/fluent_ui/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=2.15.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: built_collection: ^5.1.1 @@ -34,10 +34,11 @@ dependencies: uuid: ^3.0.5 dev_dependencies: + async: ^2.8.2 build: ^2.2.1 build_runner: ^2.1.7 built_value_generator: ^8.3.0 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter_test: sdk: flutter grinder: ^0.9.0 diff --git a/desktop_photo_search/fluent_ui/windows/flutter/generated_plugins.cmake b/desktop_photo_search/fluent_ui/windows/flutter/generated_plugins.cmake index af19be875..2e3934c21 100644 --- a/desktop_photo_search/fluent_ui/windows/flutter/generated_plugins.cmake +++ b/desktop_photo_search/fluent_ui/windows/flutter/generated_plugins.cmake @@ -9,6 +9,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -17,3 +20,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/desktop_photo_search/material/analysis_options.yaml b/desktop_photo_search/material/analysis_options.yaml index f04c6cf0f..09405a34a 100644 --- a/desktop_photo_search/material/analysis_options.yaml +++ b/desktop_photo_search/material/analysis_options.yaml @@ -1 +1,4 @@ include: ../../analysis_options.yaml + +analyzer: + exclude: [lib/src/**.g.dart] diff --git a/desktop_photo_search/material/lib/src/widgets/photo_details.dart b/desktop_photo_search/material/lib/src/widgets/photo_details.dart index 866a652a9..79867fc0d 100644 --- a/desktop_photo_search/material/lib/src/widgets/photo_details.dart +++ b/desktop_photo_search/material/lib/src/widgets/photo_details.dart @@ -24,7 +24,7 @@ class PhotoDetails extends StatefulWidget { final PhotoDetailsPhotoSaveCallback onPhotoSave; @override - _PhotoDetailsState createState() => _PhotoDetailsState(); + State createState() => _PhotoDetailsState(); } class _PhotoDetailsState extends State { diff --git a/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart b/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart index d14c7c61a..cb68770f6 100644 --- a/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart +++ b/desktop_photo_search/material/lib/src/widgets/unsplash_notice.dart @@ -27,7 +27,7 @@ class _UnsplashNoticeState extends State { @override void initState() { super.initState(); - WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { showDialog( barrierDismissible: false, context: context, diff --git a/desktop_photo_search/material/linux/flutter/generated_plugins.cmake b/desktop_photo_search/material/linux/flutter/generated_plugins.cmake index 44f809bcf..555ea5b5f 100644 --- a/desktop_photo_search/material/linux/flutter/generated_plugins.cmake +++ b/desktop_photo_search/material/linux/flutter/generated_plugins.cmake @@ -9,6 +9,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -17,3 +20,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/desktop_photo_search/material/pubspec.lock b/desktop_photo_search/material/pubspec.lock index d448dfbd3..93cd46104 100644 --- a/desktop_photo_search/material/pubspec.lock +++ b/desktop_photo_search/material/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "38.0.0" + version: "39.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "4.0.0" archive: dependency: transitive description: @@ -30,7 +30,7 @@ packages: source: hosted version: "2.3.0" async: - dependency: transitive + dependency: "direct dev" description: name: async url: "https://pub.dartlang.org" @@ -70,7 +70,7 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.8" build_runner: dependency: "direct dev" description: @@ -161,7 +161,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -175,14 +175,14 @@ packages: name: cross_file url: "https://pub.dartlang.org" source: hosted - version: "0.3.2" + version: "0.3.3" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -203,14 +203,14 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -285,7 +285,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_simple_treeview: dependency: "direct main" description: @@ -379,21 +379,21 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.5.0" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: "direct main" description: @@ -414,7 +414,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" menubar: dependency: "direct main" description: @@ -437,7 +437,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" msix: dependency: "direct dev" description: @@ -465,14 +465,14 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" plugin_platform_interface: dependency: transitive description: @@ -514,7 +514,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "3.1.0" shelf: dependency: transitive description: @@ -540,14 +540,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -589,7 +589,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" timing: dependency: transitive description: @@ -624,7 +624,7 @@ packages: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.16" url_launcher_ios: dependency: transitive description: @@ -680,7 +680,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -694,14 +694,14 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.5.1" + version: "2.5.2" window_size: dependency: "direct main" description: @@ -717,7 +717,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.1" yaml: dependency: transitive description: @@ -726,5 +726,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.10.0" diff --git a/desktop_photo_search/material/pubspec.yaml b/desktop_photo_search/material/pubspec.yaml index a515447f3..9b522d15b 100644 --- a/desktop_photo_search/material/pubspec.yaml +++ b/desktop_photo_search/material/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=2.15.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: built_collection: ^5.1.1 @@ -33,10 +33,11 @@ dependencies: path: plugins/window_size dev_dependencies: + async: ^2.8.2 build: ^2.2.1 build_runner: ^2.1.7 built_value_generator: ^8.3.0 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter_test: sdk: flutter grinder: ^0.9.0 diff --git a/desktop_photo_search/material/windows/flutter/generated_plugins.cmake b/desktop_photo_search/material/windows/flutter/generated_plugins.cmake index af19be875..2e3934c21 100644 --- a/desktop_photo_search/material/windows/flutter/generated_plugins.cmake +++ b/desktop_photo_search/material/windows/flutter/generated_plugins.cmake @@ -9,6 +9,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -17,3 +20,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/experimental/federated_plugin/federated_plugin/example/pubspec.lock b/experimental/federated_plugin/federated_plugin/example/pubspec.lock index e9c0b72b1..de82b29dd 100644 --- a/experimental/federated_plugin/federated_plugin/example/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin/example/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" federated_plugin: dependency: "direct main" description: @@ -120,7 +120,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: @@ -141,7 +141,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -155,7 +155,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -174,7 +174,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -209,21 +209,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0-0 <3.0.0" diff --git a/experimental/federated_plugin/federated_plugin/example/windows/flutter/generated_plugins.cmake b/experimental/federated_plugin/federated_plugin/example/windows/flutter/generated_plugins.cmake index 176412102..d9e53e87a 100644 --- a/experimental/federated_plugin/federated_plugin/example/windows/flutter/generated_plugins.cmake +++ b/experimental/federated_plugin/federated_plugin/example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST federated_plugin_windows ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/experimental/federated_plugin/federated_plugin/pubspec.lock b/experimental/federated_plugin/federated_plugin/pubspec.lock index 3d0565b49..76c040cf5 100644 --- a/experimental/federated_plugin/federated_plugin/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" federated_plugin_macos: dependency: "direct main" description: @@ -89,7 +89,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -106,14 +106,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -127,7 +127,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -141,7 +141,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -160,7 +160,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -195,21 +195,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/experimental/federated_plugin/federated_plugin/pubspec.yaml b/experimental/federated_plugin/federated_plugin/pubspec.yaml index cd849c4ee..fb5807cc4 100644 --- a/experimental/federated_plugin/federated_plugin/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin/pubspec.yaml @@ -5,8 +5,7 @@ version: 0.0.1 publish_to: "none" environment: - sdk: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -23,7 +22,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: plugin: diff --git a/experimental/federated_plugin/federated_plugin_macos/pubspec.lock b/experimental/federated_plugin/federated_plugin_macos/pubspec.lock index 31b15c16a..df055c8fe 100644 --- a/experimental/federated_plugin/federated_plugin_macos/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin_macos/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -61,7 +61,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -73,7 +73,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -87,7 +87,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -113,7 +113,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -148,21 +148,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/experimental/federated_plugin/federated_plugin_macos/pubspec.yaml b/experimental/federated_plugin/federated_plugin_macos/pubspec.yaml index 11b88d260..988ece1fb 100644 --- a/experimental/federated_plugin/federated_plugin_macos/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin_macos/pubspec.yaml @@ -4,8 +4,7 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -14,7 +13,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: plugin: diff --git a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock index 19c806131..f075305fa 100644 --- a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -61,7 +61,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -73,7 +73,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -87,7 +87,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: "direct main" description: @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -155,21 +155,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.15.1 <3.0.0" - flutter: ">=1.17.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml index 44dfa5af8..656a23841 100644 --- a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml @@ -4,8 +4,7 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.15.1 <3.0.0" - flutter: ">=1.17.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -15,4 +14,4 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 diff --git a/experimental/federated_plugin/federated_plugin_web/pubspec.lock b/experimental/federated_plugin/federated_plugin_web/pubspec.lock index 9d53455bf..fac0ab3a8 100644 --- a/experimental/federated_plugin/federated_plugin_web/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin_web/pubspec.lock @@ -21,7 +21,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.1.11" args: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.0" built_collection: dependency: transitive description: @@ -63,7 +63,7 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.4" + version: "8.3.0" characters: dependency: transitive description: @@ -98,7 +98,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -119,14 +119,14 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" federated_plugin_platform_interface: dependency: "direct main" description: @@ -164,7 +164,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -198,14 +198,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -226,7 +226,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -254,7 +254,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" platform: dependency: transitive description: @@ -294,14 +294,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -343,7 +343,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -357,14 +357,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.5.0" + version: "8.2.2" watcher: dependency: transitive description: @@ -387,5 +387,4 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.15.1 <3.0.0" - flutter: ">=1.17.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/experimental/federated_plugin/federated_plugin_web/pubspec.yaml b/experimental/federated_plugin/federated_plugin_web/pubspec.yaml index 952f9780e..6835ccad3 100644 --- a/experimental/federated_plugin/federated_plugin_web/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin_web/pubspec.yaml @@ -4,8 +4,7 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.17.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -20,7 +19,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 mockito: ^5.0.2 flutter: diff --git a/experimental/federated_plugin/federated_plugin_windows/pubspec.lock b/experimental/federated_plugin/federated_plugin_windows/pubspec.lock index 31b15c16a..df055c8fe 100644 --- a/experimental/federated_plugin/federated_plugin_windows/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin_windows/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -61,7 +61,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -73,7 +73,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -87,7 +87,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -113,7 +113,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -148,21 +148,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/experimental/federated_plugin/federated_plugin_windows/pubspec.yaml b/experimental/federated_plugin/federated_plugin_windows/pubspec.yaml index 85f08724f..de4c6ec94 100644 --- a/experimental/federated_plugin/federated_plugin_windows/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin_windows/pubspec.yaml @@ -4,8 +4,7 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -14,7 +13,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: plugin: diff --git a/experimental/linting_tool/lib/app.dart b/experimental/linting_tool/lib/app.dart index 802b36d9b..b4d2a8bc5 100644 --- a/experimental/linting_tool/lib/app.dart +++ b/experimental/linting_tool/lib/app.dart @@ -19,7 +19,7 @@ class LintingTool extends StatefulWidget { static const String homeRoute = routes.homeRoute; @override - _LintingToolState createState() => _LintingToolState(); + State createState() => _LintingToolState(); } class _LintingToolState extends State { diff --git a/experimental/linting_tool/lib/model/profiles_store.dart b/experimental/linting_tool/lib/model/profiles_store.dart index 5526a584f..854f0f8e9 100644 --- a/experimental/linting_tool/lib/model/profiles_store.dart +++ b/experimental/linting_tool/lib/model/profiles_store.dart @@ -60,6 +60,7 @@ class ProfilesStore extends ChangeNotifier { } Future addToExistingProfile(RulesProfile profile, Rule rule) async { + // ignore: todo // TODO(abd99): Consider refactoring to LinkedHashSet/SplayTreeSet to avoid // duplication automatically. // ref: https://github.com/flutter/samples/pull/870#discussion_r685666792 diff --git a/experimental/linting_tool/lib/model/rules_store.dart b/experimental/linting_tool/lib/model/rules_store.dart index ddfd26b17..25597bec2 100644 --- a/experimental/linting_tool/lib/model/rules_store.dart +++ b/experimental/linting_tool/lib/model/rules_store.dart @@ -32,7 +32,7 @@ class RuleStore extends ChangeNotifier { String? get error => _error; List get defaultProfiles { - List _defaultProfiles = []; + List defaultProfiles = []; var rulesWithDefaultSets = rules.where((rule) => rule.sets.isNotEmpty).toList(); @@ -40,16 +40,16 @@ class RuleStore extends ChangeNotifier { for (final rule in rulesWithDefaultSets) { for (final setName in rule.sets) { var profileIndex = - _defaultProfiles.indexWhere((profile) => profile.name == setName); + defaultProfiles.indexWhere((profile) => profile.name == setName); if (profileIndex >= 0) { - _defaultProfiles[profileIndex].rules.add(rule); + defaultProfiles[profileIndex].rules.add(rule); } else { - _defaultProfiles.add(RulesProfile(name: setName, rules: [rule])); + defaultProfiles.add(RulesProfile(name: setName, rules: [rule])); } } } - return _defaultProfiles; + return defaultProfiles; } Future fetchRules() async { diff --git a/experimental/linting_tool/lib/pages/saved_lints_page.dart b/experimental/linting_tool/lib/pages/saved_lints_page.dart index 42da7781d..672ed49bf 100644 --- a/experimental/linting_tool/lib/pages/saved_lints_page.dart +++ b/experimental/linting_tool/lib/pages/saved_lints_page.dart @@ -10,9 +10,14 @@ import 'package:linting_tool/pages/rules_page.dart'; import 'package:linting_tool/theme/colors.dart'; import 'package:provider/provider.dart'; -class SavedLintsPage extends StatelessWidget { +class SavedLintsPage extends StatefulWidget { const SavedLintsPage({Key? key}) : super(key: key); + @override + State createState() => _SavedLintsPageState(); +} + +class _SavedLintsPageState extends State { @override Widget build(BuildContext context) { return Consumer( @@ -90,11 +95,14 @@ class SavedLintsPage extends StatelessWidget { onSelected: (value) async { switch (value) { case 'Export file': + // ignore: todo // TODO(abd99): Add option to select formatting style. var saved = await profilesStore .exportProfileFile(profile); + if (!mounted) return; + if (!saved) { _showSnackBar( context, @@ -112,12 +120,12 @@ class SavedLintsPage extends StatelessWidget { itemBuilder: (context) { return [ const PopupMenuItem( - child: Text('Export file'), value: 'Export file', + child: Text('Export file'), ), const PopupMenuItem( - child: Text('Delete'), value: 'Delete', + child: Text('Delete'), ), ]; }, diff --git a/experimental/linting_tool/lib/widgets/adaptive_nav.dart b/experimental/linting_tool/lib/widgets/adaptive_nav.dart index c35c1839a..8868ea98e 100644 --- a/experimental/linting_tool/lib/widgets/adaptive_nav.dart +++ b/experimental/linting_tool/lib/widgets/adaptive_nav.dart @@ -18,14 +18,14 @@ class AdaptiveNav extends StatefulWidget { const AdaptiveNav({Key? key}) : super(key: key); @override - _AdaptiveNavState createState() => _AdaptiveNavState(); + State createState() => _AdaptiveNavState(); } class _AdaptiveNavState extends State { @override Widget build(BuildContext context) { final isDesktop = isDisplayLarge(context); - const _navigationDestinations = <_Destination>[ + const navigationDestinations = <_Destination>[ _Destination( textLabel: 'Home', icon: Icons.home_outlined, @@ -46,14 +46,14 @@ class _AdaptiveNavState extends State { ), ]; - final _trailing = { + final trailing = { 'About': Icons.info_outline, }; return _NavView( extended: isDesktop, - destinations: _navigationDestinations, - trailing: _trailing, + destinations: navigationDestinations, + trailing: trailing, ); } } diff --git a/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart b/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart index 647a717d0..64df09601 100644 --- a/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart +++ b/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart @@ -19,7 +19,7 @@ class LintExpansionTile extends StatefulWidget { }) : super(key: key); @override - _LintExpansionTileState createState() => _LintExpansionTileState(); + State createState() => _LintExpansionTileState(); } class _LintExpansionTileState extends State { @@ -142,7 +142,7 @@ class _LintExpansionTileState extends State { await showDialog( context: context, builder: (context) { - return _NewProfileDialog(rule: rule); + return NewProfileDialog(rule: rule); }, ); } else if (destinationProfileType == @@ -150,7 +150,7 @@ class _LintExpansionTileState extends State { await showDialog( context: context, builder: (context) { - return _ExistingProfileDialog(rule: rule); + return ExistingProfileDialog(rule: rule); }, ); } @@ -205,22 +205,27 @@ class _ProfileTypeDialog extends StatelessWidget { } } -class _NewProfileDialog extends StatelessWidget { +class NewProfileDialog extends StatefulWidget { final Rule rule; - const _NewProfileDialog({ + const NewProfileDialog({ required this.rule, Key? key, }) : super(key: key); + @override + State createState() => _NewProfileDialogState(); +} + +class _NewProfileDialogState extends State { @override Widget build(BuildContext context) { String name = ''; - final _formKey = GlobalKey(); + final formKey = GlobalKey(); return AlertDialog( title: const Text('Create new lint profile'), content: Form( - key: _formKey, + key: formKey, autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.min, @@ -251,13 +256,14 @@ class _NewProfileDialog extends StatelessWidget { ), ElevatedButton( onPressed: () async { - if (_formKey.currentState!.validate()) { + if (formKey.currentState!.validate()) { var newProfile = RulesProfile( name: name, - rules: [rule], + rules: [widget.rule], ); await Provider.of(context, listen: false) .addToNewProfile(newProfile); + if (!mounted) return; Navigator.pop(context); } }, @@ -268,14 +274,19 @@ class _NewProfileDialog extends StatelessWidget { } } -class _ExistingProfileDialog extends StatelessWidget { - const _ExistingProfileDialog({ +class ExistingProfileDialog extends StatefulWidget { + const ExistingProfileDialog({ Key? key, required this.rule, }) : super(key: key); final Rule rule; + @override + State createState() => _ExistingProfileDialogState(); +} + +class _ExistingProfileDialogState extends State { @override Widget build(BuildContext context) { var profilesStore = Provider.of(context); @@ -291,7 +302,8 @@ class _ExistingProfileDialog extends StatelessWidget { title: Text(savedProfiles[index].name), onTap: () async { await profilesStore.addToExistingProfile( - savedProfiles[index], rule); + savedProfiles[index], widget.rule); + if (!mounted) return; Navigator.pop(context); }, ), diff --git a/experimental/linting_tool/lib/widgets/saved_rule_tile.dart b/experimental/linting_tool/lib/widgets/saved_rule_tile.dart index fe97cb927..693fdbbc7 100644 --- a/experimental/linting_tool/lib/widgets/saved_rule_tile.dart +++ b/experimental/linting_tool/lib/widgets/saved_rule_tile.dart @@ -18,7 +18,7 @@ class SavedRuleTile extends StatefulWidget { }) : super(key: key); @override - _SavedRuleTileState createState() => _SavedRuleTileState(); + State createState() => _SavedRuleTileState(); } class _SavedRuleTileState extends State { diff --git a/experimental/linting_tool/linux/flutter/generated_plugins.cmake b/experimental/linting_tool/linux/flutter/generated_plugins.cmake index 73c8db305..7c9fef0b8 100644 --- a/experimental/linting_tool/linux/flutter/generated_plugins.cmake +++ b/experimental/linting_tool/linux/flutter/generated_plugins.cmake @@ -8,6 +8,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -16,3 +19,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/experimental/linting_tool/macos/Podfile.lock b/experimental/linting_tool/macos/Podfile.lock index 9acd71665..2ab9ee132 100644 --- a/experimental/linting_tool/macos/Podfile.lock +++ b/experimental/linting_tool/macos/Podfile.lock @@ -29,12 +29,12 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/window_size/macos SPEC CHECKSUMS: - file_selector_macos: ff6dc948d4ddd34e8602a1f60b7d0b4cc6051a47 + file_selector_macos: f1b08a781e66103e3ba279fd5d4024a2478b3af6 FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 path_provider_macos: 160cab0d5461f0c0e02995469a98f24bdb9a3f1f - url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 + url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3 window_size: 339dafa0b27a95a62a843042038fa6c3c48de195 PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c -COCOAPODS: 1.11.0 +COCOAPODS: 1.11.3 diff --git a/experimental/linting_tool/pubspec.lock b/experimental/linting_tool/pubspec.lock index 379ef98a5..6df244240 100644 --- a/experimental/linting_tool/pubspec.lock +++ b/experimental/linting_tool/pubspec.lock @@ -49,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.0" build_config: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.8" build_runner: dependency: "direct dev" description: @@ -98,7 +98,7 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.4" + version: "8.3.0" characters: dependency: transitive description: @@ -140,7 +140,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" context_menus: dependency: "direct main" description: @@ -161,14 +161,14 @@ packages: name: cross_file url: "https://pub.dartlang.org" source: hosted - version: "0.3.2" + version: "0.3.3" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -182,7 +182,7 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" equatable: dependency: "direct main" description: @@ -196,7 +196,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -271,7 +271,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_markdown: dependency: "direct main" description: @@ -372,7 +372,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json2yaml: dependency: "direct main" description: @@ -400,7 +400,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -428,7 +428,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -442,7 +442,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" mockito: dependency: "direct main" description: @@ -470,7 +470,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" path_provider: dependency: transitive description: @@ -484,7 +484,7 @@ packages: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.12" + version: "2.0.13" path_provider_ios: dependency: transitive description: @@ -594,21 +594,21 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_helper: dependency: transitive description: name: source_helper url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.2" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -650,7 +650,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" timing: dependency: transitive description: @@ -671,14 +671,14 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.20" + version: "6.1.0" url_launcher_android: dependency: transitive description: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.16" url_launcher_ios: dependency: transitive description: @@ -727,7 +727,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -741,14 +741,14 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.5.1" + version: "2.5.2" window_size: dependency: "direct main" description: @@ -773,5 +773,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.10.0" diff --git a/experimental/linting_tool/pubspec.yaml b/experimental/linting_tool/pubspec.yaml index 4dd23402b..1c7d6f38c 100644 --- a/experimental/linting_tool/pubspec.yaml +++ b/experimental/linting_tool/pubspec.yaml @@ -3,10 +3,10 @@ description: A new Flutter project. version: 1.0.0+1 -publish_to: 'none' +publish_to: "none" environment: - sdk: ">=2.15.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -39,7 +39,7 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.0.6 - flutter_lints: ^1.0.3 + flutter_lints: ^2.0.1 hive_generator: ^1.1.0 json_serializable: ^6.2.0 diff --git a/experimental/linting_tool/windows/flutter/generated_plugins.cmake b/experimental/linting_tool/windows/flutter/generated_plugins.cmake index f3f27e476..a22fdb08d 100644 --- a/experimental/linting_tool/windows/flutter/generated_plugins.cmake +++ b/experimental/linting_tool/windows/flutter/generated_plugins.cmake @@ -8,6 +8,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -16,3 +19,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/experimental/web_dashboard/lib/src/app.dart b/experimental/web_dashboard/lib/src/app.dart index 6a4b3eed5..ca2a43e33 100644 --- a/experimental/web_dashboard/lib/src/app.dart +++ b/experimental/web_dashboard/lib/src/app.dart @@ -51,7 +51,7 @@ class DashboardApp extends StatefulWidget { super(key: key); @override - _DashboardAppState createState() => _DashboardAppState(); + State createState() => _DashboardAppState(); } class _DashboardAppState extends State { @@ -90,7 +90,7 @@ class SignInSwitcher extends StatefulWidget { }) : super(key: key); @override - _SignInSwitcherState createState() => _SignInSwitcherState(); + State createState() => _SignInSwitcherState(); } class _SignInSwitcherState extends State { diff --git a/experimental/web_dashboard/lib/src/pages/entries.dart b/experimental/web_dashboard/lib/src/pages/entries.dart index 7a0350eb2..7706dc4c9 100644 --- a/experimental/web_dashboard/lib/src/pages/entries.dart +++ b/experimental/web_dashboard/lib/src/pages/entries.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:async'; - import 'package:flutter/material.dart'; import 'package:intl/intl.dart' as intl; import 'package:provider/provider.dart'; @@ -17,7 +15,7 @@ class EntriesPage extends StatefulWidget { const EntriesPage({Key? key}) : super(key: key); @override - _EntriesPageState createState() => _EntriesPageState(); + State createState() => _EntriesPageState(); } class _EntriesPageState extends State { @@ -54,7 +52,7 @@ class EntriesList extends StatefulWidget { }) : super(key: ValueKey(category?.id)); @override - _EntriesListState createState() => _EntriesListState(); + State createState() => _EntriesListState(); } class _EntriesListState extends State { @@ -129,7 +127,9 @@ class EntryTile extends StatelessWidget { TextButton( child: const Text('Delete'), onPressed: () async { - var shouldDelete = await (showDialog( + final appState = Provider.of(context, listen: false); + final scaffoldMessenger = ScaffoldMessenger.of(context); + final bool? shouldDelete = await showDialog( context: context, builder: (context) => AlertDialog( title: const Text('Delete entry?'), @@ -144,14 +144,10 @@ class EntryTile extends StatelessWidget { ), ], ), - ) as FutureOr); - if (shouldDelete) { - await Provider.of(context, listen: false) - .api! - .entries - .delete(category!.id!, entry!.id!); - - ScaffoldMessenger.of(context).showSnackBar( + ); + if (shouldDelete != null && shouldDelete) { + await appState.api!.entries.delete(category!.id!, entry!.id!); + scaffoldMessenger.showSnackBar( const SnackBar( content: Text('Entry deleted'), ), diff --git a/experimental/web_dashboard/lib/src/pages/home.dart b/experimental/web_dashboard/lib/src/pages/home.dart index 0d6ca7e24..fea401a84 100644 --- a/experimental/web_dashboard/lib/src/pages/home.dart +++ b/experimental/web_dashboard/lib/src/pages/home.dart @@ -20,7 +20,7 @@ class HomePage extends StatefulWidget { }) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { diff --git a/experimental/web_dashboard/lib/src/pages/sign_in.dart b/experimental/web_dashboard/lib/src/pages/sign_in.dart index 447c9b50e..1b7918b58 100644 --- a/experimental/web_dashboard/lib/src/pages/sign_in.dart +++ b/experimental/web_dashboard/lib/src/pages/sign_in.dart @@ -37,7 +37,7 @@ class SignInButton extends StatefulWidget { }) : super(key: key); @override - _SignInButtonState createState() => _SignInButtonState(); + State createState() => _SignInButtonState(); } class _SignInButtonState extends State { diff --git a/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart b/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart index 8692bfdbd..dc737982a 100644 --- a/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart +++ b/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart @@ -20,7 +20,7 @@ class CategoryDropdown extends StatefulWidget { }) : super(key: key); @override - _CategoryDropdownState createState() => _CategoryDropdownState(); + State createState() => _CategoryDropdownState(); } class _CategoryDropdownState extends State { @@ -105,6 +105,6 @@ class _CategoryDropdownState extends State { DropdownMenuItem _buildDropdownItem(Category category) { return DropdownMenuItem( - child: Text(category.name), value: category); + value: category, child: Text(category.name)); } } diff --git a/experimental/web_dashboard/lib/src/widgets/category_forms.dart b/experimental/web_dashboard/lib/src/widgets/category_forms.dart index a863f2b19..370f49ddd 100644 --- a/experimental/web_dashboard/lib/src/widgets/category_forms.dart +++ b/experimental/web_dashboard/lib/src/widgets/category_forms.dart @@ -11,7 +11,7 @@ class NewCategoryForm extends StatefulWidget { const NewCategoryForm({Key? key}) : super(key: key); @override - _NewCategoryFormState createState() => _NewCategoryFormState(); + State createState() => _NewCategoryFormState(); } class _NewCategoryFormState extends State { @@ -43,7 +43,7 @@ class EditCategoryForm extends StatefulWidget { }) : super(key: key); @override - _EditCategoryFormState createState() => _EditCategoryFormState(); + State createState() => _EditCategoryFormState(); } class _EditCategoryFormState extends State { diff --git a/experimental/web_dashboard/lib/src/widgets/dialogs.dart b/experimental/web_dashboard/lib/src/widgets/dialogs.dart index f39cb7c42..6f933c54c 100644 --- a/experimental/web_dashboard/lib/src/widgets/dialogs.dart +++ b/experimental/web_dashboard/lib/src/widgets/dialogs.dart @@ -57,7 +57,7 @@ class NewEntryDialog extends StatefulWidget { const NewEntryDialog({Key? key}) : super(key: key); @override - _NewEntryDialogState createState() => _NewEntryDialogState(); + State createState() => _NewEntryDialogState(); } class _NewEntryDialogState extends State { diff --git a/experimental/web_dashboard/lib/src/widgets/edit_entry.dart b/experimental/web_dashboard/lib/src/widgets/edit_entry.dart index 067083dca..3edf854d0 100644 --- a/experimental/web_dashboard/lib/src/widgets/edit_entry.dart +++ b/experimental/web_dashboard/lib/src/widgets/edit_entry.dart @@ -14,7 +14,7 @@ class NewEntryForm extends StatefulWidget { const NewEntryForm({Key? key}) : super(key: key); @override - _NewEntryFormState createState() => _NewEntryFormState(); + State createState() => _NewEntryFormState(); } class _NewEntryFormState extends State { @@ -65,7 +65,7 @@ class EditEntryForm extends StatefulWidget { }) : super(key: key); @override - _EditEntryFormState createState() => _EditEntryFormState(); + State createState() => _EditEntryFormState(); } class _EditEntryFormState extends State { diff --git a/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart b/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart index 1d7a443b0..2f8a33f05 100644 --- a/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart +++ b/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart @@ -47,7 +47,7 @@ class AdaptiveScaffold extends StatefulWidget { }) : super(key: key); @override - _AdaptiveScaffoldState createState() => _AdaptiveScaffoldState(); + State createState() => _AdaptiveScaffoldState(); } class _AdaptiveScaffoldState extends State { diff --git a/experimental/web_dashboard/pubspec.lock b/experimental/web_dashboard/pubspec.lock index a34e90688..6df59c9d4 100644 --- a/experimental/web_dashboard/pubspec.lock +++ b/experimental/web_dashboard/pubspec.lock @@ -91,7 +91,7 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.2.3" + version: "8.3.0" characters: dependency: transitive description: @@ -170,7 +170,7 @@ packages: source: hosted version: "4.1.0" collection: - dependency: transitive + dependency: "direct main" description: name: collection url: "https://pub.dartlang.org" @@ -278,7 +278,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -367,7 +367,7 @@ packages: source: hosted version: "4.0.0" intl: - dependency: transitive + dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" @@ -407,7 +407,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -458,7 +458,7 @@ packages: source: hosted version: "2.0.2" path: - dependency: transitive + dependency: "direct main" description: name: path url: "https://pub.dartlang.org" @@ -638,5 +638,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.8.0" diff --git a/experimental/web_dashboard/pubspec.yaml b/experimental/web_dashboard/pubspec.yaml index 004bbbcbd..1f6fea8f8 100644 --- a/experimental/web_dashboard/pubspec.yaml +++ b/experimental/web_dashboard/pubspec.yaml @@ -2,26 +2,32 @@ name: web_dashboard description: A dashboard app sample version: 1.0.0+1 publish_to: none + environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" + dependencies: - flutter: - sdk: flutter + charts_flutter: ^0.12.0 cloud_firestore: ^3.1.14 + collection: ^1.16.0 cupertino_icons: ^1.0.0 firebase_auth: ^3.3.17 firebase_core: ^1.16.0 + flutter: + sdk: flutter google_sign_in: ^5.3.1 + intl: ^0.17.0 json_annotation: ^4.5.0 + path: ^1.8.1 provider: ^6.0.0 uuid: ^3.0.0 - charts_flutter: ^0.12.0 + dev_dependencies: + build_runner: ^2.1.0 + flutter_lints: ^2.0.1 flutter_test: sdk: flutter - build_runner: ^2.1.0 - json_serializable: ^6.2.0 grinder: ^0.9.0 - flutter_lints: ^1.0.0 + json_serializable: ^6.2.0 flutter: uses-material-design: true diff --git a/experimental/web_dashboard/tool/grind.dart b/experimental/web_dashboard/tool/grind.dart index 302439ef8..ad0968277 100644 --- a/experimental/web_dashboard/tool/grind.dart +++ b/experimental/web_dashboard/tool/grind.dart @@ -82,7 +82,7 @@ Future copyright() async { Future fixCopyright() async { await for (var file in _filesWithoutCopyright()) { var contents = await file.readAsString(); - await file.writeAsString(_copyright + '\n\n' + contents); + await file.writeAsString('$_copyright\n\n$contents'); } } @@ -99,7 +99,7 @@ Stream _filesWithoutCopyright() async* { .take(3) .fold('', (previous, element) { if (previous == '') return element; - return previous + '\n' + element; + return '$previous\n$element'; }); if (firstThreeLines != _copyright) { diff --git a/flutter_maps_firestore/pubspec.lock b/flutter_maps_firestore/pubspec.lock index fd774d500..e89ce3a07 100644 --- a/flutter_maps_firestore/pubspec.lock +++ b/flutter_maps_firestore/pubspec.lock @@ -63,14 +63,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" firebase_core: dependency: "direct main" description: @@ -103,7 +103,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -162,21 +162,21 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.5.0" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" location: dependency: "direct main" description: @@ -211,7 +211,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -225,7 +225,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -244,7 +244,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -286,7 +286,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -300,7 +300,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.5.0" diff --git a/flutter_maps_firestore/pubspec.yaml b/flutter_maps_firestore/pubspec.yaml index 460889de5..794f76844 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: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -17,7 +17,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/form_app/lib/src/autofill.dart b/form_app/lib/src/autofill.dart index 39cce94af..49a54b45a 100644 --- a/form_app/lib/src/autofill.dart +++ b/form_app/lib/src/autofill.dart @@ -10,7 +10,7 @@ class AutofillDemo extends StatefulWidget { const AutofillDemo({Key? key}) : super(key: key); @override - _AutofillDemoState createState() => _AutofillDemoState(); + State createState() => _AutofillDemoState(); } class _AutofillDemoState extends State { diff --git a/form_app/lib/src/form_widgets.dart b/form_app/lib/src/form_widgets.dart index 18ab6ed95..9750953be 100644 --- a/form_app/lib/src/form_widgets.dart +++ b/form_app/lib/src/form_widgets.dart @@ -9,7 +9,7 @@ class FormWidgetsDemo extends StatefulWidget { const FormWidgetsDemo({Key? key}) : super(key: key); @override - _FormWidgetsDemoState createState() => _FormWidgetsDemoState(); + State createState() => _FormWidgetsDemoState(); } class _FormWidgetsDemoState extends State { @@ -168,7 +168,7 @@ class _FormDatePicker extends StatefulWidget { }); @override - _FormDatePickerState createState() => _FormDatePickerState(); + State<_FormDatePicker> createState() => _FormDatePickerState(); } class _FormDatePickerState extends State<_FormDatePicker> { diff --git a/form_app/lib/src/sign_in_http.dart b/form_app/lib/src/sign_in_http.dart index 98da7d3ea..ecef24e3c 100644 --- a/form_app/lib/src/sign_in_http.dart +++ b/form_app/lib/src/sign_in_http.dart @@ -35,7 +35,7 @@ class SignInHttpDemo extends StatefulWidget { }) : super(key: key); @override - _SignInHttpDemoState createState() => _SignInHttpDemoState(); + State createState() => _SignInHttpDemoState(); } class _SignInHttpDemoState extends State { diff --git a/form_app/lib/src/validation.dart b/form_app/lib/src/validation.dart index 969e1ad26..55af58ddd 100644 --- a/form_app/lib/src/validation.dart +++ b/form_app/lib/src/validation.dart @@ -9,7 +9,7 @@ class FormValidationDemo extends StatefulWidget { const FormValidationDemo({Key? key}) : super(key: key); @override - _FormValidationDemoState createState() => _FormValidationDemoState(); + State createState() => _FormValidationDemoState(); } class _FormValidationDemoState extends State { diff --git a/form_app/linux/flutter/generated_plugins.cmake b/form_app/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/form_app/linux/flutter/generated_plugins.cmake +++ b/form_app/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/form_app/pubspec.lock b/form_app/pubspec.lock index f5c9cdece..9055def65 100644 --- a/form_app/pubspec.lock +++ b/form_app/pubspec.lock @@ -91,7 +91,7 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.2.3" + version: "8.3.0" characters: dependency: transitive description: @@ -201,7 +201,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -290,7 +290,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -495,4 +495,4 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/form_app/pubspec.yaml b/form_app/pubspec.yaml index 55a5c2f1d..9041639c1 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: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -24,7 +24,7 @@ dev_dependencies: sdk: flutter json_serializable: ^6.2.0 build_runner: ^2.1.8 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/game_template/lib/src/app_lifecycle/app_lifecycle.dart b/game_template/lib/src/app_lifecycle/app_lifecycle.dart index 90b93d949..b52d83431 100644 --- a/game_template/lib/src/app_lifecycle/app_lifecycle.dart +++ b/game_template/lib/src/app_lifecycle/app_lifecycle.dart @@ -50,14 +50,14 @@ class _AppLifecycleObserverState extends State @override void dispose() { - WidgetsBinding.instance!.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); super.dispose(); } @override void initState() { super.initState(); - WidgetsBinding.instance!.addObserver(this); + WidgetsBinding.instance.addObserver(this); _log.info('Subscribed to app lifecycle updates'); } } diff --git a/game_template/pubspec.lock b/game_template/pubspec.lock index 2adfbcd0e..434156df3 100644 --- a/game_template/pubspec.lock +++ b/game_template/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "31.0.0" + version: "39.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.8.0" + version: "4.0.0" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.2.2" + version: "3.3.0" args: dependency: transitive description: @@ -64,13 +64,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" clock: dependency: transitive description: @@ -84,7 +77,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -98,14 +91,14 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.2.0" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -119,7 +112,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -140,35 +133,35 @@ packages: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.5" + version: "4.3.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.3" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics url: "https://pub.dartlang.org" source: hosted - version: "2.6.3" + version: "2.7.2" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.2.4" + version: "3.2.5" flutter: dependency: "direct main" description: flutter @@ -211,14 +204,14 @@ packages: name: games_services url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.8" games_services_platform_interface: dependency: transitive description: name: games_services_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" glob: dependency: transitive description: @@ -232,7 +225,7 @@ packages: name: go_router url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.0" google_mobile_ads: dependency: "direct main" description: @@ -309,14 +302,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.5.0" lints: dependency: transitive description: @@ -344,7 +337,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -358,7 +351,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" nested: dependency: transitive description: @@ -386,7 +379,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" path_provider: dependency: transitive description: @@ -400,7 +393,7 @@ packages: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.12" + version: "2.0.13" path_provider_ios: dependency: transitive description: @@ -436,20 +429,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.5" - path_to_regexp: - dependency: transitive - description: - name: path_to_regexp - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" platform: dependency: transitive description: @@ -491,7 +477,7 @@ packages: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" shared_preferences: dependency: "direct main" description: @@ -554,7 +540,7 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" shelf_packages_handler: dependency: transitive description: @@ -601,7 +587,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -636,21 +622,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.19.5" + version: "1.21.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.13" typed_data: dependency: transitive description: @@ -671,14 +657,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.5.0" + version: "8.2.2" watcher: dependency: transitive description: @@ -692,21 +678,21 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.5.2" xdg_directories: dependency: transitive description: @@ -720,7 +706,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.1" yaml: dependency: transitive description: @@ -729,5 +715,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" - flutter: ">=2.8.0" + dart: ">=2.17.0-0 <3.0.0" + flutter: ">=2.8.1" diff --git a/game_template/windows/flutter/generated_plugins.cmake b/game_template/windows/flutter/generated_plugins.cmake index 4d10c2518..b93c4c30c 100644 --- a/game_template/windows/flutter/generated_plugins.cmake +++ b/game_template/windows/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/infinite_list/linux/flutter/generated_plugins.cmake b/infinite_list/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/infinite_list/linux/flutter/generated_plugins.cmake +++ b/infinite_list/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/infinite_list/pubspec.lock b/infinite_list/pubspec.lock index e7f0d366d..ceee6805b 100644 --- a/infinite_list/pubspec.lock +++ b/infinite_list/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: "direct main" description: @@ -115,7 +115,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" provider: dependency: "direct main" description: @@ -134,7 +134,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -169,21 +169,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" window_size: dependency: "direct main" description: @@ -194,5 +187,5 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.16.0" diff --git a/infinite_list/pubspec.yaml b/infinite_list/pubspec.yaml index 57e0efd61..57c30dc89 100644 --- a/infinite_list/pubspec.yaml +++ b/infinite_list/pubspec.yaml @@ -2,11 +2,10 @@ name: infinitelist description: > A sample implementation of an infinite list. publish_to: none - version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -23,7 +22,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/infinite_list/windows/flutter/generated_plugins.cmake b/infinite_list/windows/flutter/generated_plugins.cmake index 154f23857..ff2147b2c 100644 --- a/infinite_list/windows/flutter/generated_plugins.cmake +++ b/infinite_list/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/ios_app_clip/lib/main.dart b/ios_app_clip/lib/main.dart index 8999971d2..fb2a4b158 100644 --- a/ios_app_clip/lib/main.dart +++ b/ios_app_clip/lib/main.dart @@ -13,10 +13,10 @@ void main() { // The same content is shown for both the main app target and in the App // Clip. class Demo extends StatefulWidget { - const Demo({Key key}) : super(key: key); + const Demo({Key? key}) : super(key: key); @override - State createState() => _DemoState(); + State createState() => _DemoState(); } class _DemoState extends State { diff --git a/ios_app_clip/pubspec.lock b/ios_app_clip/pubspec.lock index a43f5e40b..d377ed93c 100644 --- a/ios_app_clip/pubspec.lock +++ b/ios_app_clip/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -70,7 +70,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -82,7 +82,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -94,7 +94,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -122,7 +122,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -141,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -176,21 +176,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/ios_app_clip/pubspec.yaml b/ios_app_clip/pubspec.yaml index b81f8b7a7..dad1dd0de 100644 --- a/ios_app_clip/pubspec.yaml +++ b/ios_app_clip/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: ">=2.7.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -18,6 +18,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: diff --git a/isolate_example/lib/data_transfer_page.dart b/isolate_example/lib/data_transfer_page.dart index e00cf8ba8..a6fbfb59d 100644 --- a/isolate_example/lib/data_transfer_page.dart +++ b/isolate_example/lib/data_transfer_page.dart @@ -43,11 +43,11 @@ class DataTransferPage extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Container( + padding: const EdgeInsets.all(8), child: Text( 'Number Generator Progress', style: Theme.of(context).textTheme.headline6, ), - padding: const EdgeInsets.all(8), ), LinearProgressIndicator( value: controller.progressPercent, @@ -59,28 +59,28 @@ class DataTransferPage extends StatelessWidget { Column( children: [ ElevatedButton( - child: const Text('Transfer Data to 2nd Isolate'), style: ElevatedButton.styleFrom( primary: (controller.runningTest == 1) ? Colors.blueAccent : Colors.grey[300]), onPressed: () => controller.generateRandomNumbers(false), + child: const Text('Transfer Data to 2nd Isolate'), ), ElevatedButton( - child: const Text('Transfer Data with TransferableTypedData'), style: ElevatedButton.styleFrom( primary: (controller.runningTest == 2) ? Colors.blueAccent : Colors.grey[300]), onPressed: () => controller.generateRandomNumbers(true), + child: const Text('Transfer Data with TransferableTypedData'), ), ElevatedButton( - child: const Text('Generate on 2nd Isolate'), style: ElevatedButton.styleFrom( primary: (controller.runningTest == 3) ? Colors.blueAccent : Colors.grey[300]), onPressed: controller.generateOnSecondaryIsolate, + child: const Text('Generate on 2nd Isolate'), ), ], ), @@ -214,10 +214,10 @@ class RunningList extends StatelessWidget { return Column( children: [ Card( + color: Colors.lightGreenAccent, child: ListTile( title: Text(progress[index]), ), - color: Colors.lightGreenAccent, ), const Divider( color: Colors.blue, diff --git a/isolate_example/lib/infinite_process_page.dart b/isolate_example/lib/infinite_process_page.dart index 6dceae569..e31ee97ca 100644 --- a/isolate_example/lib/infinite_process_page.dart +++ b/isolate_example/lib/infinite_process_page.dart @@ -58,14 +58,14 @@ class InfiniteProcessPage extends StatelessWidget { alignment: MainAxisAlignment.center, children: [ ElevatedButton( - child: const Text('Start'), style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: () => controller.start(), + child: const Text('Start'), ), ElevatedButton( - child: const Text('Terminate'), style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: () => controller.terminate(), + child: const Text('Terminate'), ), ], ), @@ -205,13 +205,13 @@ class RunningList extends StatelessWidget { return Column( children: [ Card( + color: (controller.created && !controller.paused) + ? Colors.lightGreenAccent + : Colors.deepOrangeAccent, child: ListTile( leading: Text('${sums.length - index}.'), title: Text('${sums[index]}.'), ), - color: (controller.created && !controller.paused) - ? Colors.lightGreenAccent - : Colors.deepOrangeAccent, ), const Divider( color: Colors.blue, diff --git a/isolate_example/lib/performance_page.dart b/isolate_example/lib/performance_page.dart index 014e4337b..c520573fd 100644 --- a/isolate_example/lib/performance_page.dart +++ b/isolate_example/lib/performance_page.dart @@ -33,7 +33,7 @@ class PerformancePage extends StatefulWidget { const PerformancePage({Key? key}) : super(key: key); @override - _PerformancePageState createState() => _PerformancePageState(); + State createState() => _PerformancePageState(); } class _PerformancePageState extends State { @@ -55,12 +55,12 @@ class _PerformancePageState extends State { future: computeFuture, builder: (context, snapshot) { return ElevatedButton( - child: const Text('Compute on Main'), style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: snapshot.connectionState == ConnectionState.done ? () => handleComputeOnMain(context) : null, + child: const Text('Compute on Main'), ); }, ), @@ -68,12 +68,12 @@ class _PerformancePageState extends State { future: computeFuture, builder: (context, snapshot) { return ElevatedButton( - child: const Text('Compute on Secondary'), style: ElevatedButton.styleFrom(elevation: 8.0), onPressed: snapshot.connectionState == ConnectionState.done ? () => handleComputeOnSecondary(context) - : null); + : null, + child: const Text('Compute on Secondary')); }, ), ], @@ -130,10 +130,10 @@ class SmoothAnimationWidget extends StatefulWidget { const SmoothAnimationWidget({Key? key}) : super(key: key); @override - SmoothAnimationWidgetState createState() => SmoothAnimationWidgetState(); + State createState() => _SmoothAnimationWidgetState(); } -class SmoothAnimationWidgetState extends State +class _SmoothAnimationWidgetState extends State with TickerProviderStateMixin { late final AnimationController _animationController; late final Animation _borderAnimation; @@ -160,9 +160,6 @@ class SmoothAnimationWidgetState extends State animation: _borderAnimation, builder: (context, child) { return Container( - child: const FlutterLogo( - size: 200, - ), alignment: Alignment.bottomCenter, width: 350, height: 200, @@ -176,6 +173,9 @@ class SmoothAnimationWidgetState extends State ), borderRadius: _borderAnimation.value, ), + child: const FlutterLogo( + size: 200, + ), ); }, ), diff --git a/isolate_example/linux/flutter/generated_plugins.cmake b/isolate_example/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/isolate_example/linux/flutter/generated_plugins.cmake +++ b/isolate_example/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/isolate_example/pubspec.lock b/isolate_example/pubspec.lock index 36a527d69..5249aedad 100644 --- a/isolate_example/pubspec.lock +++ b/isolate_example/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -61,7 +61,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -73,7 +73,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -87,7 +87,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" provider: dependency: "direct main" description: @@ -127,7 +127,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -162,21 +162,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" window_size: dependency: "direct main" description: @@ -187,5 +180,5 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.16.0" diff --git a/isolate_example/pubspec.yaml b/isolate_example/pubspec.yaml index d05c3ed20..5476b75f5 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: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/isolate_example/windows/flutter/generated_plugins.cmake b/isolate_example/windows/flutter/generated_plugins.cmake index 154f23857..ff2147b2c 100644 --- a/isolate_example/windows/flutter/generated_plugins.cmake +++ b/isolate_example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/jsonexample/linux/flutter/generated_plugins.cmake b/jsonexample/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/jsonexample/linux/flutter/generated_plugins.cmake +++ b/jsonexample/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/jsonexample/pubspec.lock b/jsonexample/pubspec.lock index ecc007cbf..58e2a01a4 100644 --- a/jsonexample/pubspec.lock +++ b/jsonexample/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "38.0.0" + version: "39.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "4.0.0" args: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.0" build_config: dependency: transitive description: @@ -63,7 +63,7 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.8" build_runner: dependency: "direct dev" description: @@ -140,7 +140,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -154,21 +154,21 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" file: dependency: transitive description: @@ -194,7 +194,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -269,7 +269,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -290,7 +290,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -304,7 +304,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" package_config: dependency: transitive description: @@ -318,7 +318,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" pool: dependency: transitive description: @@ -346,7 +346,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "3.1.0" shelf: dependency: transitive description: @@ -372,21 +372,21 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_helper: dependency: transitive description: name: source_helper url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.2" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -428,7 +428,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" timing: dependency: transitive description: @@ -449,7 +449,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -463,7 +463,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" window_size: dependency: "direct main" description: @@ -481,4 +481,4 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/jsonexample/pubspec.yaml b/jsonexample/pubspec.yaml index c72589f67..431cceda8 100644 --- a/jsonexample/pubspec.yaml +++ b/jsonexample/pubspec.yaml @@ -3,7 +3,7 @@ description: A demonstration of JSON parsing publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: json_annotation: ^4.5.0 @@ -24,7 +24,7 @@ dev_dependencies: build_runner: ^2.1.10 built_value_generator: ^8.3.0 json_serializable: ^6.1.6 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/jsonexample/windows/flutter/generated_plugins.cmake b/jsonexample/windows/flutter/generated_plugins.cmake index 154f23857..ff2147b2c 100644 --- a/jsonexample/windows/flutter/generated_plugins.cmake +++ b/jsonexample/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/material_3_demo/lib/color_palettes_screen.dart b/material_3_demo/lib/color_palettes_screen.dart index 33466d2a7..ed09096dc 100644 --- a/material_3_demo/lib/color_palettes_screen.dart +++ b/material_3_demo/lib/color_palettes_screen.dart @@ -281,15 +281,15 @@ class ColorChip extends StatelessWidget { final Color labelColor = onColor ?? contrastColor(color); return Container( - color: color, - child: Padding( - padding: const EdgeInsets.all(16), - child: Row( - children: [ - Expanded(child: Text(label, style: TextStyle(color: labelColor))), - ], - ), - ) + color: color, + child: Padding( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + Expanded(child: Text(label, style: TextStyle(color: labelColor))), + ], + ), + ), ); } } diff --git a/material_3_demo/lib/component_screen.dart b/material_3_demo/lib/component_screen.dart index e3b5484ff..8eb41788d 100644 --- a/material_3_demo/lib/component_screen.dart +++ b/material_3_demo/lib/component_screen.dart @@ -26,9 +26,9 @@ class ComponentScreen extends StatelessWidget { _colDivider, showNavBottomBar ? const NavigationBars( - selectedIndex: 0, - isExampleBar: true, - ) + selectedIndex: 0, + isExampleBar: true, + ) : Container(), ], ), @@ -41,24 +41,25 @@ const _rowDivider = SizedBox(width: 10); const _colDivider = SizedBox(height: 10); const double _cardWidth = 115; -void Function()? handlePressed(BuildContext context, bool isDisabled, String buttonName) { +void Function()? handlePressed( + BuildContext context, bool isDisabled, String buttonName) { return isDisabled ? null : () { - final snackBar = SnackBar( - content: Text( - 'Yay! $buttonName is clicked!', - style: TextStyle(color: Theme.of(context).colorScheme.surface), - ), - action: SnackBarAction( - textColor: Theme.of(context).colorScheme.surface, - label: 'Close', - onPressed: () {}, - ), - ); + final snackBar = SnackBar( + content: Text( + 'Yay! $buttonName is clicked!', + style: TextStyle(color: Theme.of(context).colorScheme.surface), + ), + action: SnackBarAction( + textColor: Theme.of(context).colorScheme.surface, + label: 'Close', + onPressed: () {}, + ), + ); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }; + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }; } class Buttons extends StatefulWidget { @@ -148,7 +149,7 @@ class ButtonsWithIcon extends StatelessWidget { children: [ ElevatedButton.icon( onPressed: - handlePressed(context, false, "ElevatedButton with Icon"), + handlePressed(context, false, "ElevatedButton with Icon"), icon: const Icon(Icons.add), label: const Text("Icon"), ), @@ -173,14 +174,14 @@ class ButtonsWithIcon extends StatelessWidget { primary: Theme.of(context).colorScheme.secondaryContainer, ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), onPressed: - handlePressed(context, false, "FilledTonalButton with Icon"), + handlePressed(context, false, "FilledTonalButton with Icon"), label: const Text('Icon'), icon: const Icon(Icons.add), ), _colDivider, OutlinedButton.icon( onPressed: - handlePressed(context, false, "OutlinedButton with Icon"), + handlePressed(context, false, "OutlinedButton with Icon"), icon: const Icon(Icons.add), label: const Text("Icon"), ), @@ -334,22 +335,23 @@ class Dialogs extends StatefulWidget { class _DialogsState extends State { void openDialog(BuildContext context) { showDialog( - context: context, - builder: (context) => AlertDialog( - title: const Text("Basic Dialog Title"), - 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(), - ), - TextButton( - child: const Text('Action'), - onPressed: () => Navigator.of(context).pop(), - ), - ], - )); + context: context, + builder: (context) => AlertDialog( + title: const Text("Basic Dialog Title"), + 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(), + ), + TextButton( + child: const Text('Action'), + onPressed: () => Navigator.of(context).pop(), + ), + ], + ), + ); } @override @@ -395,17 +397,19 @@ const List appBarDestinations = [ ]; final List navRailDestinations = appBarDestinations - .map((destination) => NavigationRailDestination( - icon: Tooltip( - message: destination.label, - child: destination.icon, - ), - selectedIcon: Tooltip( - message: destination.label, - child: destination.selectedIcon, - ), - label: Text(destination.label) -)) + .map( + (destination) => NavigationRailDestination( + icon: Tooltip( + message: destination.label, + child: destination.icon, + ), + selectedIcon: Tooltip( + message: destination.label, + child: destination.selectedIcon, + ), + label: Text(destination.label), + ), + ) .toList(); const List exampleBarDestinations = [ @@ -436,9 +440,9 @@ class NavigationBars extends StatefulWidget { const NavigationBars( {Key? key, - this.onSelectItem, - required this.selectedIndex, - required this.isExampleBar}) + this.onSelectItem, + required this.selectedIndex, + required this.isExampleBar}) : super(key: key); @override @@ -465,7 +469,7 @@ class _NavigationBarsState extends State { if (!widget.isExampleBar) widget.onSelectItem!(index); }, destinations: - widget.isExampleBar ? exampleBarDestinations : appBarDestinations, + widget.isExampleBar ? exampleBarDestinations : appBarDestinations, ); } } diff --git a/navigation_and_routing/lib/src/app.dart b/navigation_and_routing/lib/src/app.dart index c4fe838e5..e897400d9 100644 --- a/navigation_and_routing/lib/src/app.dart +++ b/navigation_and_routing/lib/src/app.dart @@ -12,7 +12,7 @@ class Bookstore extends StatefulWidget { const Bookstore({Key? key}) : super(key: key); @override - _BookstoreState createState() => _BookstoreState(); + State createState() => _BookstoreState(); } class _BookstoreState extends State { diff --git a/navigation_and_routing/lib/src/screens/books.dart b/navigation_and_routing/lib/src/screens/books.dart index 2a436629f..1be63dbd8 100644 --- a/navigation_and_routing/lib/src/screens/books.dart +++ b/navigation_and_routing/lib/src/screens/books.dart @@ -14,7 +14,7 @@ class BooksScreen extends StatefulWidget { }) : super(key: key); @override - _BooksScreenState createState() => _BooksScreenState(); + State createState() => _BooksScreenState(); } class _BooksScreenState extends State diff --git a/navigation_and_routing/lib/src/screens/navigator.dart b/navigation_and_routing/lib/src/screens/navigator.dart index 863361da5..2d0b1fe3e 100644 --- a/navigation_and_routing/lib/src/screens/navigator.dart +++ b/navigation_and_routing/lib/src/screens/navigator.dart @@ -25,7 +25,7 @@ class BookstoreNavigator extends StatefulWidget { }) : super(key: key); @override - _BookstoreNavigatorState createState() => _BookstoreNavigatorState(); + State createState() => _BookstoreNavigatorState(); } class _BookstoreNavigatorState extends State { diff --git a/navigation_and_routing/lib/src/screens/settings.dart b/navigation_and_routing/lib/src/screens/settings.dart index 993c49901..e003da272 100644 --- a/navigation_and_routing/lib/src/screens/settings.dart +++ b/navigation_and_routing/lib/src/screens/settings.dart @@ -12,7 +12,7 @@ class SettingsScreen extends StatefulWidget { const SettingsScreen({Key? key}) : super(key: key); @override - _SettingsScreenState createState() => _SettingsScreenState(); + State createState() => _SettingsScreenState(); } class _SettingsScreenState extends State { diff --git a/navigation_and_routing/lib/src/screens/sign_in.dart b/navigation_and_routing/lib/src/screens/sign_in.dart index 0e8ca838c..4ca735379 100644 --- a/navigation_and_routing/lib/src/screens/sign_in.dart +++ b/navigation_and_routing/lib/src/screens/sign_in.dart @@ -20,7 +20,7 @@ class SignInScreen extends StatefulWidget { }) : super(key: key); @override - _SignInScreenState createState() => _SignInScreenState(); + State createState() => _SignInScreenState(); } class _SignInScreenState extends State { diff --git a/navigation_and_routing/pubspec.lock b/navigation_and_routing/pubspec.lock index f9bd31aec..fb44b79b4 100644 --- a/navigation_and_routing/pubspec.lock +++ b/navigation_and_routing/pubspec.lock @@ -138,7 +138,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -197,7 +197,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -514,5 +514,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.10.0" diff --git a/navigation_and_routing/pubspec.yaml b/navigation_and_routing/pubspec.yaml index 3450ad9f4..61c1b1509 100644 --- a/navigation_and_routing/pubspec.yaml +++ b/navigation_and_routing/pubspec.yaml @@ -1,9 +1,11 @@ name: bookstore description: Navigation and routing sample app -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 + environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" + dependencies: adaptive_navigation: ^0.0.3 collection: ^1.15.0 @@ -18,10 +20,12 @@ dependencies: git: url: https://github.com/google/flutter-desktop-embedding.git path: plugins/window_size + dev_dependencies: - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter_test: sdk: flutter test: ^1.16.0 + flutter: uses-material-design: true diff --git a/null_safety/null_safe_app/pubspec.lock b/null_safety/null_safe_app/pubspec.lock index 91b5cc170..2302c67b5 100644 --- a/null_safety/null_safe_app/pubspec.lock +++ b/null_safety/null_safe_app/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -155,21 +155,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" window_size: dependency: "direct main" description: @@ -180,5 +173,4 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/null_safety/null_safe_app/pubspec.yaml b/null_safety/null_safe_app/pubspec.yaml index dcf3fad70..da8dffd95 100644 --- a/null_safety/null_safe_app/pubspec.yaml +++ b/null_safety/null_safe_app/pubspec.yaml @@ -4,8 +4,7 @@ publish_to: "none" # Do not publish apps & package using the null safety experim version: 1.2.0 environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=2.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -19,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/null_safety/null_safe_app/windows/flutter/generated_plugins.cmake b/null_safety/null_safe_app/windows/flutter/generated_plugins.cmake index 154f23857..ff2147b2c 100644 --- a/null_safety/null_safe_app/windows/flutter/generated_plugins.cmake +++ b/null_safety/null_safe_app/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/null_safety/null_unsafe_app/pubspec.lock b/null_safety/null_unsafe_app/pubspec.lock index 6d07d58cb..2302c67b5 100644 --- a/null_safety/null_unsafe_app/pubspec.lock +++ b/null_safety/null_unsafe_app/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -155,21 +155,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" window_size: dependency: "direct main" description: @@ -180,4 +173,4 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/null_safety/null_unsafe_app/pubspec.yaml b/null_safety/null_unsafe_app/pubspec.yaml index fafb7d447..a399d6f18 100644 --- a/null_safety/null_unsafe_app/pubspec.yaml +++ b/null_safety/null_unsafe_app/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/null_safety/null_unsafe_app/windows/flutter/generated_plugins.cmake b/null_safety/null_unsafe_app/windows/flutter/generated_plugins.cmake index 154f23857..ff2147b2c 100644 --- a/null_safety/null_unsafe_app/windows/flutter/generated_plugins.cmake +++ b/null_safety/null_unsafe_app/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/place_tracker/lib/place_details.dart b/place_tracker/lib/place_details.dart index 54f8a880f..71e718c0c 100644 --- a/place_tracker/lib/place_details.dart +++ b/place_tracker/lib/place_details.dart @@ -19,10 +19,10 @@ class PlaceDetails extends StatefulWidget { }) : super(key: key); @override - PlaceDetailsState createState() => PlaceDetailsState(); + State createState() => _PlaceDetailsState(); } -class PlaceDetailsState extends State { +class _PlaceDetailsState extends State { late Place _place; GoogleMapController? _mapController; final Set _markers = {}; diff --git a/place_tracker/lib/place_list.dart b/place_tracker/lib/place_list.dart index 3ecaf19f7..f041ff053 100644 --- a/place_tracker/lib/place_list.dart +++ b/place_tracker/lib/place_list.dart @@ -13,10 +13,10 @@ class PlaceList extends StatefulWidget { const PlaceList({Key? key}) : super(key: key); @override - PlaceListState createState() => PlaceListState(); + State createState() => _PlaceListState(); } -class PlaceListState extends State { +class _PlaceListState extends State { final ScrollController _scrollController = ScrollController(); @override @@ -77,16 +77,16 @@ class _CategoryButton extends StatelessWidget { @override Widget build(BuildContext context) { - late String _buttonText; + late String buttonText; switch (category) { case PlaceCategory.favorite: - _buttonText = 'Favorites'; + buttonText = 'Favorites'; break; case PlaceCategory.visited: - _buttonText = 'Visited'; + buttonText = 'Visited'; break; case PlaceCategory.wantToGo: - _buttonText = 'Want To Go'; + buttonText = 'Want To Go'; } return Container( @@ -102,7 +102,7 @@ class _CategoryButton extends StatelessWidget { height: 50.0, child: TextButton( child: Text( - _buttonText, + buttonText, style: TextStyle( fontSize: selected ? 20.0 : 18.0, color: selected ? Colors.blue : Colors.black87, diff --git a/place_tracker/lib/place_map.dart b/place_tracker/lib/place_map.dart index 06ce02927..92a36081f 100644 --- a/place_tracker/lib/place_map.dart +++ b/place_tracker/lib/place_map.dart @@ -59,10 +59,10 @@ class PlaceMap extends StatefulWidget { }) : super(key: key); @override - PlaceMapState createState() => PlaceMapState(); + State createState() => _PlaceMapState(); } -class PlaceMapState extends State { +class _PlaceMapState extends State { Completer mapController = Completer(); MapType _currentMapType = MapType.normal; @@ -170,16 +170,18 @@ class PlaceMapState extends State { Future _confirmAddPlace(BuildContext context) async { if (_pendingMarker != null) { // Create a new Place and map it to the marker we just added. + final appState = Provider.of(context, listen: false); final newPlace = Place( id: const Uuid().v1(), latLng: _pendingMarker!.position, name: _pendingMarker!.infoWindow.title!, - category: - Provider.of(context, listen: false).selectedCategory, + category: appState.selectedCategory, ); - var placeMarker = await _getPlaceMarkerIcon(context, - Provider.of(context, listen: false).selectedCategory); + final scaffoldMessenger = ScaffoldMessenger.of(context); + + var placeMarker = + await _getPlaceMarkerIcon(context, appState.selectedCategory); setState(() { final updatedMarker = _pendingMarker!.copyWith( @@ -202,7 +204,7 @@ class PlaceMapState extends State { }); // Show a confirmation snackbar that has an action to edit the new place. - ScaffoldMessenger.of(context).showSnackBar( + scaffoldMessenger.showSnackBar( SnackBar( duration: const Duration(seconds: 3), content: @@ -217,20 +219,17 @@ class PlaceMapState extends State { ); // Add the new place to the places stored in appState. - final newPlaces = - List.from(Provider.of(context, listen: false).places) - ..add(newPlace); + final newPlaces = List.from(appState.places)..add(newPlace); // Manually update our map configuration here since our map is already // updated with the new marker. Otherwise, the map would be reconfigured // in the main build method due to a modified AppState. _configuration = MapConfiguration( places: newPlaces, - selectedCategory: - Provider.of(context, listen: false).selectedCategory, + selectedCategory: appState.selectedCategory, ); - Provider.of(context, listen: false).setPlaces(newPlaces); + appState.setPlaces(newPlaces); } } @@ -472,19 +471,19 @@ class _AddPlaceButtonBar extends StatelessWidget { children: [ ElevatedButton( style: ElevatedButton.styleFrom(primary: Colors.blue), + onPressed: onSavePressed, child: const Text( 'Save', style: TextStyle(color: Colors.white, fontSize: 16.0), ), - onPressed: onSavePressed, ), ElevatedButton( style: ElevatedButton.styleFrom(primary: Colors.red), + onPressed: onCancelPressed, child: const Text( 'Cancel', style: TextStyle(color: Colors.white, fontSize: 16.0), ), - onPressed: onCancelPressed, ), ], ), diff --git a/place_tracker/pubspec.lock b/place_tracker/pubspec.lock index 670098e6b..1bab659b7 100644 --- a/place_tracker/pubspec.lock +++ b/place_tracker/pubspec.lock @@ -82,7 +82,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -155,7 +155,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -295,5 +295,5 @@ packages: source: hosted version: "2.1.1" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.5.0" diff --git a/place_tracker/pubspec.yaml b/place_tracker/pubspec.yaml index d4d64eee9..b1a4fd67a 100644 --- a/place_tracker/pubspec.yaml +++ b/place_tracker/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -19,7 +19,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: assets: diff --git a/platform_channels/lib/src/add_pet_details.dart b/platform_channels/lib/src/add_pet_details.dart index 22a6358d9..dc49a33f0 100644 --- a/platform_channels/lib/src/add_pet_details.dart +++ b/platform_channels/lib/src/add_pet_details.dart @@ -13,7 +13,7 @@ class AddPetDetails extends StatefulWidget { const AddPetDetails({Key? key}) : super(key: key); @override - _AddPetDetailsState createState() => _AddPetDetailsState(); + State createState() => _AddPetDetailsState(); } class _AddPetDetailsState extends State { diff --git a/platform_channels/lib/src/event_channel_demo.dart b/platform_channels/lib/src/event_channel_demo.dart index 1b2c16357..ba013aa8e 100644 --- a/platform_channels/lib/src/event_channel_demo.dart +++ b/platform_channels/lib/src/event_channel_demo.dart @@ -34,15 +34,15 @@ class EventChannelDemo extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - 'x axis: ' + snapshot.data!.x.toStringAsFixed(3), + 'x axis: ${snapshot.data!.x.toStringAsFixed(3)}', style: textStyle, ), Text( - 'y axis: ' + snapshot.data!.y.toStringAsFixed(3), + 'y axis: ${snapshot.data!.y.toStringAsFixed(3)}', style: textStyle, ), Text( - 'z axis: ' + snapshot.data!.z.toStringAsFixed(3), + 'z axis: ${snapshot.data!.z.toStringAsFixed(3)}', style: textStyle, ) ], diff --git a/platform_channels/lib/src/method_channel_demo.dart b/platform_channels/lib/src/method_channel_demo.dart index 221dfb1cf..2db100b38 100644 --- a/platform_channels/lib/src/method_channel_demo.dart +++ b/platform_channels/lib/src/method_channel_demo.dart @@ -13,7 +13,7 @@ class MethodChannelDemo extends StatefulWidget { const MethodChannelDemo({Key? key}) : super(key: key); @override - _MethodChannelDemoState createState() => _MethodChannelDemoState(); + State createState() => _MethodChannelDemoState(); } class _MethodChannelDemoState extends State { diff --git a/platform_channels/lib/src/pet_list_screen.dart b/platform_channels/lib/src/pet_list_screen.dart index 1a5444f39..e24956639 100644 --- a/platform_channels/lib/src/pet_list_screen.dart +++ b/platform_channels/lib/src/pet_list_screen.dart @@ -12,7 +12,7 @@ class PetListScreen extends StatefulWidget { const PetListScreen({Key? key}) : super(key: key); @override - _PetListScreenState createState() => _PetListScreenState(); + State createState() => _PetListScreenState(); } class _PetListScreenState extends State { @@ -24,10 +24,15 @@ class _PetListScreenState extends State { super.initState(); // Receives a string of json object from the platform and converts it // to PetModel. + final scaffoldMessenger = ScaffoldMessenger.of(context); const BasicMessageChannel('stringCodecDemo', StringCodec()) .setMessageHandler((message) async { if (message == null) { - showSnackBar('An error occurred while adding pet details.', context); + scaffoldMessenger.showSnackBar( + const SnackBar( + content: Text('An error occurred while adding pet details.'), + ), + ); } else { setState(() { petListModel = PetListModel.fromJson(message); @@ -77,11 +82,16 @@ class BuildPetList extends StatelessWidget { trailing: IconButton( icon: const Icon(Icons.delete), onPressed: () async { + final scaffoldMessenger = ScaffoldMessenger.of(context); try { await PetListMessageChannel.removePet(index); - showSnackBar('Removed successfully!', context); + scaffoldMessenger.showSnackBar( + const SnackBar(content: Text('Removed successfully!')), + ); } catch (error) { - showSnackBar((error as PlatformException).message!, context); + scaffoldMessenger.showSnackBar(SnackBar( + content: Text((error as PlatformException).message!), + )); } }, ), @@ -90,9 +100,3 @@ class BuildPetList extends StatelessWidget { ); } } - -void showSnackBar(String message, BuildContext context) { - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(message), - )); -} diff --git a/platform_channels/lib/src/platform_image_demo.dart b/platform_channels/lib/src/platform_image_demo.dart index ce649ba8a..b29b73e3e 100644 --- a/platform_channels/lib/src/platform_image_demo.dart +++ b/platform_channels/lib/src/platform_image_demo.dart @@ -16,7 +16,7 @@ class PlatformImageDemo extends StatefulWidget { const PlatformImageDemo({Key? key}) : super(key: key); @override - _PlatformImageDemoState createState() => _PlatformImageDemoState(); + State createState() => _PlatformImageDemoState(); } class _PlatformImageDemoState extends State { diff --git a/platform_channels/pubspec.lock b/platform_channels/pubspec.lock index 25f311b6e..9eb292a5b 100644 --- a/platform_channels/pubspec.lock +++ b/platform_channels/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -155,20 +155,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/platform_channels/pubspec.yaml b/platform_channels/pubspec.yaml index 0b630eb1a..87dba9a66 100644 --- a/platform_channels/pubspec.yaml +++ b/platform_channels/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/platform_channels/test/src/event_channel_demo_test.dart b/platform_channels/test/src/event_channel_demo_test.dart index 1de93ed43..9b6732536 100644 --- a/platform_channels/test/src/event_channel_demo_test.dart +++ b/platform_channels/test/src/event_channel_demo_test.dart @@ -20,7 +20,7 @@ void main() { // and add the incoming message to the StreamController used by the EventChannel // after decoding the message with codec used by the EventChannel. void emitValues(ByteData? event) { - ServicesBinding.instance?.defaultBinaryMessenger.handlePlatformMessage( + ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage( 'eventChannelDemo', event, (reply) {}, @@ -29,7 +29,7 @@ void main() { // Register a mock for EventChannel. EventChannel under the hood uses // MethodChannel to listen and cancel the created stream. - ServicesBinding.instance?.defaultBinaryMessenger + ServicesBinding.instance.defaultBinaryMessenger .setMockMessageHandler('eventChannelDemo', (message) async { // Decode the message into MethodCallHandler. final methodCall = standardMethod.decodeMethodCall(message); @@ -57,15 +57,15 @@ void main() { // Check the values of axis. The value is rounded to 3 decimal places. expect( - find.text('x axis: ' + sensorValues[0].toStringAsFixed(3)), + find.text('x axis: ${sensorValues[0].toStringAsFixed(3)}'), findsOneWidget, ); expect( - find.text('y axis: ' + sensorValues[1].toStringAsFixed(3)), + find.text('y axis: ${sensorValues[1].toStringAsFixed(3)}'), findsOneWidget, ); expect( - find.text('z axis: ' + sensorValues[2].toStringAsFixed(3)), + find.text('z axis: ${sensorValues[2].toStringAsFixed(3)}'), findsOneWidget, ); }); diff --git a/platform_design/lib/main.dart b/platform_design/lib/main.dart index 98e44c6a9..66c65d1c6 100644 --- a/platform_design/lib/main.dart +++ b/platform_design/lib/main.dart @@ -52,7 +52,7 @@ class PlatformAdaptingHomePage extends StatefulWidget { const PlatformAdaptingHomePage({Key? key}) : super(key: key); @override - _PlatformAdaptingHomePageState createState() => + State createState() => _PlatformAdaptingHomePageState(); } diff --git a/platform_design/lib/news_tab.dart b/platform_design/lib/news_tab.dart index 5debbb4be..87896a1a1 100644 --- a/platform_design/lib/news_tab.dart +++ b/platform_design/lib/news_tab.dart @@ -18,7 +18,7 @@ class NewsTab extends StatefulWidget { const NewsTab({Key? key}) : super(key: key); @override - _NewsTabState createState() => _NewsTabState(); + State createState() => _NewsTabState(); } class _NewsTabState extends State { diff --git a/platform_design/lib/profile_tab.dart b/platform_design/lib/profile_tab.dart index 20df6a41a..e203ac494 100644 --- a/platform_design/lib/profile_tab.dart +++ b/platform_design/lib/profile_tab.dart @@ -229,9 +229,9 @@ class LogOutButton extends StatelessWidget { message: _logoutMessage, actions: [ CupertinoActionSheetAction( - child: const Text('Reprogram the night man'), isDestructiveAction: true, onPressed: () => Navigator.pop(context), + child: const Text('Reprogram the night man'), ), CupertinoActionSheetAction( child: const Text('Got it'), @@ -239,9 +239,9 @@ class LogOutButton extends StatelessWidget { ), ], cancelButton: CupertinoActionSheetAction( - child: const Text('Cancel'), isDefaultAction: true, onPressed: () => Navigator.pop(context), + child: const Text('Cancel'), ), ); }, diff --git a/platform_design/lib/settings_tab.dart b/platform_design/lib/settings_tab.dart index 6b9ea42c1..c39cfd13f 100644 --- a/platform_design/lib/settings_tab.dart +++ b/platform_design/lib/settings_tab.dart @@ -15,7 +15,7 @@ class SettingsTab extends StatefulWidget { const SettingsTab({Key? key}) : super(key: key); @override - _SettingsTabState createState() => _SettingsTabState(); + State createState() => _SettingsTabState(); } class _SettingsTabState extends State { diff --git a/platform_design/lib/songs_tab.dart b/platform_design/lib/songs_tab.dart index 6acf3d334..71f8e1e26 100644 --- a/platform_design/lib/songs_tab.dart +++ b/platform_design/lib/songs_tab.dart @@ -20,7 +20,7 @@ class SongsTab extends StatefulWidget { final Widget? androidDrawer; @override - _SongsTabState createState() => _SongsTabState(); + State createState() => _SongsTabState(); } class _SongsTabState extends State { @@ -96,7 +96,7 @@ class _SongsTabState extends State { // done in a real app but it's done here since this app // unrealistically toggles the current platform for demonstration // purposes. - WidgetsBinding.instance!.reassembleApplication(); + WidgetsBinding.instance.reassembleApplication(); } // =========================================================================== @@ -145,8 +145,8 @@ class _SongsTabState extends State { CupertinoSliverNavigationBar( trailing: CupertinoButton( padding: EdgeInsets.zero, - child: const Icon(CupertinoIcons.shuffle), onPressed: _togglePlatform, + child: const Icon(CupertinoIcons.shuffle), ), ), CupertinoSliverRefreshControl( diff --git a/platform_design/pubspec.lock b/platform_design/pubspec.lock index b072817e5..28964b13a 100644 --- a/platform_design/pubspec.lock +++ b/platform_design/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -75,7 +75,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_lorem: dependency: "direct main" description: @@ -94,7 +94,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -122,7 +122,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -134,7 +134,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -169,20 +169,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/platform_design/pubspec.yaml b/platform_design/pubspec.yaml index e0d70976c..8db47ef8c 100644 --- a/platform_design/pubspec.yaml +++ b/platform_design/pubspec.yaml @@ -3,7 +3,7 @@ description: A project showcasing a Flutter app following different platform IA version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: english_words: ^4.0.0 @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/platform_view_swift/lib/main.dart b/platform_view_swift/lib/main.dart index 305918000..ffe19916b 100644 --- a/platform_view_swift/lib/main.dart +++ b/platform_view_swift/lib/main.dart @@ -12,7 +12,7 @@ void main() { } class PlatformView extends StatelessWidget { - const PlatformView({Key key}) : super(key: key); + const PlatformView({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -27,12 +27,10 @@ class PlatformView extends StatelessWidget { } class HomePage extends StatefulWidget { - const HomePage({ - Key key, - }) : super(key: key); + const HomePage({Key? key}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -44,7 +42,7 @@ class _HomePageState extends State { Future _launchPlatformCount() async { final platformCounter = await _methodChannel.invokeMethod('switchView', _counter); - setState(() => _counter = platformCounter); + setState(() => _counter = platformCounter ?? 0); } @override @@ -67,8 +65,8 @@ class _HomePageState extends State { ), const SizedBox(height: 18), ElevatedButton( - child: const Text('Continue in iOS view'), onPressed: _launchPlatformCount, + child: const Text('Continue in iOS view'), ), ], ), diff --git a/platform_view_swift/pubspec.lock b/platform_view_swift/pubspec.lock index 25f311b6e..9eb292a5b 100644 --- a/platform_view_swift/pubspec.lock +++ b/platform_view_swift/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -155,20 +155,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/platform_view_swift/pubspec.yaml b/platform_view_swift/pubspec.yaml index c81908100..abc8128ae 100644 --- a/platform_view_swift/pubspec.yaml +++ b/platform_view_swift/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.5.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/provider_counter/pubspec.lock b/provider_counter/pubspec.lock index 5435494f5..c07032791 100644 --- a/provider_counter/pubspec.lock +++ b/provider_counter/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -80,7 +80,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -94,7 +94,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -115,7 +115,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" provider: dependency: "direct main" description: @@ -134,7 +134,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -169,21 +169,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" window_size: dependency: "direct main" description: @@ -194,5 +187,5 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.16.0" diff --git a/provider_counter/pubspec.yaml b/provider_counter/pubspec.yaml index f5bac73cc..f8de43d83 100644 --- a/provider_counter/pubspec.yaml +++ b/provider_counter/pubspec.yaml @@ -2,11 +2,10 @@ name: provider_counter description: > The starter Flutter application, but using Provider to manage state. publish_to: none - version: 1.0.0 environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -22,7 +21,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/provider_shopper/lib/screens/login.dart b/provider_shopper/lib/screens/login.dart index fd71bab19..f461fdd2e 100644 --- a/provider_shopper/lib/screens/login.dart +++ b/provider_shopper/lib/screens/login.dart @@ -35,13 +35,13 @@ class MyLogin extends StatelessWidget { height: 24, ), ElevatedButton( - child: const Text('ENTER'), onPressed: () { Navigator.pushReplacementNamed(context, '/catalog'); }, style: ElevatedButton.styleFrom( primary: Colors.yellow, ), + child: const Text('ENTER'), ) ], ), diff --git a/provider_shopper/linux/flutter/generated_plugins.cmake b/provider_shopper/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/provider_shopper/linux/flutter/generated_plugins.cmake +++ b/provider_shopper/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/provider_shopper/pubspec.lock b/provider_shopper/pubspec.lock index 37a0cae86..5249aedad 100644 --- a/provider_shopper/pubspec.lock +++ b/provider_shopper/pubspec.lock @@ -61,7 +61,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -73,7 +73,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -180,5 +180,5 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.16.0" diff --git a/provider_shopper/pubspec.yaml b/provider_shopper/pubspec.yaml index 58bbcc03f..76edfb554 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: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -23,7 +23,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/simplistic_calculator/lib/main.dart b/simplistic_calculator/lib/main.dart index d7d42b12d..4d2e07b36 100644 --- a/simplistic_calculator/lib/main.dart +++ b/simplistic_calculator/lib/main.dart @@ -448,6 +448,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/linux/flutter/generated_plugins.cmake b/simplistic_calculator/linux/flutter/generated_plugins.cmake index 9e12128db..12c7443ed 100644 --- a/simplistic_calculator/linux/flutter/generated_plugins.cmake +++ b/simplistic_calculator/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/simplistic_calculator/pubspec.lock b/simplistic_calculator/pubspec.lock index 371a6350c..1a75b26c3 100644 --- a/simplistic_calculator/pubspec.lock +++ b/simplistic_calculator/pubspec.lock @@ -49,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" fluent_ui: dependency: "direct main" description: @@ -141,7 +141,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" math_expressions: dependency: "direct main" description: @@ -162,14 +162,14 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "3.1.0" recase: dependency: transitive description: @@ -202,7 +202,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -244,21 +244,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" window_size: dependency: "direct main" description: @@ -269,5 +262,5 @@ packages: source: git version: "0.1.0" sdks: - dart: ">=2.16.1 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=2.8.0" diff --git a/simplistic_calculator/typer/main_66.dart b/simplistic_calculator/typer/main_66.dart index dbda34bfc..d02f9d12e 100644 --- a/simplistic_calculator/typer/main_66.dart +++ b/simplistic_calculator/typer/main_66.dart @@ -196,6 +196,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_67.dart b/simplistic_calculator/typer/main_67.dart index dbb75242d..875b330cf 100644 --- a/simplistic_calculator/typer/main_67.dart +++ b/simplistic_calculator/typer/main_67.dart @@ -196,6 +196,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_68.dart b/simplistic_calculator/typer/main_68.dart index 02a3200b3..0be4dc474 100644 --- a/simplistic_calculator/typer/main_68.dart +++ b/simplistic_calculator/typer/main_68.dart @@ -196,6 +196,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_69.dart b/simplistic_calculator/typer/main_69.dart index 2d4407778..e6e66c850 100644 --- a/simplistic_calculator/typer/main_69.dart +++ b/simplistic_calculator/typer/main_69.dart @@ -196,6 +196,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_70.dart b/simplistic_calculator/typer/main_70.dart index 8d9c91c99..a350ac6aa 100644 --- a/simplistic_calculator/typer/main_70.dart +++ b/simplistic_calculator/typer/main_70.dart @@ -196,6 +196,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_71.dart b/simplistic_calculator/typer/main_71.dart index 888daf595..756b91ee8 100644 --- a/simplistic_calculator/typer/main_71.dart +++ b/simplistic_calculator/typer/main_71.dart @@ -197,6 +197,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_72.dart b/simplistic_calculator/typer/main_72.dart index efdb66f16..df509b09d 100644 --- a/simplistic_calculator/typer/main_72.dart +++ b/simplistic_calculator/typer/main_72.dart @@ -198,6 +198,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_73.dart b/simplistic_calculator/typer/main_73.dart index 2f04db7ab..1dfa75e4f 100644 --- a/simplistic_calculator/typer/main_73.dart +++ b/simplistic_calculator/typer/main_73.dart @@ -199,6 +199,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_74.dart b/simplistic_calculator/typer/main_74.dart index ee51e8b9f..a1f5a11d4 100644 --- a/simplistic_calculator/typer/main_74.dart +++ b/simplistic_calculator/typer/main_74.dart @@ -200,6 +200,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_75.dart b/simplistic_calculator/typer/main_75.dart index ce7d06e64..6ca647e76 100644 --- a/simplistic_calculator/typer/main_75.dart +++ b/simplistic_calculator/typer/main_75.dart @@ -202,6 +202,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_76.dart b/simplistic_calculator/typer/main_76.dart index 4592738ed..fe4e28092 100644 --- a/simplistic_calculator/typer/main_76.dart +++ b/simplistic_calculator/typer/main_76.dart @@ -203,6 +203,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_77.dart b/simplistic_calculator/typer/main_77.dart index 4a504cf92..3e39adb65 100644 --- a/simplistic_calculator/typer/main_77.dart +++ b/simplistic_calculator/typer/main_77.dart @@ -204,6 +204,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_78.dart b/simplistic_calculator/typer/main_78.dart index 15b9ecc62..e32d11334 100644 --- a/simplistic_calculator/typer/main_78.dart +++ b/simplistic_calculator/typer/main_78.dart @@ -205,6 +205,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_79.dart b/simplistic_calculator/typer/main_79.dart index 760f44c71..bcd5cb073 100644 --- a/simplistic_calculator/typer/main_79.dart +++ b/simplistic_calculator/typer/main_79.dart @@ -206,6 +206,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_80.dart b/simplistic_calculator/typer/main_80.dart index a42a1f70a..f33be9ae2 100644 --- a/simplistic_calculator/typer/main_80.dart +++ b/simplistic_calculator/typer/main_80.dart @@ -207,6 +207,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_81.dart b/simplistic_calculator/typer/main_81.dart index 7c4901488..890cb4389 100644 --- a/simplistic_calculator/typer/main_81.dart +++ b/simplistic_calculator/typer/main_81.dart @@ -215,6 +215,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_82.dart b/simplistic_calculator/typer/main_82.dart index a31c3f999..930d90c9b 100644 --- a/simplistic_calculator/typer/main_82.dart +++ b/simplistic_calculator/typer/main_82.dart @@ -215,6 +215,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_83.dart b/simplistic_calculator/typer/main_83.dart index 03c7a8fab..a30a6c6a9 100644 --- a/simplistic_calculator/typer/main_83.dart +++ b/simplistic_calculator/typer/main_83.dart @@ -220,6 +220,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_84.dart b/simplistic_calculator/typer/main_84.dart index c6d4d82be..542d66d61 100644 --- a/simplistic_calculator/typer/main_84.dart +++ b/simplistic_calculator/typer/main_84.dart @@ -225,6 +225,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_85.dart b/simplistic_calculator/typer/main_85.dart index 997546d05..a31e411ae 100644 --- a/simplistic_calculator/typer/main_85.dart +++ b/simplistic_calculator/typer/main_85.dart @@ -230,6 +230,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_86.dart b/simplistic_calculator/typer/main_86.dart index 473ab6e44..344cd1550 100644 --- a/simplistic_calculator/typer/main_86.dart +++ b/simplistic_calculator/typer/main_86.dart @@ -235,6 +235,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_87.dart b/simplistic_calculator/typer/main_87.dart index 5c208ff02..630f73986 100644 --- a/simplistic_calculator/typer/main_87.dart +++ b/simplistic_calculator/typer/main_87.dart @@ -236,6 +236,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_88.dart b/simplistic_calculator/typer/main_88.dart index fade893b0..13926876f 100644 --- a/simplistic_calculator/typer/main_88.dart +++ b/simplistic_calculator/typer/main_88.dart @@ -238,6 +238,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_89.dart b/simplistic_calculator/typer/main_89.dart index 25cddadda..c95dc5fa2 100644 --- a/simplistic_calculator/typer/main_89.dart +++ b/simplistic_calculator/typer/main_89.dart @@ -246,6 +246,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_90.dart b/simplistic_calculator/typer/main_90.dart index 672925625..c7d78be96 100644 --- a/simplistic_calculator/typer/main_90.dart +++ b/simplistic_calculator/typer/main_90.dart @@ -251,6 +251,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_92.dart b/simplistic_calculator/typer/main_92.dart index 4dd78c08f..5ee2af4a6 100644 --- a/simplistic_calculator/typer/main_92.dart +++ b/simplistic_calculator/typer/main_92.dart @@ -273,6 +273,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_93.dart b/simplistic_calculator/typer/main_93.dart index c7e8351bd..d01107c0a 100644 --- a/simplistic_calculator/typer/main_93.dart +++ b/simplistic_calculator/typer/main_93.dart @@ -273,6 +273,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/typer/main_94.dart b/simplistic_calculator/typer/main_94.dart index 0a57e86d5..e6a173bdf 100644 --- a/simplistic_calculator/typer/main_94.dart +++ b/simplistic_calculator/typer/main_94.dart @@ -283,6 +283,7 @@ class CalculatorApp extends ConsumerWidget { } typedef CalculatorEngineCallback = void Function(CalculatorEngine engine); + enum CalcButtonType { outlined, elevated } class CalcButton extends ConsumerWidget { diff --git a/simplistic_calculator/windows/flutter/generated_plugins.cmake b/simplistic_calculator/windows/flutter/generated_plugins.cmake index 154f23857..ff2147b2c 100644 --- a/simplistic_calculator/windows/flutter/generated_plugins.cmake +++ b/simplistic_calculator/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST window_size ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/simplistic_editor/lib/basic_text_field.dart b/simplistic_editor/lib/basic_text_field.dart index 03819f757..1261d963e 100644 --- a/simplistic_editor/lib/basic_text_field.dart +++ b/simplistic_editor/lib/basic_text_field.dart @@ -22,8 +22,10 @@ class BasicTextField extends StatefulWidget { } class _BasicTextFieldState extends State { - final GlobalKey textInputClientKey = GlobalKey(); - BasicTextInputClientState? get _textInputClient => textInputClientKey.currentState; + final GlobalKey textInputClientKey = + GlobalKey(); + BasicTextInputClientState? get _textInputClient => + textInputClientKey.currentState; RenderEditable get _renderEditable => _textInputClient!.renderEditable; // For text selection gestures. @@ -42,8 +44,8 @@ class _BasicTextFieldState extends State { return false; } - if (cause == SelectionChangedCause.longPress - || cause == SelectionChangedCause.scribble) { + if (cause == SelectionChangedCause.longPress || + cause == SelectionChangedCause.scribble) { return true; } @@ -54,7 +56,8 @@ class _BasicTextFieldState extends State { return false; } - void _handleSelectionChanged(TextSelection selection, SelectionChangedCause? cause) { + void _handleSelectionChanged( + TextSelection selection, SelectionChangedCause? cause) { final bool willShowSelectionHandles = _shouldShowSelectionHandles(cause); if (willShowSelectionHandles != _showSelectionHandles) { setState(() { @@ -128,16 +131,20 @@ class _BasicTextFieldState extends State { case TargetPlatform.linux: case TargetPlatform.windows: _renderEditable.selectWordsInRange( - from: longPressMoveUpdateDetails.globalPosition - longPressMoveUpdateDetails.offsetFromOrigin, + from: longPressMoveUpdateDetails.globalPosition - + longPressMoveUpdateDetails.offsetFromOrigin, to: longPressMoveUpdateDetails.globalPosition, cause: SelectionChangedCause.longPress, ); break; } }, - onLongPressEnd: (longPressEndDetails) => _textInputClient!.showToolbar(), - onHorizontalDragStart: (dragStartDetails) => _onDragStart(dragStartDetails), - onHorizontalDragUpdate: (dragUpdateDetails) => _onDragUpdate(dragUpdateDetails), + onLongPressEnd: (longPressEndDetails) => + _textInputClient!.showToolbar(), + onHorizontalDragStart: (dragStartDetails) => + _onDragStart(dragStartDetails), + onHorizontalDragUpdate: (dragUpdateDetails) => + _onDragUpdate(dragUpdateDetails), child: SizedBox( height: double.infinity, width: MediaQuery.of(context).size.width, @@ -160,4 +167,4 @@ class _BasicTextFieldState extends State { ), ); } -} \ No newline at end of file +} diff --git a/simplistic_editor/lib/basic_text_input_client.dart b/simplistic_editor/lib/basic_text_input_client.dart index dbc0cfdd6..7be351a9f 100644 --- a/simplistic_editor/lib/basic_text_input_client.dart +++ b/simplistic_editor/lib/basic_text_input_client.dart @@ -11,7 +11,8 @@ import 'toggle_button_state_manager.dart'; /// Signature for the callback that reports when the user changes the selection /// (including the cursor location). -typedef SelectionChangedCallback = void Function(TextSelection selection, SelectionChangedCause? cause); +typedef SelectionChangedCallback = void Function( + TextSelection selection, SelectionChangedCause? cause); /// A basic text input client. An implementation of [DeltaTextInputClient] meant to /// send/receive information from the framework to the platform's text input plugin @@ -39,11 +40,13 @@ class BasicTextInputClient extends StatefulWidget { } class BasicTextInputClientState extends State - with TextSelectionDelegate implements DeltaTextInputClient { + with TextSelectionDelegate + implements DeltaTextInputClient { final GlobalKey _textKey = GlobalKey(); late final ToggleButtonsStateManager toggleButtonStateManager; late final TextEditingDeltaHistoryManager textEditingDeltaHistoryManager; - final ClipboardStatusNotifier? _clipboardStatus = kIsWeb ? null : ClipboardStatusNotifier(); + final ClipboardStatusNotifier? _clipboardStatus = + kIsWeb ? null : ClipboardStatusNotifier(); @override void initState() { @@ -124,7 +127,7 @@ class BasicTextInputClientState extends State } @override - void updateEditingValue(TextEditingValue value) { /* Not using */} + void updateEditingValue(TextEditingValue value) {/* Not using */} @override void updateEditingValueWithDeltas(List textEditingDeltas) { @@ -143,14 +146,18 @@ class BasicTextInputClientState extends State return; } - final bool selectionChanged = _value.selection.start != value.selection.start || _value.selection.end != value.selection.end; - textEditingDeltaHistoryManager.updateTextEditingDeltaHistoryOnInput(textEditingDeltas); + final bool selectionChanged = + _value.selection.start != value.selection.start || + _value.selection.end != value.selection.end; + textEditingDeltaHistoryManager + .updateTextEditingDeltaHistoryOnInput(textEditingDeltas); _value = value; if (widget.controller is ReplacementTextEditingController) { for (final TextEditingDelta delta in textEditingDeltas) { - (widget.controller as ReplacementTextEditingController).syncReplacementRanges(delta); + (widget.controller as ReplacementTextEditingController) + .syncReplacementRanges(delta); } } @@ -246,7 +253,8 @@ class BasicTextInputClientState extends State if (_hasFocus) { if (!_value.selection.isValid) { // Place cursor at the end if the selection is invalid when we receive focus. - final TextSelection validSelection = TextSelection.collapsed(offset: _value.text.length); + final TextSelection validSelection = + TextSelection.collapsed(offset: _value.text.length); _handleSelectionChanged(validSelection, null); toggleButtonStateManager.updateToggleButtonsOnSelection(validSelection); } @@ -264,17 +272,20 @@ class BasicTextInputClientState extends State ); } - void _userUpdateTextEditingValueWithDelta(TextEditingDelta textEditingDelta, SelectionChangedCause cause) { + void _userUpdateTextEditingValueWithDelta( + TextEditingDelta textEditingDelta, SelectionChangedCause cause) { TextEditingValue value = _value; value = textEditingDelta.apply(value); if (widget.controller is ReplacementTextEditingController) { - (widget.controller as ReplacementTextEditingController).syncReplacementRanges(textEditingDelta); + (widget.controller as ReplacementTextEditingController) + .syncReplacementRanges(textEditingDelta); } if (value != _value) { - textEditingDeltaHistoryManager.updateTextEditingDeltaHistoryOnInput([textEditingDelta]); + textEditingDeltaHistoryManager + .updateTextEditingDeltaHistoryOnInput([textEditingDelta]); } userUpdateTextEditingValue(value, cause); @@ -292,16 +303,18 @@ class BasicTextInputClientState extends State DeleteCharacterIntent: CallbackAction( onInvoke: (intent) => _delete(), ), - ExtendSelectionByCharacterIntent: CallbackAction( - onInvoke: (intent) => _extendSelection(intent.forward, intent.collapseSelection), + ExtendSelectionByCharacterIntent: + CallbackAction( + onInvoke: (intent) => + _extendSelection(intent.forward, intent.collapseSelection), ), - SelectAllTextIntent : CallbackAction( + SelectAllTextIntent: CallbackAction( onInvoke: (intent) => selectAll(intent.cause), ), - CopySelectionTextIntent : CallbackAction( + CopySelectionTextIntent: CallbackAction( onInvoke: (intent) => copySelection(intent.cause), ), - PasteTextIntent : CallbackAction( + PasteTextIntent: CallbackAction( onInvoke: (intent) => pasteText(intent.cause), ), }; @@ -311,7 +324,8 @@ class BasicTextInputClientState extends State late final TextRange deletedRange; late final TextRange newComposing; - final int deletedLength = _value.text.substring(0, _selection.baseOffset).characters.last.length; + final int deletedLength = + _value.text.substring(0, _selection.baseOffset).characters.last.length; if (_selection.isCollapsed) { if (_selection.baseOffset == 0) return; @@ -323,7 +337,8 @@ class BasicTextInputClientState extends State deletedRange = _selection; } - final bool isComposing = _selection.isCollapsed && _value.isComposingRangeValid; + final bool isComposing = + _selection.isCollapsed && _value.isComposingRangeValid; if (isComposing) { newComposing = TextRange.collapsed(deletedRange.start); @@ -347,15 +362,26 @@ class BasicTextInputClientState extends State if (collapseSelection) { if (!_selection.isCollapsed) { - final int firstOffset = _selection.isNormalized ? _selection.start : _selection.end; - final int lastOffset = _selection.isNormalized ? _selection.end : _selection.start; - selection = TextSelection.collapsed(offset: forward ? lastOffset : firstOffset); + final int firstOffset = + _selection.isNormalized ? _selection.start : _selection.end; + final int lastOffset = + _selection.isNormalized ? _selection.end : _selection.start; + selection = + TextSelection.collapsed(offset: forward ? lastOffset : firstOffset); } else { if (forward && _selection.baseOffset == _value.text.length) return; if (!forward && _selection.baseOffset == 0) return; final int adjustment = forward - ? _value.text.substring(_selection.baseOffset).characters.first.length - : -_value.text.substring(0, _selection.baseOffset).characters.last.length; + ? _value.text + .substring(_selection.baseOffset) + .characters + .first + .length + : -_value.text + .substring(0, _selection.baseOffset) + .characters + .last + .length; selection = TextSelection.collapsed( offset: _selection.baseOffset + adjustment, ); @@ -365,7 +391,11 @@ class BasicTextInputClientState extends State if (!forward && _selection.extentOffset == 0) return; final int adjustment = forward ? _value.text.substring(_selection.baseOffset).characters.first.length - : -_value.text.substring(0, _selection.baseOffset).characters.last.length; + : -_value.text + .substring(0, _selection.baseOffset) + .characters + .last + .length; selection = TextSelection( baseOffset: _selection.baseOffset, extentOffset: _selection.extentOffset + adjustment, @@ -382,7 +412,6 @@ class BasicTextInputClientState extends State ); } - /// For updates to text editing value. void _didChangeTextEditingValue() { _updateRemoteTextEditingValueIfNeeded(); @@ -448,12 +477,13 @@ class BasicTextInputClientState extends State case TargetPlatform.linux: case TargetPlatform.windows: _userUpdateTextEditingValueWithDelta( - TextEditingDeltaNonTextUpdate( - oldText: textEditingValue.text, - selection: TextSelection.collapsed(offset: textEditingValue.selection.end), - composing: TextRange.empty, - ), - cause, + TextEditingDeltaNonTextUpdate( + oldText: textEditingValue.text, + selection: TextSelection.collapsed( + offset: textEditingValue.selection.end), + composing: TextRange.empty, + ), + cause, ); break; } @@ -469,14 +499,15 @@ class BasicTextInputClientState extends State if (cutRange.isCollapsed) return; Clipboard.setData(ClipboardData(text: cutRange.textInside(text))); - final int lastSelectionIndex = math.min(cutRange.baseOffset, cutRange.extentOffset); + final int lastSelectionIndex = + math.min(cutRange.baseOffset, cutRange.extentOffset); _userUpdateTextEditingValueWithDelta( TextEditingDeltaReplacement( - oldText: textEditingValue.text, - replacementText: '', - replacedRange: cutRange, - selection: TextSelection.collapsed(offset: lastSelectionIndex), - composing: TextRange.empty, + oldText: textEditingValue.text, + replacementText: '', + replacedRange: cutRange, + selection: TextSelection.collapsed(offset: lastSelectionIndex), + composing: TextRange.empty, ), cause, ); @@ -505,15 +536,16 @@ class BasicTextInputClientState extends State // After the paste, the cursor should be collapsed and located after the // pasted content. - final int lastSelectionIndex = math.max(pasteRange.baseOffset, pasteRange.baseOffset + data.text!.length); + final int lastSelectionIndex = math.max( + pasteRange.baseOffset, pasteRange.baseOffset + data.text!.length); _userUpdateTextEditingValueWithDelta( TextEditingDeltaReplacement( - oldText: textEditingValue.text, - replacementText: data.text!, - replacedRange: pasteRange, - selection: TextSelection.collapsed(offset: lastSelectionIndex), - composing: TextRange.empty, + oldText: textEditingValue.text, + replacementText: data.text!, + replacedRange: pasteRange, + selection: TextSelection.collapsed(offset: lastSelectionIndex), + composing: TextRange.empty, ), cause, ); @@ -523,12 +555,13 @@ class BasicTextInputClientState extends State @override void selectAll(SelectionChangedCause cause) { - final TextSelection newSelection = _value.selection.copyWith(baseOffset: 0, extentOffset: _value.text.length); + final TextSelection newSelection = _value.selection + .copyWith(baseOffset: 0, extentOffset: _value.text.length); _userUpdateTextEditingValueWithDelta( TextEditingDeltaNonTextUpdate( - oldText: textEditingValue.text, - selection: newSelection, - composing: TextRange.empty + oldText: textEditingValue.text, + selection: newSelection, + composing: TextRange.empty, ), cause, ); @@ -538,31 +571,38 @@ class BasicTextInputClientState extends State TextEditingValue get textEditingValue => _value; @override - void userUpdateTextEditingValue(TextEditingValue value, SelectionChangedCause cause) { + void userUpdateTextEditingValue( + TextEditingValue value, SelectionChangedCause cause) { if (value == _value) return; final bool selectionChanged = _value.selection != value.selection; - if (cause == SelectionChangedCause.drag || cause == SelectionChangedCause.longPress || cause == SelectionChangedCause.tap) { + if (cause == SelectionChangedCause.drag || + cause == SelectionChangedCause.longPress || + cause == SelectionChangedCause.tap) { // Here the change is coming from gestures which call on RenderEditable to change the selection. // Create a TextEditingDeltaNonTextUpdate so we can keep track of the delta history. RenderEditable // does not report a delta on selection change. final bool textChanged = _value.text != value.text; if (selectionChanged && !textChanged) { - final TextEditingDeltaNonTextUpdate selectionUpdate = TextEditingDeltaNonTextUpdate( - oldText: value.text, - selection: value.selection, - composing: value.composing, + final TextEditingDeltaNonTextUpdate selectionUpdate = + TextEditingDeltaNonTextUpdate( + oldText: value.text, + selection: value.selection, + composing: value.composing, ); if (widget.controller is ReplacementTextEditingController) { - (widget.controller as ReplacementTextEditingController).syncReplacementRanges(selectionUpdate); + (widget.controller as ReplacementTextEditingController) + .syncReplacementRanges(selectionUpdate); } - textEditingDeltaHistoryManager.updateTextEditingDeltaHistoryOnInput([selectionUpdate]); + textEditingDeltaHistoryManager + .updateTextEditingDeltaHistoryOnInput([selectionUpdate]); } } - final bool selectionRangeChanged = _value.selection.start != value.selection.start - || _value.selection.end != value.selection.end; + final bool selectionRangeChanged = + _value.selection.start != value.selection.start || + _value.selection.end != value.selection.end; _value = value; @@ -570,7 +610,8 @@ class BasicTextInputClientState extends State _handleSelectionChanged(_value.selection, cause); if (selectionRangeChanged) { - toggleButtonStateManager.updateToggleButtonsOnSelection(_value.selection); + toggleButtonStateManager + .updateToggleButtonsOnSelection(_value.selection); } } } @@ -581,9 +622,11 @@ class BasicTextInputClientState extends State final LayerLink _toolbarLayerLink = LayerLink(); TextSelectionOverlay? _selectionOverlay; - RenderEditable get renderEditable => _textKey.currentContext!.findRenderObject()! as RenderEditable; + RenderEditable get renderEditable => + _textKey.currentContext!.findRenderObject()! as RenderEditable; - void _handleSelectionChanged(TextSelection selection, SelectionChangedCause? cause) { + void _handleSelectionChanged( + TextSelection selection, SelectionChangedCause? cause) { // We return early if the selection is not valid. This can happen when the // text of [EditableText] is updated at the same time as the selection is // changed by a gesture event. @@ -647,20 +690,27 @@ class BasicTextInputClientState extends State exception: exception, stack: stack, library: 'widgets', - context: ErrorDescription('while calling onSelectionChanged for $cause'), + context: + ErrorDescription('while calling onSelectionChanged for $cause'), )); } } - static final Map _defaultWebShortcuts = { + static final Map _defaultWebShortcuts = + { // Activation - const SingleActivator(LogicalKeyboardKey.space): DoNothingAndStopPropagationIntent(), + const SingleActivator(LogicalKeyboardKey.space): + DoNothingAndStopPropagationIntent(), // Scrolling - const SingleActivator(LogicalKeyboardKey.arrowUp): DoNothingAndStopPropagationIntent(), - const SingleActivator(LogicalKeyboardKey.arrowDown): DoNothingAndStopPropagationIntent(), - const SingleActivator(LogicalKeyboardKey.arrowLeft): DoNothingAndStopPropagationIntent(), - const SingleActivator(LogicalKeyboardKey.arrowRight): DoNothingAndStopPropagationIntent(), + const SingleActivator(LogicalKeyboardKey.arrowUp): + DoNothingAndStopPropagationIntent(), + const SingleActivator(LogicalKeyboardKey.arrowDown): + DoNothingAndStopPropagationIntent(), + const SingleActivator(LogicalKeyboardKey.arrowLeft): + DoNothingAndStopPropagationIntent(), + const SingleActivator(LogicalKeyboardKey.arrowRight): + DoNothingAndStopPropagationIntent(), }; @override @@ -684,7 +734,8 @@ class BasicTextInputClientState extends State cursorColor: Colors.blue, backgroundCursorColor: Colors.grey[100], showCursor: ValueNotifier(_hasFocus), - forceLine: true, // Whether text field will take full line regardless of width. + forceLine: + true, // Whether text field will take full line regardless of width. readOnly: false, // editable text-field. hasFocus: _hasFocus, maxLines: null, // multi-line text-field. @@ -699,7 +750,8 @@ class BasicTextInputClientState extends State textHeightBehavior: DefaultTextHeightBehavior.of(context), textWidthBasis: TextWidthBasis.parent, obscuringCharacter: '•', - obscureText: false, // This is a non-private text field that does not require obfuscation. + obscureText: + false, // This is a non-private text field that does not require obfuscation. offset: position, onCaretChanged: null, rendererIgnoresPointer: true, @@ -708,7 +760,8 @@ class BasicTextInputClientState extends State cursorRadius: const Radius.circular(2.0), cursorOffset: Offset.zero, paintCursorAboveText: false, - enableInteractiveSelection: true, // make true to enable selection on mobile. + enableInteractiveSelection: + true, // make true to enable selection on mobile. textSelectionDelegate: this, devicePixelRatio: MediaQuery.of(context).devicePixelRatio, promptRectRange: null, @@ -900,4 +953,4 @@ class _Editable extends MultiChildRenderObjectWidget { ..clipBehavior = clipBehavior ..setPromptRectRange(promptRectRange); } -} \ No newline at end of file +} diff --git a/simplistic_editor/lib/main.dart b/simplistic_editor/lib/main.dart index fbd0ea9fe..55b66073a 100644 --- a/simplistic_editor/lib/main.dart +++ b/simplistic_editor/lib/main.dart @@ -38,14 +38,15 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { final ReplacementTextEditingController _replacementTextEditingController = - ReplacementTextEditingController( + ReplacementTextEditingController( text: 'The quick brown fox jumps over the lazy dog.', ); final FocusNode _focusNode = FocusNode(); final List _isSelected = [false, false, false]; final List _textEditingDeltaHistory = []; - void _updateTextEditingDeltaHistory(List textEditingDeltas) { + void _updateTextEditingDeltaHistory( + List textEditingDeltas) { for (final TextEditingDelta delta in textEditingDeltas) { _textEditingDeltaHistory.add(delta); } @@ -53,7 +54,8 @@ class _MyHomePageState extends State { setState(() {}); } - List _buildTextEditingDeltaHistoryViews(List textEditingDeltas) { + List _buildTextEditingDeltaHistoryViews( + List textEditingDeltas) { List textEditingDeltaViews = []; for (final TextEditingDelta delta in textEditingDeltas) { @@ -61,7 +63,8 @@ class _MyHomePageState extends State { if (delta is TextEditingDeltaInsertion) { deltaView = TextEditingDeltaView( - deltaType: delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: + delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), deltaText: delta.textInserted, deltaRange: TextRange.collapsed(delta.insertionOffset), newSelection: delta.selection, @@ -69,7 +72,8 @@ class _MyHomePageState extends State { ); } else if (delta is TextEditingDeltaDeletion) { deltaView = TextEditingDeltaView( - deltaType: delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: + delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), deltaText: delta.textDeleted, deltaRange: delta.deletedRange, newSelection: delta.selection, @@ -77,7 +81,8 @@ class _MyHomePageState extends State { ); } else if (delta is TextEditingDeltaReplacement) { deltaView = TextEditingDeltaView( - deltaType: delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: + delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), deltaText: delta.replacementText, deltaRange: delta.replacedRange, newSelection: delta.selection, @@ -85,7 +90,8 @@ class _MyHomePageState extends State { ); } else if (delta is TextEditingDeltaNonTextUpdate) { deltaView = TextEditingDeltaView( - deltaType: delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: + delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), deltaText: '', deltaRange: TextRange.empty, newSelection: delta.selection, @@ -111,7 +117,8 @@ class _MyHomePageState extends State { // When the selection changes we want to check the replacements at the new // selection. Enable/disable toggle buttons based on the replacements found // at the new selection. - final List replacementStyles = _replacementTextEditingController.getReplacementsAtSelection(selection); + final List replacementStyles = + _replacementTextEditingController.getReplacementsAtSelection(selection); final List hasChanged = [false, false, false]; if (replacementStyles.isEmpty) { @@ -157,9 +164,9 @@ class _MyHomePageState extends State { void _updateToggleButtonsStateOnButtonPressed(int index) { Map attributeMap = const { - 0 : TextStyle(fontWeight: FontWeight.bold), - 1 : TextStyle(fontStyle: FontStyle.italic), - 2 : TextStyle(decoration: TextDecoration.underline), + 0: TextStyle(fontWeight: FontWeight.bold), + 1: TextStyle(fontStyle: FontStyle.italic), + 2: TextStyle(decoration: TextDecoration.underline), }; final TextRange replacementRange = TextRange( @@ -172,14 +179,15 @@ class _MyHomePageState extends State { _replacementTextEditingController.applyReplacement( TextEditingInlineSpanReplacement( replacementRange, - (string, range) => TextSpan(text: string, style: attributeMap[index]), + (string, range) => TextSpan(text: string, style: attributeMap[index]), true, ), ); setState(() {}); } else { _replacementTextEditingController.disableExpand(attributeMap[index]!); - _replacementTextEditingController.removeReplacementsAtRange(replacementRange, attributeMap[index]); + _replacementTextEditingController.removeReplacementsAtRange( + replacementRange, attributeMap[index]); setState(() {}); } } @@ -188,8 +196,8 @@ class _MyHomePageState extends State { return Text( text, style: const TextStyle( - fontWeight: FontWeight.w600, - decoration: TextDecoration.underline, + fontWeight: FontWeight.w600, + decoration: TextDecoration.underline, ), ); } @@ -200,35 +208,38 @@ class _MyHomePageState extends State { child: Row( children: [ Expanded( - child: Tooltip( - message: 'The type of text input that is occurring.' - ' Check out the documentation for TextEditingDelta for more information.', - child: _buildTextEditingDeltaViewHeading('Delta Type'), - ), + child: Tooltip( + message: 'The type of text input that is occurring.' + ' Check out the documentation for TextEditingDelta for more information.', + child: _buildTextEditingDeltaViewHeading('Delta Type'), + ), ), Expanded( - child: Tooltip( - message: 'The text that is being inserted or deleted', - child: _buildTextEditingDeltaViewHeading('Delta Text'), - ), + child: Tooltip( + message: 'The text that is being inserted or deleted', + child: _buildTextEditingDeltaViewHeading('Delta Text'), + ), ), Expanded( - child: Tooltip( - message: 'The offset in the text where the text input is occurring.', - child: _buildTextEditingDeltaViewHeading('Delta Offset'), - ), + child: Tooltip( + message: + 'The offset in the text where the text input is occurring.', + child: _buildTextEditingDeltaViewHeading('Delta Offset'), + ), ), Expanded( - child: Tooltip( - message: 'The new text selection range after the text input has occurred.', - child: _buildTextEditingDeltaViewHeading('New Selection'), - ), + child: Tooltip( + message: + 'The new text selection range after the text input has occurred.', + child: _buildTextEditingDeltaViewHeading('New Selection'), + ), ), Expanded( - child: Tooltip( - message: 'The new composing range after the text input has occurred.', - child: _buildTextEditingDeltaViewHeading('New Composing'), - ), + child: Tooltip( + message: + 'The new composing range after the text input has occurred.', + child: _buildTextEditingDeltaViewHeading('New Composing'), + ), ), ], ), @@ -247,8 +258,7 @@ class _MyHomePageState extends State { ' more powerful rich text editing applications such as this small example. This feature is supported on all platforms.'; return DialogRoute( context: context, - builder: (context) => - const AlertDialog( + builder: (context) => const AlertDialog( title: Center(child: Text('About')), content: Text(aboutContent), ), @@ -264,7 +274,7 @@ class _MyHomePageState extends State { IconButton( onPressed: () { Navigator.of(context).restorablePush(_aboutDialogBuilder); - }, + }, icon: const Icon(Icons.info_outline), ), ], @@ -274,8 +284,10 @@ class _MyHomePageState extends State { child: Center( child: ToggleButtonsStateManager( isToggleButtonsSelected: _isSelected, - updateToggleButtonsStateOnButtonPressed: _updateToggleButtonsStateOnButtonPressed, - updateToggleButtonStateOnSelectionChanged: _updateToggleButtonsStateOnSelectionChanged, + updateToggleButtonsStateOnButtonPressed: + _updateToggleButtonsStateOnButtonPressed, + updateToggleButtonStateOnSelectionChanged: + _updateToggleButtonsStateOnSelectionChanged, child: Column( children: [ Padding( @@ -285,24 +297,27 @@ class _MyHomePageState extends State { children: [ ToggleButtonsStateManager( isToggleButtonsSelected: _isSelected, - updateToggleButtonsStateOnButtonPressed: _updateToggleButtonsStateOnButtonPressed, - updateToggleButtonStateOnSelectionChanged: _updateToggleButtonsStateOnSelectionChanged, - child: Builder( - builder: (innerContext) { - final ToggleButtonsStateManager manager = ToggleButtonsStateManager.of(innerContext); + updateToggleButtonsStateOnButtonPressed: + _updateToggleButtonsStateOnButtonPressed, + updateToggleButtonStateOnSelectionChanged: + _updateToggleButtonsStateOnSelectionChanged, + child: Builder(builder: (innerContext) { + final ToggleButtonsStateManager manager = + ToggleButtonsStateManager.of(innerContext); - return ToggleButtons( - borderRadius: const BorderRadius.all(Radius.circular(4.0)), - isSelected: manager.toggleButtonsState, - onPressed: (index) => manager.updateToggleButtonsOnButtonPressed(index), - children: const [ - Icon(Icons.format_bold), - Icon(Icons.format_italic), - Icon(Icons.format_underline), - ], - ); - } - ), + return ToggleButtons( + borderRadius: + const BorderRadius.all(Radius.circular(4.0)), + isSelected: manager.toggleButtonsState, + onPressed: (index) => manager + .updateToggleButtonsOnButtonPressed(index), + children: const [ + Icon(Icons.format_bold), + Icon(Icons.format_italic), + Icon(Icons.format_underline), + ], + ); + }), ), ], ), @@ -312,14 +327,17 @@ class _MyHomePageState extends State { padding: const EdgeInsets.symmetric(horizontal: 35.0), child: ToggleButtonsStateManager( isToggleButtonsSelected: _isSelected, - updateToggleButtonsStateOnButtonPressed: _updateToggleButtonsStateOnButtonPressed, - updateToggleButtonStateOnSelectionChanged: _updateToggleButtonsStateOnSelectionChanged, + updateToggleButtonsStateOnButtonPressed: + _updateToggleButtonsStateOnButtonPressed, + updateToggleButtonStateOnSelectionChanged: + _updateToggleButtonsStateOnSelectionChanged, child: TextEditingDeltaHistoryManager( history: _textEditingDeltaHistory, updateHistoryOnInput: _updateTextEditingDeltaHistory, child: BasicTextField( controller: _replacementTextEditingController, - style: const TextStyle(fontSize: 18.0, color: Colors.black), + style: const TextStyle( + fontSize: 18.0, color: Colors.black), focusNode: _focusNode, ), ), @@ -336,18 +354,23 @@ class _MyHomePageState extends State { updateHistoryOnInput: _updateTextEditingDeltaHistory, child: Builder( builder: (innerContext) { - final TextEditingDeltaHistoryManager manager = TextEditingDeltaHistoryManager.of(innerContext); + final TextEditingDeltaHistoryManager manager = + TextEditingDeltaHistoryManager.of( + innerContext); return ListView.separated( - padding: const EdgeInsets.symmetric(horizontal: 35.0), + padding: const EdgeInsets.symmetric( + horizontal: 35.0), itemBuilder: (context, index) { - return _buildTextEditingDeltaHistoryViews(manager.textEditingDeltaHistory)[index]; + return _buildTextEditingDeltaHistoryViews( + manager.textEditingDeltaHistory)[index]; }, - itemCount: manager.textEditingDeltaHistory.length, + itemCount: + manager.textEditingDeltaHistory.length, separatorBuilder: (context, index) { return const SizedBox(height: 2.0); }, ); - } + }, ), ), ), @@ -371,7 +394,7 @@ class TextEditingDeltaView extends StatelessWidget { required this.deltaText, required this.deltaRange, required this.newSelection, - required this.newComposing + required this.newComposing, }) : super(key: key); final String deltaType; diff --git a/simplistic_editor/lib/replacements.dart b/simplistic_editor/lib/replacements.dart index e0ccd135b..15e148914 100644 --- a/simplistic_editor/lib/replacements.dart +++ b/simplistic_editor/lib/replacements.dart @@ -58,39 +58,44 @@ class TextEditingInlineSpanReplacement { final TextRange deletedRange = delta.deletedRange; final int deletedLength = delta.textDeleted.length; - if (range.start >= deletedRange.start - && (range.start < deletedRange.end && range.end > deletedRange.end)) { + if (range.start >= deletedRange.start && + (range.start < deletedRange.end && range.end > deletedRange.end)) { return copy( range: TextRange( start: deletedRange.end - deletedLength, end: range.end - deletedLength, ), ); - } else if ((range.start < deletedRange.start && range.end > deletedRange.start) - && range.end <= deletedRange.end) { + } else if ((range.start < deletedRange.start && + range.end > deletedRange.start) && + range.end <= deletedRange.end) { return copy( range: TextRange( start: range.start, end: deletedRange.start, ), ); - } else if (range.start < deletedRange.start && range.end > deletedRange.end) { + } else if (range.start < deletedRange.start && + range.end > deletedRange.end) { return copy( range: TextRange( start: range.start, end: range.end - deletedLength, ), ); - } else if (range.start >= deletedRange.start && range.end <= deletedRange.end) { + } else if (range.start >= deletedRange.start && + range.end <= deletedRange.end) { return null; - } else if (range.start > deletedRange.start && range.start >= deletedRange.end) { + } else if (range.start > deletedRange.start && + range.start >= deletedRange.end) { return copy( range: TextRange( start: range.start - deletedLength, end: range.end - deletedLength, ), ); - } else if (range.end <= deletedRange.start && range.end < deletedRange.end) { + } else if (range.end <= deletedRange.start && + range.end < deletedRange.end) { return copy( range: TextRange( start: range.start, @@ -102,7 +107,8 @@ class TextEditingInlineSpanReplacement { return null; } - TextEditingInlineSpanReplacement? onInsertion(TextEditingDeltaInsertion delta) { + TextEditingInlineSpanReplacement? onInsertion( + TextEditingDeltaInsertion delta) { final int insertionOffset = delta.insertionOffset; final int insertedLength = delta.textInserted.length; @@ -122,7 +128,8 @@ class TextEditingInlineSpanReplacement { ), ); } - } if (range.start < insertionOffset && range.end < insertionOffset) { + } + if (range.start < insertionOffset && range.end < insertionOffset) { return copy( range: TextRange( start: range.start, @@ -148,20 +155,21 @@ class TextEditingInlineSpanReplacement { return null; } - List? onReplacement(TextEditingDeltaReplacement delta) { + List? onReplacement( + TextEditingDeltaReplacement delta) { final TextRange replacedRange = delta.replacedRange; - final bool replacementShortenedText = delta.replacementText.length < - delta.textReplaced.length; - final bool replacementLengthenedText = delta.replacementText.length > - delta.textReplaced.length; - final bool replacementEqualLength = delta.replacementText.length == - delta.textReplaced.length; - final int changedOffset = replacementShortenedText ? delta.textReplaced - .length - delta.replacementText.length + final bool replacementShortenedText = + delta.replacementText.length < delta.textReplaced.length; + final bool replacementLengthenedText = + delta.replacementText.length > delta.textReplaced.length; + final bool replacementEqualLength = + delta.replacementText.length == delta.textReplaced.length; + final int changedOffset = replacementShortenedText + ? delta.textReplaced.length - delta.replacementText.length : delta.replacementText.length - delta.textReplaced.length; - if (range.start >= replacedRange.start - && (range.start < replacedRange.end && range.end > replacedRange.end)) { + if (range.start >= replacedRange.start && + (range.start < replacedRange.end && range.end > replacedRange.end)) { if (replacementShortenedText) { return [ copy( @@ -190,8 +198,9 @@ class TextEditingInlineSpanReplacement { ), ]; } - } else if ((range.start < replacedRange.start && range.end > replacedRange.start) - && range.end <= replacedRange.end) { + } else if ((range.start < replacedRange.start && + range.end > replacedRange.start) && + range.end <= replacedRange.end) { return [ copy( range: TextRange( @@ -200,7 +209,8 @@ class TextEditingInlineSpanReplacement { ), ), ]; - } else if (range.start < replacedRange.start && range.end > replacedRange.end) { + } else if (range.start < replacedRange.start && + range.end > replacedRange.end) { if (replacementShortenedText) { return [ copy( @@ -247,10 +257,12 @@ class TextEditingInlineSpanReplacement { ), ]; } - } else if (range.start >= replacedRange.start && range.end <= replacedRange.end) { + } else if (range.start >= replacedRange.start && + range.end <= replacedRange.end) { // remove attribute. return null; - } else if (range.start > replacedRange.start && range.start >= replacedRange.end) { + } else if (range.start > replacedRange.start && + range.start >= replacedRange.end) { if (replacementShortenedText) { return [ copy( @@ -272,7 +284,8 @@ class TextEditingInlineSpanReplacement { } else if (replacementEqualLength) { return [this]; } - } else if (range.end <= replacedRange.start && range.end < replacedRange.end) { + } else if (range.end <= replacedRange.start && + range.end < replacedRange.end) { return [ copy( range: TextRange( @@ -286,9 +299,11 @@ class TextEditingInlineSpanReplacement { return null; } - TextEditingInlineSpanReplacement? onNonTextUpdate(TextEditingDeltaNonTextUpdate delta) { + TextEditingInlineSpanReplacement? onNonTextUpdate( + TextEditingDeltaNonTextUpdate delta) { if (range.isCollapsed) { - if (range.start != delta.selection.start && range.end != delta.selection.end) { + if (range.start != delta.selection.start && + range.end != delta.selection.end) { return null; } } @@ -296,8 +311,8 @@ class TextEditingInlineSpanReplacement { } List? removeRange(TextRange removalRange) { - if (range.start >= removalRange.start - && (range.start < removalRange.end && range.end > removalRange.end)) { + if (range.start >= removalRange.start && + (range.start < removalRange.end && range.end > removalRange.end)) { return [ copy( range: TextRange( @@ -306,8 +321,9 @@ class TextEditingInlineSpanReplacement { ), ), ]; - } else if ((range.start < removalRange.start && range.end > removalRange.start) - && range.end <= removalRange.end) { + } else if ((range.start < removalRange.start && + range.end > removalRange.start) && + range.end <= removalRange.end) { return [ copy( range: TextRange( @@ -316,7 +332,8 @@ class TextEditingInlineSpanReplacement { ), ), ]; - } else if (range.start < removalRange.start && range.end > removalRange.end) { + } else if (range.start < removalRange.start && + range.end > removalRange.end) { return [ copy( range: TextRange( @@ -332,11 +349,14 @@ class TextEditingInlineSpanReplacement { ), ), ]; - } else if (range.start >= removalRange.start && range.end <= removalRange.end) { + } else if (range.start >= removalRange.start && + range.end <= removalRange.end) { return null; - } else if (range.start > removalRange.start && range.start >= removalRange.end) { + } else if (range.start > removalRange.start && + range.start >= removalRange.end) { return [this]; - } else if (range.end <= removalRange.start && range.end < removalRange.end) { + } else if (range.end <= removalRange.start && + range.end < removalRange.end) { return [this]; } else if (removalRange.isCollapsed && range.end == removalRange.start) { return [this]; @@ -348,7 +368,8 @@ class TextEditingInlineSpanReplacement { /// Creates a new replacement with all properties copied except for range, which /// is updated to the specified value. TextEditingInlineSpanReplacement copy({TextRange? range, bool? expand}) { - return TextEditingInlineSpanReplacement(range ?? this.range, generator, expand ?? this.expand); + return TextEditingInlineSpanReplacement( + range ?? this.range, generator, expand ?? this.expand); } @override @@ -371,7 +392,7 @@ class ReplacementTextEditingController extends TextEditingController { String? text, List? replacements, this.composingRegionReplaceable = true, - }) : replacements = replacements ?? [], + }) : replacements = replacements ?? [], super(text: text); /// Creates a controller for an editable text field from an initial [TextEditingValue]. @@ -379,7 +400,7 @@ class ReplacementTextEditingController extends TextEditingController { /// This constructor treats a null [value] argument as if it were [TextEditingValue.empty]. ReplacementTextEditingController.fromValue(TextEditingValue? value, {List? replacements, - this.composingRegionReplaceable = true}) + this.composingRegionReplaceable = true}) : super.fromValue(value); /// The [TextEditingInlineSpanReplacement]s that are evaluated on the editing value. @@ -494,7 +515,8 @@ class ReplacementTextEditingController extends TextEditingController { } } - for (final TextEditingInlineSpanReplacement replacementToRemove in toRemove) { + for (final TextEditingInlineSpanReplacement replacementToRemove + in toRemove) { replacements!.remove(replacementToRemove); } @@ -507,17 +529,19 @@ class ReplacementTextEditingController extends TextEditingController { TextStyle? style, required bool withComposing, }) { - assert(!value.composing.isValid - || !withComposing - || value.isComposingRangeValid); + assert(!value.composing.isValid || + !withComposing || + value.isComposingRangeValid); // Keep a mapping of TextRanges to the InlineSpan to replace it with. - final Map rangeSpanMapping = {}; + final Map rangeSpanMapping = + {}; // Iterate through TextEditingInlineSpanReplacements, handling overlapping // replacements and mapping them towards a generated InlineSpan. if (replacements != null) { - for (final TextEditingInlineSpanReplacement replacement in replacements!) { + for (final TextEditingInlineSpanReplacement replacement + in replacements!) { _addToMappingWithOverlaps( replacement.generator, TextRange(start: replacement.range.start, end: replacement.range.end), @@ -532,9 +556,9 @@ class ReplacementTextEditingController extends TextEditingController { // be thrown and this EditableText will be built with a broken subtree. // // Add composing region as a replacement to a TextSpan with underline. - if (composingRegionReplaceable - && value.isComposingRangeValid - && withComposing) { + if (composingRegionReplaceable && + value.isComposingRangeValid && + withComposing) { _addToMappingWithOverlaps((value, range) { final TextStyle composingStyle = style != null ? style.merge(const TextStyle(decoration: TextDecoration.underline)) @@ -556,7 +580,8 @@ class ReplacementTextEditingController extends TextEditingController { int previousEndIndex = 0; for (final TextRange range in sortedRanges) { if (range.start > previousEndIndex) { - spans.add(TextSpan(text: value.text.substring(previousEndIndex, range.start))); + spans.add(TextSpan( + text: value.text.substring(previousEndIndex, range.start))); } spans.add(rangeSpanMapping[range]!); previousEndIndex = range.end; @@ -583,8 +608,8 @@ class ReplacementTextEditingController extends TextEditingController { bool overlap = false; List overlapRanges = []; for (final TextRange range in rangeSpanMapping.keys) { - if (math.max(matchedRange.start, range.start) - <= math.min(matchedRange.end, range.end)) { + if (math.max(matchedRange.start, range.start) <= + math.min(matchedRange.end, range.end)) { overlap = true; overlapRanges.add(range); } @@ -593,10 +618,18 @@ class ReplacementTextEditingController extends TextEditingController { final List> overlappingTriples = >[]; if (overlap) { - overlappingTriples.add([matchedRange.start, matchedRange.end, generator(matchedRange.textInside(text), matchedRange).style]); + overlappingTriples.add([ + matchedRange.start, + matchedRange.end, + generator(matchedRange.textInside(text), matchedRange).style + ]); for (final TextRange overlappingRange in overlapRanges) { - overlappingTriples.add([overlappingRange.start, overlappingRange.end, rangeSpanMapping[overlappingRange]!.style]); + overlappingTriples.add([ + overlappingRange.start, + overlappingRange.end, + rangeSpanMapping[overlappingRange]!.style + ]); rangeSpanMapping.remove(overlappingRange); } @@ -608,10 +641,11 @@ class ReplacementTextEditingController extends TextEditingController { if (toRemoveRangesThatHaveBeenMerged.contains(tripleA)) continue; for (int j = i + 1; j < overlappingTriples.length; j++) { final List tripleB = overlappingTriples[j]; - if (math.max(tripleA[0] as int, tripleB[0] as int) - <= math.min(tripleA[1] as int, tripleB[1] as int) - && tripleA[2] == tripleB[2]) { - toRemoveRangesThatHaveBeenMerged.addAll([tripleA, tripleB]); + if (math.max(tripleA[0] as int, tripleB[0] as int) <= + math.min(tripleA[1] as int, tripleB[1] as int) && + tripleA[2] == tripleB[2]) { + toRemoveRangesThatHaveBeenMerged + .addAll([tripleA, tripleB]); tripleA = [ math.min(tripleA[0] as int, tripleB[0] as int), math.max(tripleA[1] as int, tripleB[1] as int), @@ -621,9 +655,9 @@ class ReplacementTextEditingController extends TextEditingController { } } - if (didOverlap - && !toAddRangesThatHaveBeenMerged.contains(tripleA) - && !toRemoveRangesThatHaveBeenMerged.contains(tripleA)) { + if (didOverlap && + !toAddRangesThatHaveBeenMerged.contains(tripleA) && + !toRemoveRangesThatHaveBeenMerged.contains(tripleA)) { toAddRangesThatHaveBeenMerged.add(tripleA); } } @@ -658,15 +692,14 @@ class ReplacementTextEditingController extends TextEditingController { } Set styles = {}; - List otherEndPoints = endPoints.getRange(1, endPoints.length).toList(); + List otherEndPoints = + endPoints.getRange(1, endPoints.length).toList(); for (int i = 0; i < endPoints.length - 1; i++) { styles = styles.difference(end[endPoints[i]]!); styles.addAll(start[endPoints[i]]!); TextStyle? mergedStyles; - final TextRange uniqueRange = TextRange( - start: endPoints[i], - end: otherEndPoints[i] - ); + final TextRange uniqueRange = + TextRange(start: endPoints[i], end: otherEndPoints[i]); for (final TextStyle style in styles) { if (mergedStyles == null) { mergedStyles = style; @@ -674,10 +707,8 @@ class ReplacementTextEditingController extends TextEditingController { mergedStyles = mergedStyles.merge(style); } } - rangeSpanMapping[uniqueRange] = TextSpan( - text: uniqueRange.textInside(text), - style: mergedStyles - ); + rangeSpanMapping[uniqueRange] = + TextSpan(text: uniqueRange.textInside(text), style: mergedStyles); } } @@ -704,8 +735,9 @@ class ReplacementTextEditingController extends TextEditingController { for (final TextEditingInlineSpanReplacement replacement in replacements!) { if (replacement.range.end == selection.start) { - TextStyle? replacementStyle = - (replacement.generator('', const TextRange.collapsed(0)) as TextSpan).style; + TextStyle? replacementStyle = (replacement.generator( + '', const TextRange.collapsed(0)) as TextSpan) + .style; if (replacementStyle! == style) { toRemove.add(replacement); toAdd.add(replacement.copy(expand: false)); @@ -713,11 +745,13 @@ class ReplacementTextEditingController extends TextEditingController { } } - for (final TextEditingInlineSpanReplacement replacementToRemove in toRemove) { + for (final TextEditingInlineSpanReplacement replacementToRemove + in toRemove) { replacements!.remove(replacementToRemove); } - for (final TextEditingInlineSpanReplacement replacementWithExpandDisabled in toAdd) { + for (final TextEditingInlineSpanReplacement replacementWithExpandDisabled + in toAdd) { replacements!.add(replacementWithExpandDisabled); } } @@ -733,30 +767,27 @@ class ReplacementTextEditingController extends TextEditingController { for (final TextEditingInlineSpanReplacement replacement in replacements!) { if (selection.isCollapsed) { - if (math.max(replacement.range.start, selection.start) - <= math.min(replacement.range.end, selection.end)) { + if (math.max(replacement.range.start, selection.start) <= + math.min(replacement.range.end, selection.end)) { if (selection.end != replacement.range.start) { if (selection.start == replacement.range.end) { if (replacement.expand) { - stylesAtSelection.add(replacement - .generator('', replacement.range) - .style!); + stylesAtSelection + .add(replacement.generator('', replacement.range).style!); } } else { - stylesAtSelection.add(replacement - .generator('', replacement.range) - .style!); + stylesAtSelection + .add(replacement.generator('', replacement.range).style!); } } } } else { - if (math.max(replacement.range.start, selection.start) - <= math.min(replacement.range.end, selection.end)) { + if (math.max(replacement.range.start, selection.start) <= + math.min(replacement.range.end, selection.end)) { if (replacement.range.start <= selection.start && replacement.range.end >= selection.end) { - stylesAtSelection.add(replacement - .generator('', replacement.range) - .style!); + stylesAtSelection + .add(replacement.generator('', replacement.range).style!); } } } @@ -769,17 +800,19 @@ class ReplacementTextEditingController extends TextEditingController { final List toRemove = []; final List toAdd = []; - for(int i = 0; i < replacements!.length; i++) { + for (int i = 0; i < replacements!.length; i++) { TextEditingInlineSpanReplacement replacement = replacements![i]; - InlineSpan replacementSpan = replacement.generator('', const TextRange.collapsed(0)); + InlineSpan replacementSpan = + replacement.generator('', const TextRange.collapsed(0)); TextStyle? replacementStyle = replacementSpan.style; late final TextEditingInlineSpanReplacement? mutatedReplacement; - if ((math.max(replacement.range.start, removalRange.start) - <= math.min(replacement.range.end, removalRange.end)) - && replacementStyle != null) { + if ((math.max(replacement.range.start, removalRange.start) <= + math.min(replacement.range.end, removalRange.end)) && + replacementStyle != null) { if (replacementStyle == attribute!) { - List? newReplacements = replacement.removeRange(removalRange); + List? newReplacements = + replacement.removeRange(removalRange); if (newReplacements != null) { if (newReplacements.length == 1) { @@ -809,4 +842,4 @@ class ReplacementTextEditingController extends TextEditingController { replacements!.remove(replacementToRemove); } } -} \ No newline at end of file +} diff --git a/simplistic_editor/lib/text_editing_delta_history_manager.dart b/simplistic_editor/lib/text_editing_delta_history_manager.dart index ba7712b18..4f2a1d5d1 100644 --- a/simplistic_editor/lib/text_editing_delta_history_manager.dart +++ b/simplistic_editor/lib/text_editing_delta_history_manager.dart @@ -3,7 +3,8 @@ import 'package:flutter/widgets.dart'; /// Signature for the callback that updates text editing delta history when a new delta /// is received. -typedef TextEditingDeltaHistoryUpdateCallback = void Function(List textEditingDeltas); +typedef TextEditingDeltaHistoryUpdateCallback = void Function( + List textEditingDeltas); class TextEditingDeltaHistoryManager extends InheritedWidget { const TextEditingDeltaHistoryManager({ @@ -11,25 +12,29 @@ class TextEditingDeltaHistoryManager extends InheritedWidget { required Widget child, required List history, required TextEditingDeltaHistoryUpdateCallback updateHistoryOnInput, - }) - : _textEditingDeltaHistory = history, + }) : _textEditingDeltaHistory = history, _updateTextEditingDeltaHistoryOnInput = updateHistoryOnInput, super(key: key, child: child); static TextEditingDeltaHistoryManager of(BuildContext context) { - final TextEditingDeltaHistoryManager? result = context.dependOnInheritedWidgetOfExactType(); + final TextEditingDeltaHistoryManager? result = context + .dependOnInheritedWidgetOfExactType(); assert(result != null, 'No ToggleButtonsStateManager found in context'); return result!; } final List _textEditingDeltaHistory; - final TextEditingDeltaHistoryUpdateCallback _updateTextEditingDeltaHistoryOnInput; + final TextEditingDeltaHistoryUpdateCallback + _updateTextEditingDeltaHistoryOnInput; - List get textEditingDeltaHistory => _textEditingDeltaHistory; - TextEditingDeltaHistoryUpdateCallback get updateTextEditingDeltaHistoryOnInput => _updateTextEditingDeltaHistoryOnInput; + List get textEditingDeltaHistory => + _textEditingDeltaHistory; + TextEditingDeltaHistoryUpdateCallback + get updateTextEditingDeltaHistoryOnInput => + _updateTextEditingDeltaHistoryOnInput; @override bool updateShouldNotify(TextEditingDeltaHistoryManager oldWidget) { return textEditingDeltaHistory != oldWidget.textEditingDeltaHistory; } -} \ No newline at end of file +} diff --git a/simplistic_editor/lib/toggle_button_state_manager.dart b/simplistic_editor/lib/toggle_button_state_manager.dart index c1ffd1562..a45273154 100644 --- a/simplistic_editor/lib/toggle_button_state_manager.dart +++ b/simplistic_editor/lib/toggle_button_state_manager.dart @@ -2,40 +2,52 @@ import 'package:flutter/widgets.dart'; /// Signature for the callback that updates toggle button state when the user changes the selection /// (including the cursor location). -typedef UpdateToggleButtonsStateOnSelectionChangedCallback = void Function(TextSelection selection); +typedef UpdateToggleButtonsStateOnSelectionChangedCallback = void Function( + TextSelection selection); /// Signature for the callback that updates toggle button state when the user /// presses the toggle button. -typedef UpdateToggleButtonsStateOnButtonPressedCallback = void Function(int index); +typedef UpdateToggleButtonsStateOnButtonPressedCallback = void Function( + int index); class ToggleButtonsStateManager extends InheritedWidget { const ToggleButtonsStateManager({ Key? key, required Widget child, required List isToggleButtonsSelected, - required UpdateToggleButtonsStateOnButtonPressedCallback updateToggleButtonsStateOnButtonPressed, - required UpdateToggleButtonsStateOnSelectionChangedCallback updateToggleButtonStateOnSelectionChanged, - }) - : _isToggleButtonsSelected = isToggleButtonsSelected, - _updateToggleButtonsStateOnButtonPressed = updateToggleButtonsStateOnButtonPressed, - _updateToggleButtonStateOnSelectionChanged = updateToggleButtonStateOnSelectionChanged, + required UpdateToggleButtonsStateOnButtonPressedCallback + updateToggleButtonsStateOnButtonPressed, + required UpdateToggleButtonsStateOnSelectionChangedCallback + updateToggleButtonStateOnSelectionChanged, + }) : _isToggleButtonsSelected = isToggleButtonsSelected, + _updateToggleButtonsStateOnButtonPressed = + updateToggleButtonsStateOnButtonPressed, + _updateToggleButtonStateOnSelectionChanged = + updateToggleButtonStateOnSelectionChanged, super(key: key, child: child); static ToggleButtonsStateManager of(BuildContext context) { - final ToggleButtonsStateManager? result = context.dependOnInheritedWidgetOfExactType(); + final ToggleButtonsStateManager? result = + context.dependOnInheritedWidgetOfExactType(); assert(result != null, 'No ToggleButtonsStateManager found in context'); return result!; } final List _isToggleButtonsSelected; - final UpdateToggleButtonsStateOnButtonPressedCallback _updateToggleButtonsStateOnButtonPressed; - final UpdateToggleButtonsStateOnSelectionChangedCallback _updateToggleButtonStateOnSelectionChanged; + final UpdateToggleButtonsStateOnButtonPressedCallback + _updateToggleButtonsStateOnButtonPressed; + final UpdateToggleButtonsStateOnSelectionChangedCallback + _updateToggleButtonStateOnSelectionChanged; List get toggleButtonsState => _isToggleButtonsSelected; - UpdateToggleButtonsStateOnButtonPressedCallback get updateToggleButtonsOnButtonPressed => _updateToggleButtonsStateOnButtonPressed; - UpdateToggleButtonsStateOnSelectionChangedCallback get updateToggleButtonsOnSelection => _updateToggleButtonStateOnSelectionChanged; + UpdateToggleButtonsStateOnButtonPressedCallback + get updateToggleButtonsOnButtonPressed => + _updateToggleButtonsStateOnButtonPressed; + UpdateToggleButtonsStateOnSelectionChangedCallback + get updateToggleButtonsOnSelection => + _updateToggleButtonStateOnSelectionChanged; @override bool updateShouldNotify(ToggleButtonsStateManager oldWidget) => toggleButtonsState != oldWidget.toggleButtonsState; -} \ No newline at end of file +} diff --git a/simplistic_editor/test/main_screen_test.dart b/simplistic_editor/test/main_screen_test.dart index ee7ae761c..39e584895 100644 --- a/simplistic_editor/test/main_screen_test.dart +++ b/simplistic_editor/test/main_screen_test.dart @@ -12,46 +12,51 @@ import 'package:simplistic_editor/basic_text_input_client.dart'; import 'package:simplistic_editor/main.dart'; void main() { - testWidgets('Default main page shows all components', - (tester) async { - await tester.pumpWidget(const MyApp()); + testWidgets('Default main page shows all components', (tester) async { + await tester.pumpWidget(const MyApp()); - // Elements on Style ToggleButton Toolbar. - expect(find.widgetWithIcon(ToggleButtons, Icons.format_bold), - findsOneWidget); - expect(find.widgetWithIcon(ToggleButtons, Icons.format_italic), findsOneWidget); - expect( - find.widgetWithIcon(ToggleButtons, Icons.format_underline), findsOneWidget); + // Elements on Style ToggleButton Toolbar. + expect( + find.widgetWithIcon(ToggleButtons, Icons.format_bold), findsOneWidget); + expect(find.widgetWithIcon(ToggleButtons, Icons.format_italic), + findsOneWidget); + expect(find.widgetWithIcon(ToggleButtons, Icons.format_underline), + findsOneWidget); - // Elements on the main screen - // Delta labels. - expect( - find.widgetWithText(Tooltip, "Delta Type"), findsOneWidget); - expect(find.widgetWithText(Tooltip, "Delta Text"), findsOneWidget); - expect( - find.widgetWithText(Tooltip, "Delta Offset"), - findsOneWidget); - expect( - find.widgetWithText(Tooltip, "New Selection"), findsOneWidget); - expect(find.widgetWithText(Tooltip, "New Composing"), findsOneWidget); + // Elements on the main screen + // Delta labels. + expect(find.widgetWithText(Tooltip, "Delta Type"), findsOneWidget); + expect(find.widgetWithText(Tooltip, "Delta Text"), findsOneWidget); + expect(find.widgetWithText(Tooltip, "Delta Offset"), findsOneWidget); + expect(find.widgetWithText(Tooltip, "New Selection"), findsOneWidget); + expect(find.widgetWithText(Tooltip, "New Composing"), findsOneWidget); - // Selection delta is generated and delta history is visible. - await tester.tap(find.byType(BasicTextInputClient)); - await tester.pumpAndSettle(); - expect( - find.widgetWithText(TextEditingDeltaView, "NonTextUpdate"), findsOneWidget); + // Selection delta is generated and delta history is visible. + await tester.tap(find.byType(BasicTextInputClient)); + await tester.pumpAndSettle(); + expect(find.widgetWithText(TextEditingDeltaView, "NonTextUpdate"), + findsOneWidget); - // Find tooltips. - expect(find.byTooltip('The text that is being inserted or deleted'), findsOneWidget); - expect(find.byTooltip('The type of text input that is occurring. Check out the documentation for TextEditingDelta for more information.'), findsOneWidget); - expect(find.byTooltip('The offset in the text where the text input is occurring.'), findsOneWidget); - expect(find.byTooltip('The new text selection range after the text input has occurred.'), findsOneWidget); + // Find tooltips. + expect(find.byTooltip('The text that is being inserted or deleted'), + findsOneWidget); + expect( + find.byTooltip( + 'The type of text input that is occurring. Check out the documentation for TextEditingDelta for more information.'), + findsOneWidget); + expect( + find.byTooltip( + 'The offset in the text where the text input is occurring.'), + findsOneWidget); + expect( + find.byTooltip( + 'The new text selection range after the text input has occurred.'), + findsOneWidget); - // About Dialog - expect( - find.widgetWithIcon(IconButton, Icons.info_outline), findsOneWidget); - await tester.tap(find.widgetWithIcon(IconButton, Icons.info_outline)); - await tester.pumpAndSettle(); - expect(find.widgetWithText(Center, 'About'), findsOneWidget); - }); + // About Dialog + expect(find.widgetWithIcon(IconButton, Icons.info_outline), findsOneWidget); + await tester.tap(find.widgetWithIcon(IconButton, Icons.info_outline)); + await tester.pumpAndSettle(); + expect(find.widgetWithText(Center, 'About'), findsOneWidget); + }); } diff --git a/testing_app/integration_test/perf_test.dart b/testing_app/integration_test/perf_test.dart index 73d12b8e9..68dd64044 100644 --- a/testing_app/integration_test/perf_test.dart +++ b/testing_app/integration_test/perf_test.dart @@ -9,8 +9,7 @@ import 'package:testing_app/main.dart'; void main() { group('Testing App Performance Tests', () { - final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized() - as IntegrationTestWidgetsFlutterBinding; + final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); // The fullyLive frame policy simulates // the way Flutter responds to animations. diff --git a/testing_app/linux/flutter/generated_plugins.cmake b/testing_app/linux/flutter/generated_plugins.cmake index 51436ae8c..2e1de87a7 100644 --- a/testing_app/linux/flutter/generated_plugins.cmake +++ b/testing_app/linux/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/testing_app/pubspec.lock b/testing_app/pubspec.lock index 9f7f85f3c..e2ffae02e 100644 --- a/testing_app/pubspec.lock +++ b/testing_app/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "31.0.0" + version: "39.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.8.0" + version: "4.0.0" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.1.11" args: dependency: transitive description: @@ -57,13 +57,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" clock: dependency: transitive description: @@ -77,7 +70,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -91,7 +84,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.2.0" crypto: dependency: transitive description: @@ -112,7 +105,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" file: dependency: transitive description: @@ -136,7 +129,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -200,7 +193,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -221,7 +214,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -235,7 +228,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" nested: dependency: transitive description: @@ -263,7 +256,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" platform: dependency: transitive description: @@ -352,7 +345,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -394,21 +387,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.19.5" + version: "1.21.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.13" typed_data: dependency: transitive description: @@ -422,14 +415,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.5.0" + version: "8.2.2" watcher: dependency: transitive description: @@ -443,7 +436,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" webdriver: dependency: transitive description: @@ -457,7 +450,7 @@ packages: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" yaml: dependency: transitive description: @@ -466,5 +459,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=1.16.0" diff --git a/testing_app/pubspec.yaml b/testing_app/pubspec.yaml index c53c17913..e9ad16357 100644 --- a/testing_app/pubspec.yaml +++ b/testing_app/pubspec.yaml @@ -4,7 +4,7 @@ description: A sample that shows testing in Flutter. version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -19,7 +19,7 @@ dev_dependencies: flutter_test: sdk: flutter test: ^1.16.8 - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/testing_app/windows/flutter/generated_plugins.cmake b/testing_app/windows/flutter/generated_plugins.cmake index 4d10c2518..b93c4c30c 100644 --- a/testing_app/windows/flutter/generated_plugins.cmake +++ b/testing_app/windows/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh index 1f4fc0ede..ec569675e 100755 --- a/tool/flutter_ci_script_beta.sh +++ b/tool/flutter_ci_script_beta.sh @@ -15,39 +15,30 @@ declare -ar PROJECT_NAMES=( "add_to_app/prebuilt_module/flutter_module" "android_splash_screen" "animations" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "desktop_photo_search/fluent_ui" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "desktop_photo_search/material" + "desktop_photo_search/fluent_ui" + "desktop_photo_search/material" "experimental/federated_plugin/federated_plugin" "experimental/web_dashboard" "experimental/linting_tool" "flutter_maps_firestore" "form_app" - # TODO: Re-enable once WidgetBinding.instance is non-null - # in stable Flutter. - # "game_template" + "game_template" "infinite_list" "ios_app_clip" "isolate_example" "jsonexample" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "material_3_demo" + "material_3_demo" "navigation_and_routing" "null_safety/null_safe_app" "null_safety/null_unsafe_app" "place_tracker" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "platform_channels" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "platform_design" + "platform_channels" + "platform_design" "platform_view_swift" "provider_counter" "provider_shopper" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "simplistic_editor" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "testing_app" + "simplistic_editor" + "testing_app" "veggieseasons" ) diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index 666ba7a72..40ecf362f 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -27,8 +27,7 @@ declare -ar PROJECT_NAMES=( "ios_app_clip" "isolate_example" "jsonexample" - # TODO(domesticmouse): Re-enable once Dart 2.17 is stable - # "material_3_demo" + "material_3_demo" "navigation_and_routing" "null_safety/null_safe_app" "null_safety/null_unsafe_app" @@ -38,8 +37,7 @@ declare -ar PROJECT_NAMES=( "platform_view_swift" "provider_counter" "provider_shopper" - # TODO: Re-enable once Dart 2.17 is stable - # "simplistic_editor" + "simplistic_editor" "testing_app" "veggieseasons" ) diff --git a/veggieseasons/lib/screens/details.dart b/veggieseasons/lib/screens/details.dart index 1714e69ed..9dc372da4 100644 --- a/veggieseasons/lib/screens/details.dart +++ b/veggieseasons/lib/screens/details.dart @@ -255,7 +255,7 @@ class DetailsScreen extends StatefulWidget { } @override - _DetailsScreenState createState() => _DetailsScreenState(); + State createState() => _DetailsScreenState(); } class _DetailsScreenState extends State with RestorationMixin { diff --git a/veggieseasons/lib/screens/search.dart b/veggieseasons/lib/screens/search.dart index ee3c9b49d..79713e0ce 100644 --- a/veggieseasons/lib/screens/search.dart +++ b/veggieseasons/lib/screens/search.dart @@ -15,7 +15,7 @@ class SearchScreen extends StatefulWidget { final String? restorationId; @override - _SearchScreenState createState() => _SearchScreenState(); + State createState() => _SearchScreenState(); } class _SearchScreenState extends State with RestorationMixin { @@ -76,11 +76,14 @@ class _SearchScreenState extends State with RestorationMixin { // This invisible and otherwise unnecessary search box is used to // pad the list entries downward, so none will be underneath the // real search box when the list is at its top scroll position. - child: _createSearchBox(focus: false), visible: false, maintainSize: true, maintainAnimation: true, maintainState: true, + // This invisible and otherwise unnecessary search box is used to + // pad the list entries downward, so none will be underneath the + // real search box when the list is at its top scroll position. + child: _createSearchBox(focus: false), ); } else { return Padding( diff --git a/veggieseasons/lib/screens/settings.dart b/veggieseasons/lib/screens/settings.dart index ae4cbd84d..ce491efca 100644 --- a/veggieseasons/lib/screens/settings.dart +++ b/veggieseasons/lib/screens/settings.dart @@ -166,11 +166,16 @@ class CalorieSettingsScreen extends StatelessWidget { } } -class SettingsScreen extends StatelessWidget { +class SettingsScreen extends StatefulWidget { const SettingsScreen({this.restorationId, Key? key}) : super(key: key); final String? restorationId; + @override + State createState() => _SettingsScreenState(); +} + +class _SettingsScreenState extends State { SettingsItem _buildCaloriesItem(BuildContext context, Preferences prefs) { return SettingsItem( label: 'Calorie Target', @@ -237,6 +242,7 @@ class SettingsScreen extends StatelessWidget { child: const Text('Yes'), onPressed: () async { await prefs.restoreDefaults(); + if (!mounted) return; Navigator.pop(context); }, ), @@ -257,7 +263,7 @@ class SettingsScreen extends StatelessWidget { final prefs = Provider.of(context); return RestorationScope( - restorationId: restorationId, + restorationId: widget.restorationId, child: CupertinoPageScaffold( child: Container( color: diff --git a/veggieseasons/lib/widgets/close_button.dart b/veggieseasons/lib/widgets/close_button.dart index 6a9f784a7..4ef6e6646 100644 --- a/veggieseasons/lib/widgets/close_button.dart +++ b/veggieseasons/lib/widgets/close_button.dart @@ -47,7 +47,8 @@ class ColorChangingIcon extends ImplicitlyAnimatedWidget { final double? size; @override - _ColorChangingIconState createState() => _ColorChangingIconState(); + AnimatedWidgetBaseState createState() => + _ColorChangingIconState(); } class _ColorChangingIconState @@ -81,12 +82,10 @@ class CloseButton extends StatefulWidget { final VoidCallback onPressed; @override - CloseButtonState createState() { - return CloseButtonState(); - } + State createState() => _CloseButtonState(); } -class CloseButtonState extends State { +class _CloseButtonState extends State { bool tapInProgress = false; @override diff --git a/veggieseasons/lib/widgets/settings_item.dart b/veggieseasons/lib/widgets/settings_item.dart index c5739d7b3..8c08a701c 100644 --- a/veggieseasons/lib/widgets/settings_item.dart +++ b/veggieseasons/lib/widgets/settings_item.dart @@ -75,10 +75,10 @@ class SettingsItem extends StatefulWidget { final SettingsItemCallback? onPress; @override - State createState() => SettingsItemState(); + State createState() => _SettingsItemState(); } -class SettingsItemState extends State { +class _SettingsItemState extends State { bool pressed = false; @override diff --git a/veggieseasons/lib/widgets/trivia.dart b/veggieseasons/lib/widgets/trivia.dart index ac91a27f0..1873de90a 100644 --- a/veggieseasons/lib/widgets/trivia.dart +++ b/veggieseasons/lib/widgets/trivia.dart @@ -13,7 +13,7 @@ class TriviaView extends StatefulWidget { const TriviaView({this.id, this.restorationId, Key? key}) : super(key: key); @override - _TriviaViewState createState() => _TriviaViewState(); + State createState() => _TriviaViewState(); } /// Possible states of the game. diff --git a/veggieseasons/lib/widgets/veggie_card.dart b/veggieseasons/lib/widgets/veggie_card.dart index 2e081cf41..73cb451f7 100644 --- a/veggieseasons/lib/widgets/veggie_card.dart +++ b/veggieseasons/lib/widgets/veggie_card.dart @@ -66,7 +66,7 @@ class PressableCard extends StatefulWidget { final Duration duration; @override - _PressableCardState createState() => _PressableCardState(); + State createState() => _PressableCardState(); } class _PressableCardState extends State { diff --git a/veggieseasons/pubspec.lock b/veggieseasons/pubspec.lock index e739077bd..96522fabf 100644 --- a/veggieseasons/pubspec.lock +++ b/veggieseasons/pubspec.lock @@ -56,14 +56,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -77,7 +77,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -110,7 +110,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -148,14 +148,14 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: @@ -169,7 +169,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -190,7 +190,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" path_provider_linux: dependency: transitive description: @@ -218,7 +218,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" platform: dependency: transitive description: @@ -314,7 +314,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -349,7 +349,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -363,14 +363,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.5.1" + version: "2.5.2" window_size: dependency: "direct main" description: @@ -393,7 +393,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.1" yaml: dependency: transitive description: @@ -402,5 +402,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.15.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.8.0" diff --git a/veggieseasons/pubspec.yaml b/veggieseasons/pubspec.yaml index df2b62bfd..c4e056722 100644 --- a/veggieseasons/pubspec.yaml +++ b/veggieseasons/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.2.0 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -24,7 +24,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter_launcher_icons: ^0.9.0 flutter: diff --git a/web/_tool/verify_packages.dart b/web/_tool/verify_packages.dart index 70a197858..8cfc8d8c9 100644 --- a/web/_tool/verify_packages.dart +++ b/web/_tool/verify_packages.dart @@ -11,6 +11,8 @@ import 'common.dart'; void main() async { final packageDirs = listPackageDirs(Directory.current) .map((path) => p.relative(path, from: Directory.current.path)) + // TODO: remove this when `slide_puzzle` is removed from samples repo + .where((path) => !path.contains('slide_puzzle')) .toList(); print('Package dirs:\n${packageDirs.map((path) => ' $path').join('\n')}'); diff --git a/web/charts/lib/behaviors/selection_user_managed.dart b/web/charts/lib/behaviors/selection_user_managed.dart index c5760b45f..855a47679 100644 --- a/web/charts/lib/behaviors/selection_user_managed.dart +++ b/web/charts/lib/behaviors/selection_user_managed.dart @@ -130,7 +130,7 @@ class SelectionUserManagedState extends State { onPressed: _handleClearSelection, child: const Text('Clear Selection')); return Column( - children: [SizedBox(child: chart, height: 150.0), clearSelection]); + children: [SizedBox(height: 150.0, child: chart), clearSelection]); } void _infoSelectionModelUpdated(charts.SelectionModel model) { diff --git a/web/charts/lib/behaviors/slider.dart b/web/charts/lib/behaviors/slider.dart index 4b2c7d842..b4f5d4ad1 100644 --- a/web/charts/lib/behaviors/slider.dart +++ b/web/charts/lib/behaviors/slider.dart @@ -118,7 +118,7 @@ class _SliderCallbackState extends State { }); } - SchedulerBinding.instance!.addPostFrameCallback(rebuild); + SchedulerBinding.instance.addPostFrameCallback(rebuild); } @override diff --git a/web/charts/lib/gallery_scaffold.dart b/web/charts/lib/gallery_scaffold.dart index b172b8471..8acaf2e75 100644 --- a/web/charts/lib/gallery_scaffold.dart +++ b/web/charts/lib/gallery_scaffold.dart @@ -43,7 +43,7 @@ class GalleryScaffold extends StatefulWidget { }); @override - _GalleryScaffoldState createState() => _GalleryScaffoldState(); + State createState() => _GalleryScaffoldState(); } class _GalleryScaffoldState extends State { @@ -61,7 +61,7 @@ class _GalleryScaffoldState extends State { SizedBox(height: 250.0, child: widget.childBuilder()), ])), floatingActionButton: FloatingActionButton( - child: const Icon(Icons.refresh), onPressed: _handleButtonPress), + onPressed: _handleButtonPress, child: const Icon(Icons.refresh)), ); } } diff --git a/web/charts/lib/main.dart b/web/charts/lib/main.dart index 93c130dfe..64aa979c3 100644 --- a/web/charts/lib/main.dart +++ b/web/charts/lib/main.dart @@ -22,13 +22,13 @@ class GalleryApp extends StatefulWidget { const GalleryApp({Key? key}) : super(key: key); @override - GalleryAppState createState() => GalleryAppState(); + State createState() => _GalleryAppState(); } /// The main gallery app state. /// /// Controls performance overlay, and instantiates a [Home] widget. -class GalleryAppState extends State { +class _GalleryAppState extends State { // Initialize app settings from the default configuration. bool _showPerformanceOverlay = defaultConfig.showPerformanceOverlay; diff --git a/web/charts/pubspec.lock b/web/charts/pubspec.lock index 93b7f0ec4..f02fe1b2d 100644 --- a/web/charts/pubspec.lock +++ b/web/charts/pubspec.lock @@ -47,7 +47,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" intl: dependency: "direct main" description: @@ -61,7 +61,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -103,5 +103,5 @@ packages: source: hosted version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" flutter: ">=2.5.0" diff --git a/web/charts/pubspec.yaml b/web/charts/pubspec.yaml index c2da983f4..3cd077396 100644 --- a/web/charts/pubspec.yaml +++ b/web/charts/pubspec.yaml @@ -3,7 +3,7 @@ description: Charts-Flutter Demo publish_to: none environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -12,8 +12,8 @@ dependencies: meta: ^1.1.1 intl: ^0.17.0 -dev_dependencies: - flutter_lints: ^1.0.4 +dev_dependencies: + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/web/game_template b/web/game_template new file mode 120000 index 000000000..987a86f6f --- /dev/null +++ b/web/game_template @@ -0,0 +1 @@ +../game_template \ No newline at end of file diff --git a/web/github_dataviz/lib/layered_chart.dart b/web/github_dataviz/lib/layered_chart.dart index b6ee1822d..ea89b4892 100644 --- a/web/github_dataviz/lib/layered_chart.dart +++ b/web/github_dataviz/lib/layered_chart.dart @@ -17,12 +17,12 @@ class LayeredChart extends StatefulWidget { : super(key: key); @override - State createState() { - return LayeredChartState(); + State createState() { + return _LayeredChartState(); } } -class LayeredChartState extends State { +class _LayeredChartState extends State { late List paths; late List capPaths; late List maxValues; @@ -167,13 +167,13 @@ class LayeredChartState extends State { return Container( color: Constants.backgroundColor, child: CustomPaint( - foregroundPainter: ChartPainter(this, widget.dataToPlot, + foregroundPainter: _ChartPainter(this, widget.dataToPlot, widget.milestones, 80, 50, 50, 12, 500, widget.animationValue), child: Container())); } } -class ChartPainter extends CustomPainter { +class _ChartPainter extends CustomPainter { static List colors = [ Colors.red[900], const Color(0xffc4721a), @@ -208,9 +208,9 @@ class ChartPainter extends CustomPainter { late Paint linePaint; late Paint fillPaint; - LayeredChartState state; + _LayeredChartState state; - ChartPainter( + _ChartPainter( this.state, this.dataToPlot, this.milestones, diff --git a/web/github_dataviz/lib/main.dart b/web/github_dataviz/lib/main.dart index 272b38e8d..c19df527f 100644 --- a/web/github_dataviz/lib/main.dart +++ b/web/github_dataviz/lib/main.dart @@ -22,7 +22,7 @@ class MainLayout extends StatefulWidget { const MainLayout({Key? key}) : super(key: key); @override - _MainLayoutState createState() => _MainLayoutState(); + State createState() => _MainLayoutState(); } class _MainLayoutState extends State with TickerProviderStateMixin { diff --git a/web/github_dataviz/lib/timeline.dart b/web/github_dataviz/lib/timeline.dart index 6576afe95..6562559a5 100644 --- a/web/github_dataviz/lib/timeline.dart +++ b/web/github_dataviz/lib/timeline.dart @@ -29,12 +29,12 @@ class Timeline extends StatefulWidget { : super(key: key); @override - State createState() { - return TimelineState(); + State createState() { + return _TimelineState(); } } -class TimelineState extends State { +class _TimelineState extends State { HashMap labelPainters = HashMap(); @override @@ -49,7 +49,7 @@ class TimelineState extends State { for (var weekLabel in widget.weekLabels) { labelPainters[weekLabel.label] = _makeTextPainter(Constants.milestoneTimelineColor, weekLabel.label); - labelPainters[weekLabel.label + '_red'] = + labelPainters['${weekLabel.label}_red'] = _makeTextPainter(Colors.redAccent, weekLabel.label); } } @@ -79,7 +79,7 @@ class TimelineState extends State { } }, child: CustomPaint( - foregroundPainter: TimelinePainter( + foregroundPainter: _TimelinePainter( this, widget.numWeeks, widget.animationValue, widget.weekLabels), child: Container( height: 200, @@ -106,8 +106,8 @@ class TimelineState extends State { } } -class TimelinePainter extends CustomPainter { - TimelineState state; +class _TimelinePainter extends CustomPainter { + _TimelineState state; late Paint mainLinePaint; late Paint milestoneLinePaint; @@ -123,7 +123,7 @@ class TimelinePainter extends CustomPainter { int yearNumber = 2015; - TimelinePainter( + _TimelinePainter( this.state, this.numWeeks, this.animationValue, this.weekLabels) { mainLinePaint = Paint(); mainLinePaint.style = PaintingStyle.stroke; diff --git a/web/github_dataviz/pubspec.lock b/web/github_dataviz/pubspec.lock index 46fe0ba48..1531074a0 100644 --- a/web/github_dataviz/pubspec.lock +++ b/web/github_dataviz/pubspec.lock @@ -47,7 +47,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" http: dependency: "direct main" description: @@ -75,7 +75,7 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" material_color_utilities: dependency: transitive description: @@ -138,4 +138,4 @@ packages: source: hosted version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/web/github_dataviz/pubspec.yaml b/web/github_dataviz/pubspec.yaml index da76ef5a4..0a5b48a99 100644 --- a/web/github_dataviz/pubspec.yaml +++ b/web/github_dataviz/pubspec.yaml @@ -1,7 +1,7 @@ name: github_dataviz environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: @@ -10,7 +10,7 @@ dependencies: http: ^0.13.4 dev_dependencies: - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter: assets: diff --git a/web/particle_background/lib/main.dart b/web/particle_background/lib/main.dart index 6ba95bc3a..6879a2429 100644 --- a/web/particle_background/lib/main.dart +++ b/web/particle_background/lib/main.dart @@ -39,7 +39,7 @@ class Particles extends StatefulWidget { const Particles(this.numberOfParticles, {key}) : super(key: key); @override - _ParticlesState createState() => _ParticlesState(); + State createState() => _ParticlesState(); } class _ParticlesState extends State { diff --git a/web/particle_background/lib/simple_animations_package.dart b/web/particle_background/lib/simple_animations_package.dart index 7f2b5efdb..1cec3f7eb 100644 --- a/web/particle_background/lib/simple_animations_package.dart +++ b/web/particle_background/lib/simple_animations_package.dart @@ -36,7 +36,7 @@ class Rendering extends StatefulWidget { : super(key: key); @override - _RenderingState createState() => _RenderingState(); + State createState() => _RenderingState(); } class _RenderingState extends State @@ -199,7 +199,7 @@ class MultiTrackTween extends Animatable> { /// Single property to tween. Used by [MultiTrackTween]. class Track { final String name; - final List<_TrackItem> items = []; + final List items = []; Track(this.name); @@ -211,20 +211,20 @@ class Track { /// Optionally you can set a named parameter [curve] that applies an easing /// curve to the tween. Track add(Duration duration, Animatable tween, {Curve? curve}) { - items.add(_TrackItem(duration, tween, curve: curve)); + items.add(TrackItem(duration, tween, curve: curve)); return this; } } -class _TrackItem { +class TrackItem { final Duration duration; late Animatable tween; - _TrackItem(this.duration, Animatable _tween, {Curve? curve}) { + TrackItem(this.duration, Animatable tween, {Curve? curve}) { if (curve != null) { - tween = _tween.chain(CurveTween(curve: curve)); + this.tween = tween.chain(CurveTween(curve: curve)); } else { - tween = _tween; + this.tween = tween; } } } @@ -336,7 +336,7 @@ class ControlledAnimation extends StatefulWidget { super(key: key); @override - _ControlledAnimationState createState() => _ControlledAnimationState(); + State createState() => _ControlledAnimationState(); } class _ControlledAnimationState extends State diff --git a/web/particle_background/pubspec.lock b/web/particle_background/pubspec.lock index 448f6bcae..fec37ab96 100644 --- a/web/particle_background/pubspec.lock +++ b/web/particle_background/pubspec.lock @@ -26,14 +26,14 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" material_color_utilities: dependency: transitive description: @@ -61,4 +61,4 @@ packages: source: hosted version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" diff --git a/web/particle_background/pubspec.yaml b/web/particle_background/pubspec.yaml index d90c1f5ae..b99d326ed 100644 --- a/web/particle_background/pubspec.yaml +++ b/web/particle_background/pubspec.yaml @@ -3,12 +3,12 @@ description: Example for the simple_animations package homepage: https://github.com/felixblaschke/simple_animations environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0-0 <3.0.0" dependencies: flutter: sdk: flutter - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter: assets: - preview.png diff --git a/web/samples_index/lib/src/samples.yaml b/web/samples_index/lib/src/samples.yaml index 7a47ad235..357c5afa0 100644 --- a/web/samples_index/lib/src/samples.yaml +++ b/web/samples_index/lib/src/samples.yaml @@ -492,6 +492,10 @@ samples: platforms: ['windows', 'macos', 'linux'] type: sample +################### +#### Web Demos #### +################### + - name: Rich Text Editor author: Flutter screenshots: @@ -511,7 +515,8 @@ samples: links: [] tags: ["demo", "text"] platforms: ["ios", "android", "web", "windows", "macos", "linux"] - type: sample + type: demo + web: web/simplistic_editor - name: Material You author: Flutter @@ -541,13 +546,42 @@ samples: - AppBar packages: [] links: [] - tags: ["Material", "Material You"] + tags: ["material", "material you"] platforms: ["ios", "android", "web", "windows", "macos", "linux"] - type: sample - -################### -#### Web Demos #### -################### + type: demo + web: web/material_3_demo + + - name: Game Template + author: Flutter + screenshots: + - url: images/loading_screen.png + alt: Loading screen + - url: images/level_selector.png + alt: Level selection screen + source: https://github.com/flutter/samples/tree/master/game_template + description: > + This is a game template that shows how to build much of the dressing + around an actual game. The game itself is very simple - the value in this + sample is everything around the game. + difficulty: beginner + widgets: + - GoRouter + - AppLifecycleObserver + packages: + - audioplayers + - firebase_crashlytics + - games_services + - go_router + - google_mobile_ads + - in_app_purchase + - logging + - provider + - shared_preferences + links: [] + tags: ["games", "firebase", "ads", "crashlytics", "routing"] + platforms: ["ios", "android", "web", "windows", "macos", "linux"] + type: demo + web: web/material_3_demo - name: Charts author: Flutter diff --git a/web/samples_index/web/images/level_selector.png b/web/samples_index/web/images/level_selector.png new file mode 100644 index 000000000..d3bf92a04 Binary files /dev/null and b/web/samples_index/web/images/level_selector.png differ diff --git a/web/samples_index/web/images/loading_screen.png b/web/samples_index/web/images/loading_screen.png new file mode 100644 index 000000000..17b68d181 Binary files /dev/null and b/web/samples_index/web/images/loading_screen.png differ