Skip to content

Commit 1352ad2

Browse files
authored
[go_router_builder] Reland material_ui migration (flutter#12995)
Relands flutter#12913 It was reverted because the version of material_ui it was adopting (1.3.0) was retracted. This PR now has formatting changes as well, since it is now using Dart 3.13 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent ba0364a commit 1352ad2

52 files changed

Lines changed: 203 additions & 155 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/go_router_builder/CHANGELOG.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 4.5.1
22

3-
* Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
3+
- Migrates examples to `material_ui` package (1.4.0).
4+
- Updates minimum supported SDK version to Flutter 3.47/Dart 3.13.
45

56
## 4.5.0
67

‎packages/go_router_builder/README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,8 @@ a return value. The generated routes also follow this functionality.
250250

251251
<?code-excerpt "example/lib/readme_excerpts.dart (awaitPush)"?>
252252
```dart
253-
final bool? result = await const FamilyRoute(
254-
fid: 'John',
255-
).push<bool>(context);
253+
final bool? result = await const FamilyRoute(fid: 'John')
254+
.push<bool>(context);
256255
```
257256

258257
## Query parameters

‎packages/go_router_builder/example/lib/all_extension_types.dart‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// ignore_for_file: public_member_api_docs, unreachable_from_main
66

7-
import 'package:flutter/material.dart';
7+
import 'package:material_ui/material_ui.dart';
88
import 'package:go_router/go_router.dart';
99

1010
import 'shared/data.dart';
@@ -46,14 +46,23 @@ class AllTypesBaseRoute extends GoRouteData with $AllTypesBaseRoute {
4646
}
4747

4848
extension type const BigIntExtension(BigInt value) {}
49+
4950
extension type const BoolExtension(bool value) {}
51+
5052
extension type const DateTimeExtension(DateTime value) {}
53+
5154
extension type const DoubleExtension(double value) {}
55+
5256
extension type const IntExtension(int value) {}
57+
5358
extension type const NumExtension(num value) {}
59+
5460
extension type const StringExtension(String value) {}
61+
5562
extension type const UriExtension(Uri value) {}
63+
5664
extension type const PersonDetailsExtension(PersonDetails value) {}
65+
5766
extension type const SportDetailsExtension(SportDetails value) {}
5867

5968
class BigIntExtensionRoute extends GoRouteData with $BigIntExtensionRoute {

‎packages/go_router_builder/example/lib/all_extension_types.g.dart‎

Lines changed: 67 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/go_router_builder/example/lib/all_types.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// ignore_for_file: public_member_api_docs, unreachable_from_main
66

7-
import 'package:flutter/material.dart';
7+
import 'package:material_ui/material_ui.dart';
88
import 'package:go_router/go_router.dart';
99

1010
import 'shared/data.dart';

‎packages/go_router_builder/example/lib/case_sensitive_example.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// ignore_for_file: public_member_api_docs, unreachable_from_main
66

7-
import 'package:flutter/material.dart';
7+
import 'package:material_ui/material_ui.dart';
88
import 'package:go_router/go_router.dart';
99

1010
part 'case_sensitive_example.g.dart';

‎packages/go_router_builder/example/lib/custom_encoder_example.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import 'dart:convert';
88

9-
import 'package:flutter/material.dart';
9+
import 'package:material_ui/material_ui.dart';
1010
import 'package:go_router/go_router.dart';
1111

1212
part 'custom_encoder_example.g.dart';

‎packages/go_router_builder/example/lib/extra_example.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// ignore_for_file: public_member_api_docs, unreachable_from_main
66

7-
import 'package:flutter/material.dart';
7+
import 'package:material_ui/material_ui.dart';
88
import 'package:go_router/go_router.dart';
99

1010
part 'extra_example.g.dart';

‎packages/go_router_builder/example/lib/go_relative.dart‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// ignore_for_file: public_member_api_docs, unreachable_from_main
66

7-
import 'package:flutter/material.dart';
7+
import 'package:material_ui/material_ui.dart';
88
import 'package:go_router/go_router.dart';
99

1010
part 'go_relative.g.dart';
@@ -152,9 +152,9 @@ class DetailsScreen extends StatelessWidget {
152152
child: const Text('Go back'),
153153
),
154154
ElevatedButton(
155-
onPressed: () => const SettingsRoute(
156-
settingId: 'SettingsId',
157-
).goRelative(context),
155+
onPressed: () =>
156+
const SettingsRoute(settingId: 'SettingsId')
157+
.goRelative(context),
158158
child: const Text('Go to the Settings screen'),
159159
),
160160
],

‎packages/go_router_builder/example/lib/json_example.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import 'dart:convert';
88

9-
import 'package:flutter/material.dart';
9+
import 'package:material_ui/material_ui.dart';
1010
import 'package:go_router/go_router.dart';
1111

1212
import 'shared/json_example.dart';

0 commit comments

Comments
 (0)