From 9140019fa0ddadb4c1e121c6950a9b760c53af03 Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Sat, 22 Jul 2023 01:57:49 +0200 Subject: [PATCH] Enable material 3 on `navigation_and_routing` (#1955) Enabled Material 3. Replaced the `ElevatedButton` to `FilledButton` for better visibility. Added elevation to the top app bar to add contrast to the top navigation tabs. #### Before Material 3 Screenshot 2023-07-21 at 15 32 49 #### With Material 3 Screenshot 2023-07-21 at 15 47 55 ## Pre-launch Checklist - [ ] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [ ] I signed the [CLA]. - [ ] I read the [Contributors Guide]. - [ ] 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]. [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/wiki/Chat [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md --- navigation_and_routing/lib/src/app.dart | 1 + navigation_and_routing/lib/src/screens/books.dart | 1 + navigation_and_routing/lib/src/screens/settings.dart | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/navigation_and_routing/lib/src/app.dart b/navigation_and_routing/lib/src/app.dart index 04ec76454..95dcb3792 100644 --- a/navigation_and_routing/lib/src/app.dart +++ b/navigation_and_routing/lib/src/app.dart @@ -67,6 +67,7 @@ class _BookstoreState extends State { // Revert back to pre-Flutter-2.5 transition behavior: // https://github.com/flutter/flutter/issues/82053 theme: ThemeData( + useMaterial3: true, pageTransitionsTheme: const PageTransitionsTheme( builders: { TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(), diff --git a/navigation_and_routing/lib/src/screens/books.dart b/navigation_and_routing/lib/src/screens/books.dart index 00cf01b0e..2646f1a25 100644 --- a/navigation_and_routing/lib/src/screens/books.dart +++ b/navigation_and_routing/lib/src/screens/books.dart @@ -52,6 +52,7 @@ class _BooksScreenState extends State Widget build(BuildContext context) => Scaffold( appBar: AppBar( title: const Text('Books'), + elevation: 8, bottom: TabBar( controller: _tabController, tabs: const [ diff --git a/navigation_and_routing/lib/src/screens/settings.dart b/navigation_and_routing/lib/src/screens/settings.dart index d25ec1ba2..3519f3323 100644 --- a/navigation_and_routing/lib/src/screens/settings.dart +++ b/navigation_and_routing/lib/src/screens/settings.dart @@ -50,7 +50,7 @@ class SettingsContent extends StatelessWidget { 'Settings', style: Theme.of(context).textTheme.headlineMedium, ), - ElevatedButton( + FilledButton( onPressed: () { BookstoreAuthScope.of(context).signOut(); },