diff --git a/.github/workflows/run_ci.yml b/.github/workflows/run_ci.yml index 1fbfcc6..71b64de 100644 --- a/.github/workflows/run_ci.yml +++ b/.github/workflows/run_ci.yml @@ -15,8 +15,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - flutter: [stable, beta] + include: + - os: ubuntu-latest + flutter: stable + - os: ubuntu-latest + flutter: beta + - os: windows-latest + flutter: stable + - os: macos-latest + flutter: stable steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/.github/workflows/run_ci_flutter_downgrade_analyze.yml b/.github/workflows/run_ci_flutter_downgrade_analyze.yml index 2948a10..ac2d7bf 100644 --- a/.github/workflows/run_ci_flutter_downgrade_analyze.yml +++ b/.github/workflows/run_ci_flutter_downgrade_analyze.yml @@ -15,8 +15,9 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] - flutter: [stable] + include: + - os: ubuntu-latest + flutter: stable steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -28,5 +29,5 @@ jobs: channel: ${{ matrix.flutter }} - run: dart --version - run: flutter --version - - run: dart pub global activate dev_test - - run: dart pub global run dev_test:run_ci --pub-downgrade --analyze --no-override --recursive \ No newline at end of file + - run: dart pub global activate dev_build + - run: dart pub global run dev_build:run_ci --pub-downgrade --analyze --no-override --recursive \ No newline at end of file diff --git a/repo_support/pubspec.yaml b/repo_support/pubspec.yaml index 3fa2940..458c3a7 100644 --- a/repo_support/pubspec.yaml +++ b/repo_support/pubspec.yaml @@ -16,7 +16,7 @@ dev_dependencies: ref: dart3a version: '>=0.7.1' test: - dev_test: + dev_build: path: pub_semver: diff --git a/repo_support/tool/run_ci.dart b/repo_support/tool/run_ci.dart index 4b3b07c..a2208ec 100644 --- a/repo_support/tool/run_ci.dart +++ b/repo_support/tool/run_ci.dart @@ -1,4 +1,4 @@ -import 'package:dev_test/package.dart'; +import 'package:dev_build/package.dart'; import 'package:path/path.dart'; import 'package:process_run/shell.dart'; import 'package:pub_semver/pub_semver.dart'; diff --git a/test_menu_flutter/lib/src/component/item_widget.dart b/test_menu_flutter/lib/src/component/item_widget.dart index 7b6e0fb..d88708f 100644 --- a/test_menu_flutter/lib/src/component/item_widget.dart +++ b/test_menu_flutter/lib/src/component/item_widget.dart @@ -4,7 +4,7 @@ import 'package:tekartik_test_menu_flutter/src/model/item.dart'; class ItemWidget extends StatefulWidget { final Item item; final void Function(Item item) onTap; // = Function(MainItem item); - const ItemWidget(this.item, this.onTap, {Key? key}) : super(key: key); + const ItemWidget(this.item, this.onTap, {super.key}); @override State createState() => _ItemWidgetState(); diff --git a/test_menu_flutter/lib/src/component/menu_item_widget.dart b/test_menu_flutter/lib/src/component/menu_item_widget.dart index d5923be..dd59f18 100644 --- a/test_menu_flutter/lib/src/component/menu_item_widget.dart +++ b/test_menu_flutter/lib/src/component/menu_item_widget.dart @@ -6,8 +6,7 @@ class MenuItemWidget extends StatefulWidget { final dynamic Function(Menu menu)? onTap; // = Function(MainItem item); final dynamic Function(Menu menu)? onPlay; - const MenuItemWidget(this.menu, {Key? key, this.onTap, this.onPlay}) - : super(key: key); + const MenuItemWidget(this.menu, {super.key, this.onTap, this.onPlay}); @override State createState() => _MenuItemWidgetState(); diff --git a/test_menu_flutter/lib/src/component/menu_items.dart b/test_menu_flutter/lib/src/component/menu_items.dart index 5ba0bf6..eb5b53c 100644 --- a/test_menu_flutter/lib/src/component/menu_items.dart +++ b/test_menu_flutter/lib/src/component/menu_items.dart @@ -20,12 +20,11 @@ class MenuItems extends StatefulWidget { final List? items; const MenuItems( - {Key? key, + {super.key, this.title, this.items, required this.onTapItem, - required this.onPlayItem}) - : super(key: key); + required this.onPlayItem}); final String? title; diff --git a/test_menu_flutter/lib/src/model/item.dart b/test_menu_flutter/lib/src/model/item.dart index 3279093..3175375 100644 --- a/test_menu_flutter/lib/src/model/item.dart +++ b/test_menu_flutter/lib/src/model/item.dart @@ -21,7 +21,7 @@ class Item extends BaseItem { ItemState state = ItemState.idle; - Item(TestItem testItem, bool autoRun) : super(testItem, autoRun); + Item(super.testItem, super.autoRun); @override String toString() { @@ -43,5 +43,5 @@ class Menu extends BaseItem { bool get group => menuTestItem.menu.group == true; ItemState state = ItemState.idle; - Menu(TestItem testItem, bool autoRun) : super(testItem, autoRun); + Menu(super.testItem, super.autoRun); } diff --git a/test_menu_flutter/lib/src/test_menu_manager_flutter.dart b/test_menu_flutter/lib/src/test_menu_manager_flutter.dart index 1d90d72..8bfc8f6 100644 --- a/test_menu_flutter/lib/src/test_menu_manager_flutter.dart +++ b/test_menu_flutter/lib/src/test_menu_manager_flutter.dart @@ -1,15 +1,14 @@ // ignore_for_file: implementation_imports -import 'dart:async'; - import 'package:flutter/material.dart'; import 'package:tekartik_test_menu/src/test_menu/test_menu.dart'; import 'package:tekartik_test_menu/src/test_menu/test_menu_manager.dart'; import 'package:tekartik_test_menu/test_menu_presenter.dart'; -import 'package:tekartik_test_menu_flutter/src/component/common_import.dart'; import 'package:tekartik_test_menu_flutter/src/component/menu_items.dart'; import 'package:tekartik_test_menu_flutter/src/model/item.dart'; +import 'import.dart'; + export 'package:tekartik_test_menu/test_menu.dart'; // set to false before checkin @@ -226,7 +225,7 @@ void mainMenu(void Function() body, {bool? showConsole}) { } class TestMenuApp extends StatelessWidget { - const TestMenuApp({Key? key}) : super(key: key); + const TestMenuApp({super.key}); // This widget is the root of your application. @override @@ -251,7 +250,7 @@ class TestMenuApp extends StatelessWidget { } class RootMenuPage extends StatefulWidget { - const RootMenuPage({Key? key}) : super(key: key); + const RootMenuPage({super.key}); @override State createState() => _RootMenuPageState(); @@ -446,32 +445,24 @@ class _RootMenuPageState extends State { } var atRoot = menu.name == '_root_'; // TODO share constant - return WillPopScope( + return PopScope( + canPop: false, // onWillPop: () async => true, - onWillPop: () async { - // devPrint('onWillPop ${testMenuManager.canPop()} ${testMenuManager - // .activeDepth} ${testMenuManager - // .activeMenu is RootTestMenu}'); - /*if (testMenuManager.activeMenu is RootTestMenu) { - devPrint('atRoot'); - return true; - }*/ + onPopInvoked: (invoked) async { + if (invoked) { + return; + } if (testMenuManager!.canPop()) { await testMenuManager!.popMenu(); - return false; + return; } if (testMenuManager!.activeMenu is RootTestMenu) { // devPrint('atRoot'); - return true; + /// Pop at root + Navigator.of(context).pop(); } - /* - Navigator.of(context).pop(); - testMenuManager.popMenu().then((_) { - // Navigator.of(context).pop(); - }); - */ - return false; + return; }, child: Scaffold( appBar: AppBar( diff --git a/test_menu_flutter/test/test_menu_flutter_test.dart b/test_menu_flutter/test/test_menu_flutter_test.dart index e1646c2..a7ca32b 100644 --- a/test_menu_flutter/test/test_menu_flutter_test.dart +++ b/test_menu_flutter/test/test_menu_flutter_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:tekartik_test_menu_flutter/src/test_menu_manager_flutter.dart'; class SubPage extends StatelessWidget { - const SubPage({Key? key}) : super(key: key); + const SubPage({super.key}); @override Widget build(BuildContext context) {