Enable Material 3 on add_to_app/flutter_module_using_plugin (#1593)

pull/1612/head
Miguel Beltran 3 years ago committed by GitHub
parent cb8aa1f725
commit a15a98252d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,6 +76,10 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: 'Flutter Module Title', title: 'Flutter Module Title',
theme: ThemeData(
colorSchemeSeed: Colors.blue,
useMaterial3: true,
),
routes: { routes: {
'/': (context) => const FullScreenView(), '/': (context) => const FullScreenView(),
'/mini': (context) => const Contents(), '/mini': (context) => const Contents(),
@ -155,13 +159,13 @@ class Contents extends StatelessWidget {
const SizedBox(height: 16), const SizedBox(height: 16),
Consumer<CounterModel>( Consumer<CounterModel>(
builder: (context, model, child) { builder: (context, model, child) {
return ElevatedButton( return FilledButton(
onPressed: () => model.increment(), onPressed: () => model.increment(),
child: const Text('Tap me!'), child: const Text('Tap me!'),
); );
}, },
), ),
ElevatedButton( FilledButton(
onPressed: () async { onPressed: () async {
// Use the url_launcher plugin to open the Flutter docs in // Use the url_launcher plugin to open the Flutter docs in
// a browser. // a browser.
@ -174,7 +178,7 @@ class Contents extends StatelessWidget {
), ),
if (showExit) ...[ if (showExit) ...[
const SizedBox(height: 16), const SizedBox(height: 16),
ElevatedButton( FilledButton(
onPressed: () => SystemNavigator.pop(), onPressed: () => SystemNavigator.pop(),
child: const Text('Exit this screen'), child: const Text('Exit this screen'),
), ),

Loading…
Cancel
Save