Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Router Config Issues #4300 (go_router_builder/example) #4369

Merged
merged 6 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/go_router_builder/example/lib/all_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,7 @@ class AllTypesApp extends StatelessWidget {

@override
Widget build(BuildContext context) => MaterialApp.router(
routeInformationParser: _router.routeInformationParser,
routerDelegate: _router.routerDelegate,
routeInformationProvider: _router.routeInformationProvider,
routerConfig: _router,
);

late final GoRouter _router = GoRouter(
Expand Down
4 changes: 1 addition & 3 deletions packages/go_router_builder/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class App extends StatelessWidget {
Widget build(BuildContext context) => ChangeNotifierProvider<LoginInfo>.value(
value: loginInfo,
child: MaterialApp.router(
routeInformationParser: _router.routeInformationParser,
routerDelegate: _router.routerDelegate,
routeInformationProvider: _router.routeInformationProvider,
routerConfig: _router,
title: title,
debugShowCheckedModeBanner: false,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class App extends StatelessWidget {

@override
Widget build(BuildContext context) => MaterialApp.router(
routeInformationParser: _router.routeInformationParser,
routerDelegate: _router.routerDelegate,
routerConfig: _router,
title: _appTitle,
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:go_router_builder_example/shared/data.dart';
import 'package:go_router_builder_example/simple_example.dart';

void main() {
testWidgets('App starts on HomeScreen and displays families',
(WidgetTester tester) async {
await tester.pumpWidget(App());
expect(find.byType(HomeScreen), findsOneWidget);
expect(find.byType(ListTile), findsNWidgets(familyData.length));
for (final Family family in familyData) {
expect(find.text(family.name), findsOneWidget);
}
});
}