Skip to content

Commit

Permalink
try flutter versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dukex committed Jun 22, 2024
1 parent 8295480 commit 163e2b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Generate matrix from pubspec.yaml
uses: flutter-actions/pubspec-matrix-action@v1
with:
pubspec: "pubspec.yaml"
channel: "stable"
outputs:
matrix: ${{ steps.pubspec.outputs.matrix }}

Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: flutter-actions/setup-flutter@v3
with:
Expand All @@ -36,6 +36,9 @@ jobs:

- run: flutter --version

- run: dart pub add lints
- run: dart pub add test

- name: Install dependencies
run: flutter pub get

Expand Down
8 changes: 4 additions & 4 deletions example/better_router_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ final routes = <String, PageRoute<dynamic> Function(RouteSettings)>{
onPressed: () =>
Navigator.pushNamed(context, "/custom_route_transition"),
child: Text("Go to custom transition"))
])),
])).call,
'/books': DefaultPageRouteBuilder((context) => Column(children: [
for (var i = 0; i < books.length; i++)
TextButton(
onPressed: () =>
Navigator.pushNamed(context, "/books/${books[i].id}"),
child: Text(books[i].name))
])),
])).call,
r"\/books\/(?<id>.+)": DefaultPageRouteBuilder((context) {
final params = RouteParams.of(context);

return Column(
children: [Text('book page'), Text("Book ID: ${params['id']}")],
);
}),
}).call,
'/custom_route_transition': (RouteSettings settings) => PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) =>
Text("Transition"),
Expand All @@ -44,7 +44,7 @@ final routes = <String, PageRoute<dynamic> Function(RouteSettings)>{
child: child,
);
}),
'-matchAll': DefaultPageRouteBuilder((_) => Text('not found page')),
'-matchAll': DefaultPageRouteBuilder((_) => Text('not found page')).call,
};

void main() {
Expand Down
5 changes: 2 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ description: the better router is a powerful, but for humans, flutter router.
version: 2.1.0
repository: https://github.com/dukex/better_router
environment:
sdk: '>=2.17.5 <4.0.0'
sdk: ">=2.17.5"
flutter: ">=3.0.3"
dependencies:
flutter:
sdk: flutter
dev_dependencies:
lints: ^2.0.0
test: ^1.16.0
flutter_test:
sdk: flutter

0 comments on commit 163e2b1

Please sign in to comment.