mirror of
https://github.com/flutter/samples.git
synced 2025-11-09 06:18:49 +00:00
Fixed ThemeData in the Flutter Samples unnecessarily includes useMaterial3 = true (Issue #2214) (#2217)
This commit is contained in:
@@ -78,7 +78,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Flutter Module Title',
|
title: 'Flutter Module Title',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.blue,
|
colorSchemeSeed: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
routes: {
|
routes: {
|
||||||
'/': (context) => const FullScreenView(),
|
'/': (context) => const FullScreenView(),
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class MyApp extends StatelessWidget {
|
|||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primaryColor: const Color(0xff6200ee),
|
primaryColor: const Color(0xff6200ee),
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const BookDetail(),
|
home: const BookDetail(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ 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.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
routes: {
|
routes: {
|
||||||
'/': (context) => const FullScreenView(),
|
'/': (context) => const FullScreenView(),
|
||||||
'/mini': (context) => const Contents(),
|
'/mini': (context) => const Contents(),
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: color,
|
colorSchemeSeed: color,
|
||||||
useMaterial3: true,
|
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
backgroundColor: color,
|
backgroundColor: color,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ 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.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
routes: {
|
routes: {
|
||||||
'/': (context) => const FullScreenView(),
|
'/': (context) => const FullScreenView(),
|
||||||
'/mini': (context) => const Contents(),
|
'/mini': (context) => const Contents(),
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ 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.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
routes: {
|
routes: {
|
||||||
'/': (context) => const FullScreenView(),
|
'/': (context) => const FullScreenView(),
|
||||||
'/mini': (context) => const Contents(),
|
'/mini': (context) => const Contents(),
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -184,7 +184,6 @@ class AnimationSamples extends StatelessWidget {
|
|||||||
title: 'Animation Samples',
|
title: 'Animation Samples',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.deepPurple,
|
colorSchemeSeed: Colors.deepPurple,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
routerConfig: router,
|
routerConfig: router,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Background Isolate Channels',
|
title: 'Background Isolate Channels',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const MyHomePage(title: 'Background Isolate Channels'),
|
home: const MyHomePage(title: 'Background Isolate Channels'),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.blue,
|
colorSchemeSeed: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: MyHomePage(
|
home: MyHomePage(
|
||||||
title: 'Flutter Demo Home Page',
|
title: 'Flutter Demo Home Page',
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ class _MyAppState extends State<MyApp> {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
platform: defaultTargetPlatform,
|
platform: defaultTargetPlatform,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
initialRoute: '/',
|
initialRoute: '/',
|
||||||
routes: <String, Widget Function(BuildContext)>{
|
routes: <String, Widget Function(BuildContext)>{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class MyApp extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp.router(
|
return MaterialApp.router(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: ThemeData.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
routerConfig: GoRouter(
|
routerConfig: GoRouter(
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ class UnsplashSearchApp extends StatelessWidget {
|
|||||||
title: 'Photo Search',
|
title: 'Photo Search',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.orange,
|
colorSchemeSeed: Colors.orange,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const UnsplashHomePage(title: 'Photo Search'),
|
home: const UnsplashHomePage(title: 'Photo Search'),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class MyApp extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
home: const HomePage(),
|
home: const HomePage(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import 'package:linting_tool/theme/colors.dart';
|
|||||||
|
|
||||||
abstract class AppTheme {
|
abstract class AppTheme {
|
||||||
static ThemeData buildReplyLightTheme(BuildContext context) {
|
static ThemeData buildReplyLightTheme(BuildContext context) {
|
||||||
final base = ThemeData.light(useMaterial3: true);
|
final base = ThemeData.light();
|
||||||
return base.copyWith(
|
return base.copyWith(
|
||||||
bottomSheetTheme: BottomSheetThemeData(
|
bottomSheetTheme: BottomSheetThemeData(
|
||||||
backgroundColor: AppColors.blue700,
|
backgroundColor: AppColors.blue700,
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const Home(),
|
home: const Home(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ class TypePuzzle extends StatelessWidget {
|
|||||||
title: 'Type Jam',
|
title: 'Type Jam',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.grey,
|
primarySwatch: Colors.grey,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const Scaffold(
|
home: const Scaffold(
|
||||||
appBar: null,
|
appBar: null,
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class _DashboardAppState extends State<DashboardApp> {
|
|||||||
return Provider.value(
|
return Provider.value(
|
||||||
value: _appState,
|
value: _appState,
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
theme: ThemeData.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
home: SignInSwitcher(
|
home: SignInSwitcher(
|
||||||
appState: _appState,
|
appState: _appState,
|
||||||
apiBuilder: widget.apiBuilder,
|
apiBuilder: widget.apiBuilder,
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ class App extends StatelessWidget {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.pink,
|
colorSchemeSeed: Colors.pink,
|
||||||
scaffoldBackgroundColor: Colors.pink[50],
|
scaffoldBackgroundColor: Colors.pink[50],
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ class FormApp extends StatelessWidget {
|
|||||||
title: 'Form Samples',
|
title: 'Form Samples',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.teal,
|
colorSchemeSeed: Colors.teal,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
routerConfig: router,
|
routerConfig: router,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -273,7 +273,6 @@ class MyApp extends StatelessWidget {
|
|||||||
color: palette.ink,
|
color: palette.ink,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
routeInformationProvider: _router.routeInformationProvider,
|
routeInformationProvider: _router.routeInformationProvider,
|
||||||
routeInformationParser: _router.routeInformationParser,
|
routeInformationParser: _router.routeInformationParser,
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ class _MyAppState extends State<MyApp> {
|
|||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.green,
|
primarySwatch: Colors.green,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class MyApp extends StatelessWidget {
|
|||||||
create: (context) => Catalog(),
|
create: (context) => Catalog(),
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
title: 'Infinite List Sample',
|
title: 'Infinite List Sample',
|
||||||
theme: ThemeData.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
home: const MyHomePage(),
|
home: const MyHomePage(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class HomePage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
home: DefaultTabController(
|
home: DefaultTabController(
|
||||||
length: 3,
|
length: 3,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class PlaceTrackerApp extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp.router(
|
return MaterialApp.router(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
useMaterial3: true,
|
|
||||||
colorSchemeSeed: Colors.green,
|
colorSchemeSeed: Colors.green,
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
backgroundColor: Colors.green[700],
|
backgroundColor: Colors.green[700],
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class PlatformChannelSample extends StatelessWidget {
|
|||||||
snackBarTheme: SnackBarThemeData(
|
snackBarTheme: SnackBarThemeData(
|
||||||
backgroundColor: Colors.blue[500],
|
backgroundColor: Colors.blue[500],
|
||||||
),
|
),
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
routerConfig: router(),
|
routerConfig: router(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class MyAdaptingApp extends StatelessWidget {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
// Use the green theme for Material widgets.
|
// Use the green theme for Material widgets.
|
||||||
primarySwatch: Colors.green,
|
primarySwatch: Colors.green,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
darkTheme: ThemeData.dark(),
|
darkTheme: ThemeData.dark(),
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class PlatformView extends StatelessWidget {
|
|||||||
title: 'Platform View',
|
title: 'Platform View',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.grey,
|
primarySwatch: Colors.grey,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const HomePage(),
|
home: const HomePage(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const MyHomePage(),
|
home: const MyHomePage(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
final appTheme = ThemeData(
|
final appTheme = ThemeData(
|
||||||
colorSchemeSeed: Colors.yellow,
|
colorSchemeSeed: Colors.yellow,
|
||||||
useMaterial3: true,
|
|
||||||
textTheme: const TextTheme(
|
textTheme: const TextTheme(
|
||||||
displayLarge: TextStyle(
|
displayLarge: TextStyle(
|
||||||
fontFamily: 'Corben',
|
fontFamily: 'Corben',
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Simple Shader Demo',
|
title: 'Simple Shader Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.blue,
|
colorSchemeSeed: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const MyHomePage(),
|
home: const MyHomePage(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ class CalculatorApp extends ConsumerWidget {
|
|||||||
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: ThemeData.light(useMaterial3: true),
|
theme: ThemeData.light(),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Container(
|
body: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'Simplistic Editor',
|
title: 'Simplistic Editor',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: const MyHomePage(title: 'Simplistic Editor'),
|
home: const MyHomePage(title: 'Simplistic Editor'),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ class TestingApp extends StatelessWidget {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorSchemeSeed: Colors.blue,
|
colorSchemeSeed: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
routerConfig: router(),
|
routerConfig: router(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ class WebStartupAnalyzerSample extends StatelessWidget {
|
|||||||
title: 'Flutter web app timing',
|
title: 'Flutter web app timing',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green.shade100),
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green.shade100),
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: WebStartupAnalyzerScreen(analyzer: analyzer),
|
home: WebStartupAnalyzerScreen(analyzer: analyzer),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ class _MyAppState extends State<MyApp> {
|
|||||||
title: 'Element embedding',
|
title: 'Element embedding',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
home: demoScreenRouter(_currentDemoScreen),
|
home: demoScreenRouter(_currentDemoScreen),
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ class _MyAppState extends State<MyApp> {
|
|||||||
title: 'Element embedding',
|
title: 'Element embedding',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
||||||
useMaterial3: true,
|
|
||||||
),
|
),
|
||||||
home: ValueListenableBuilder<DemoScreen>(
|
home: ValueListenableBuilder<DemoScreen>(
|
||||||
valueListenable: _screen,
|
valueListenable: _screen,
|
||||||
|
|||||||
Reference in New Issue
Block a user