Skip to content

Commit

Permalink
Merging from dart3a
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Dec 3, 2023
2 parents 235a4f5 + 8c23c7b commit fce972e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 40 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/run_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/run_ci_flutter_downgrade_analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
- run: dart pub global activate dev_build
- run: dart pub global run dev_build:run_ci --pub-downgrade --analyze --no-override --recursive
2 changes: 1 addition & 1 deletion repo_support/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dev_dependencies:
ref: dart3a
version: '>=0.7.1'
test:
dev_test:
dev_build:
path:
pub_semver:

Expand Down
2 changes: 1 addition & 1 deletion repo_support/tool/run_ci.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test_menu_flutter/lib/src/component/item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemWidget> createState() => _ItemWidgetState();
Expand Down
3 changes: 1 addition & 2 deletions test_menu_flutter/lib/src/component/menu_item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<MenuItemWidget> createState() => _MenuItemWidgetState();
Expand Down
5 changes: 2 additions & 3 deletions test_menu_flutter/lib/src/component/menu_items.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ class MenuItems extends StatefulWidget {
final List<BaseItem?>? 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;

Expand Down
4 changes: 2 additions & 2 deletions test_menu_flutter/lib/src/model/item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
}
37 changes: 14 additions & 23 deletions test_menu_flutter/lib/src/test_menu_manager_flutter.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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<RootMenuPage> createState() => _RootMenuPageState();
Expand Down Expand Up @@ -446,32 +445,24 @@ class _RootMenuPageState extends State<RootMenuPage> {
}

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(
Expand Down
2 changes: 1 addition & 1 deletion test_menu_flutter/test/test_menu_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fce972e

Please sign in to comment.