Fixed ThemeData in the Flutter Samples unnecessarily includes useMaterial3 = true (Issue #2214) (#2217)

pull/2218/head
Sasank Tumpati 9 months ago committed by GitHub
parent 25686cf360
commit 0e1355841d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -78,7 +78,6 @@ class MyApp extends StatelessWidget {
title: 'Flutter Module Title',
theme: ThemeData(
colorSchemeSeed: Colors.blue,
useMaterial3: true,
),
routes: {
'/': (context) => const FullScreenView(),

@ -15,7 +15,6 @@ class MyApp extends StatelessWidget {
return MaterialApp(
theme: ThemeData(
primaryColor: const Color(0xff6200ee),
useMaterial3: true,
),
home: const BookDetail(),
);

@ -64,7 +64,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Module Title',
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
routes: {
'/': (context) => const FullScreenView(),
'/mini': (context) => const Contents(),

@ -25,7 +25,6 @@ class MyApp extends StatelessWidget {
title: 'Flutter Demo',
theme: ThemeData(
colorSchemeSeed: color,
useMaterial3: true,
appBarTheme: AppBarTheme(
backgroundColor: color,
foregroundColor: Colors.white,

@ -75,7 +75,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Module Title',
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
routes: {
'/': (context) => const FullScreenView(),
'/mini': (context) => const Contents(),

@ -64,7 +64,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Module Title',
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
routes: {
'/': (context) => const FullScreenView(),
'/mini': (context) => const Contents(),

@ -30,7 +30,6 @@ class MyApp extends StatelessWidget {
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);

@ -184,7 +184,6 @@ class AnimationSamples extends StatelessWidget {
title: 'Animation Samples',
theme: ThemeData(
colorSchemeSeed: Colors.deepPurple,
useMaterial3: true,
),
routerConfig: router,
);

@ -31,7 +31,6 @@ class MyApp extends StatelessWidget {
title: 'Background Isolate Channels',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const MyHomePage(title: 'Background Isolate Channels'),
);

@ -34,7 +34,6 @@ class MyApp extends StatelessWidget {
title: 'Flutter Demo',
theme: ThemeData(
colorSchemeSeed: Colors.blue,
useMaterial3: true,
),
home: MyHomePage(
title: 'Flutter Demo Home Page',

@ -62,7 +62,6 @@ class _MyAppState extends State<MyApp> {
theme: ThemeData(
primarySwatch: Colors.blue,
platform: defaultTargetPlatform,
useMaterial3: true,
),
initialRoute: '/',
routes: <String, Widget Function(BuildContext)>{

@ -28,7 +28,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
routerConfig: GoRouter(
routes: [
GoRoute(

@ -64,7 +64,6 @@ class UnsplashSearchApp extends StatelessWidget {
title: 'Photo Search',
theme: ThemeData(
colorSchemeSeed: Colors.orange,
useMaterial3: true,
),
home: const UnsplashHomePage(title: 'Photo Search'),
);

@ -15,7 +15,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
home: const HomePage(),
);
}

@ -9,7 +9,7 @@ import 'package:linting_tool/theme/colors.dart';
abstract class AppTheme {
static ThemeData buildReplyLightTheme(BuildContext context) {
final base = ThemeData.light(useMaterial3: true);
final base = ThemeData.light();
return base.copyWith(
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: AppColors.blue700,

@ -17,7 +17,6 @@ class MyApp extends StatelessWidget {
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const Home(),
);

@ -19,7 +19,6 @@ class TypePuzzle extends StatelessWidget {
title: 'Type Jam',
theme: ThemeData(
primarySwatch: Colors.grey,
useMaterial3: true,
),
home: const Scaffold(
appBar: null,

@ -66,7 +66,7 @@ class _DashboardAppState extends State<DashboardApp> {
return Provider.value(
value: _appState,
child: MaterialApp(
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
home: SignInSwitcher(
appState: _appState,
apiBuilder: widget.apiBuilder,

@ -36,7 +36,6 @@ class App extends StatelessWidget {
theme: ThemeData(
colorSchemeSeed: Colors.pink,
scaffoldBackgroundColor: Colors.pink[50],
useMaterial3: true,
),
);
}

@ -90,7 +90,6 @@ class FormApp extends StatelessWidget {
title: 'Form Samples',
theme: ThemeData(
colorSchemeSeed: Colors.teal,
useMaterial3: true,
),
routerConfig: router,
);

@ -273,7 +273,6 @@ class MyApp extends StatelessWidget {
color: palette.ink,
),
),
useMaterial3: true,
),
routeInformationProvider: _router.routeInformationProvider,
routeInformationParser: _router.routeInformationParser,

@ -41,7 +41,6 @@ class _MyAppState extends State<MyApp> {
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.green,
useMaterial3: true,
),
home: Scaffold(
appBar: AppBar(

@ -46,7 +46,7 @@ class MyApp extends StatelessWidget {
create: (context) => Catalog(),
child: MaterialApp(
title: 'Infinite List Sample',
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
home: const MyHomePage(),
),
);

@ -48,7 +48,7 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
home: DefaultTabController(
length: 3,
child: Scaffold(

@ -25,7 +25,6 @@ class PlaceTrackerApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp.router(
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.green,
appBarTheme: AppBarTheme(
backgroundColor: Colors.green[700],

@ -25,7 +25,6 @@ class PlatformChannelSample extends StatelessWidget {
snackBarTheme: SnackBarThemeData(
backgroundColor: Colors.blue[500],
),
useMaterial3: true,
),
routerConfig: router(),
);

@ -25,7 +25,6 @@ class MyAdaptingApp extends StatelessWidget {
theme: ThemeData(
// Use the green theme for Material widgets.
primarySwatch: Colors.green,
useMaterial3: true,
),
darkTheme: ThemeData.dark(),
builder: (context, child) {

@ -20,7 +20,6 @@ class PlatformView extends StatelessWidget {
title: 'Platform View',
theme: ThemeData(
primarySwatch: Colors.grey,
useMaterial3: true,
),
home: const HomePage(),
);

@ -69,7 +69,6 @@ class MyApp extends StatelessWidget {
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const MyHomePage(),
);

@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
final appTheme = ThemeData(
colorSchemeSeed: Colors.yellow,
useMaterial3: true,
textTheme: const TextTheme(
displayLarge: TextStyle(
fontFamily: 'Corben',

@ -16,7 +16,6 @@ class MyApp extends StatelessWidget {
title: 'Simple Shader Demo',
theme: ThemeData(
colorSchemeSeed: Colors.blue,
useMaterial3: true,
),
home: const MyHomePage(),
);

@ -347,7 +347,7 @@ class CalculatorApp extends ConsumerWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData.light(),
home: Scaffold(
body: Container(
color: Colors.white,

@ -22,7 +22,6 @@ class MyApp extends StatelessWidget {
title: 'Simplistic Editor',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const MyHomePage(title: 'Simplistic Editor'),
),

@ -42,7 +42,6 @@ class TestingApp extends StatelessWidget {
theme: ThemeData(
colorSchemeSeed: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
useMaterial3: true,
),
routerConfig: router(),
),

@ -41,7 +41,6 @@ class WebStartupAnalyzerSample extends StatelessWidget {
title: 'Flutter web app timing',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green.shade100),
useMaterial3: true,
),
home: WebStartupAnalyzerScreen(analyzer: analyzer),
);

@ -65,7 +65,6 @@ class _MyAppState extends State<MyApp> {
title: 'Element embedding',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
debugShowCheckedModeBanner: false,
home: demoScreenRouter(_currentDemoScreen),

@ -52,7 +52,6 @@ class _MyAppState extends State<MyApp> {
title: 'Element embedding',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: ValueListenableBuilder<DemoScreen>(
valueListenable: _screen,

Loading…
Cancel
Save