mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Enable Material 3 on add_to_app/flutter_module_using_plugin (#1593)
This commit is contained in:
@@ -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'),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user