Skip to content

Commit

Permalink
chore(codelabs): remove redundant useMaterial3 flag (#2283)
Browse files Browse the repository at this point in the history
This PR removes redundant occurrences of `useMaterial3: true` in Flutter
codelabs. Since `useMaterial3: true` is now the default, explicitly
setting it is unnecessary unless demonstrating its behavior. This change
helps keep the sample code clean and aligned with current Flutter
defaults.

Partial fix for
[flutter/flutter#162818](flutter/flutter#162818)

## Pre-launch Checklist

- [x] I read the [Effective Dart: Style] _recently_, and have followed
its advice.
- [x] I signed the [CLA].
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Effective Dart: Style]:
https://dart.dev/guides/language/effective-dart/style
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md

---------

Co-authored-by: Brett Morgan <brett.morgan@gmail.com>
  • Loading branch information
AsmaaAlamrawy and domesticmouse authored Feb 8, 2025
1 parent cb7c4f5 commit 1016cc6
Show file tree
Hide file tree
Showing 783 changed files with 6,719 additions and 7,273 deletions.
4 changes: 1 addition & 3 deletions adaptive_app/codelab_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,9 @@ steps:
title: 'FlutterDev Playlists',
theme: FlexColorScheme.light(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
darkTheme: FlexColorScheme.dark(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
themeMode: ThemeMode.dark, // Or ThemeMode.System if you'd prefer
debugShowCheckedModeBanner: false,
Expand Down Expand Up @@ -1586,7 +1584,7 @@ steps:
+ title: 'Your Playlists',
theme: FlexColorScheme.light(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
- name: Patch lib/src/adaptive_playlists.dart
path: adaptive_app/lib/src/adaptive_playlists.dart
patch-u: |
Expand Down
2 changes: 1 addition & 1 deletion adaptive_app/step_03/macos/Runner/Configs/AppInfo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ PRODUCT_NAME = adaptive_app
PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveApp

// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved.
2 changes: 1 addition & 1 deletion adaptive_app/step_03/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ^3.6.0-0
sdk: ^3.6.2

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand Down
2 changes: 1 addition & 1 deletion adaptive_app/step_03/windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ BEGIN
VALUE "FileDescription", "adaptive_app" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "adaptive_app" "\0"
VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "adaptive_app.exe" "\0"
VALUE "ProductName", "adaptive_app" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0"
Expand Down
112 changes: 56 additions & 56 deletions adaptive_app/step_04/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions adaptive_app/step_04/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ class PlaylistsApp extends StatelessWidget {
title: 'FlutterDev Playlists',
theme: FlexColorScheme.light(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
darkTheme: FlexColorScheme.dark(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
themeMode: ThemeMode.dark, // Or ThemeMode.System if you'd prefer
debugShowCheckedModeBanner: false,
Expand Down
88 changes: 44 additions & 44 deletions adaptive_app/step_04/macos/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion adaptive_app/step_04/macos/Runner/Configs/AppInfo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ PRODUCT_NAME = adaptive_app
PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveApp

// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved.
8 changes: 4 additions & 4 deletions adaptive_app/step_04/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ^3.6.0-0
sdk: ^3.6.2

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand All @@ -35,11 +35,11 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
googleapis: ^13.2.0
http: ^1.2.2
http: ^1.3.0
provider: ^6.1.2
url_launcher: ^6.3.1
flex_color_scheme: ^8.0.0
go_router: ^14.4.1
flex_color_scheme: ^8.1.0
go_router: ^14.7.2

dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion adaptive_app/step_04/windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ BEGIN
VALUE "FileDescription", "adaptive_app" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "adaptive_app" "\0"
VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "adaptive_app.exe" "\0"
VALUE "ProductName", "adaptive_app" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0"
Expand Down
112 changes: 56 additions & 56 deletions adaptive_app/step_05/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions adaptive_app/step_05/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ class PlaylistsApp extends StatelessWidget {
title: 'FlutterDev Playlists',
theme: FlexColorScheme.light(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
darkTheme: FlexColorScheme.dark(
scheme: FlexScheme.red,
useMaterial3: true,
).toTheme,
themeMode: ThemeMode.dark, // Or ThemeMode.System if you'd prefer
debugShowCheckedModeBanner: false,
Expand Down
Loading

0 comments on commit 1016cc6

Please sign in to comment.