mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 06:48:26 +00:00
Migrate platform_channels to go_router (#1533)
* Migrate platform_channels to go_router
* code format
* move addPetDetails into a subroute of petListScreen
* code format
* refactor router and fix tests
* removed unused import
* Elide `web_dashboard` from Master CI (#1535)
* Bump ossf/scorecard-action from 2.1.0 to 2.1.1 (#1536)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](937ffa90d7...15c10fcf1c)
---
updated-dependencies:
- dependency-name: ossf/scorecard-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* go_router 6.0.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Brett Morgan <brett.morgan@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:platform_channels/src/add_pet_details.dart';
|
||||
import 'package:platform_channels/main.dart' as app;
|
||||
|
||||
void main() {
|
||||
group('AddPetDetails tests', () {
|
||||
@@ -20,7 +20,12 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('Enter pet details', (tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(home: AddPetDetails()));
|
||||
var router = app.router('/petListScreen/addPetDetails');
|
||||
await tester.pumpWidget(
|
||||
MaterialApp.router(
|
||||
routerConfig: router,
|
||||
),
|
||||
);
|
||||
|
||||
// Enter the breed of cat.
|
||||
await tester.enterText(find.byType(TextField), 'Persian');
|
||||
@@ -33,6 +38,9 @@ void main() {
|
||||
|
||||
expect(petList, isNotEmpty);
|
||||
expect(petList.last['breed'], 'Persian');
|
||||
|
||||
// Navigate back to /petListScreen
|
||||
expect(router.location, '/petListScreen/');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user