Last active
August 4, 2022 14:37
-
-
Save craiglabenz/87f1f9cff36d28daffc3e05a836491dc to your computer and use it in GitHub Desktop.
Revisions
-
craiglabenz revised this gist
Aug 4, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,11 +19,15 @@ class MyApp extends StatelessWidget { ), ), debugShowCheckedModeBanner: false, // Default functionality with a Scaffold, which provides a Material widget home: Scaffold( body: Center( child: MyWidget(), ), ), // Comment the above and uncomment the below to enjoy Flutter's jarring default // TextStyle, meant to be unattractive so you choose your own values! // home: Center(child: const Text('Error theme', style: TextStyle(color: Colors.blue))), ); } } -
craiglabenz created this gist
Aug 4, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,63 @@ import 'package:flutter/material.dart'; const Color darkBlue = Color.fromARGB(255, 18, 32, 47); void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData.light().copyWith( scaffoldBackgroundColor: darkBlue, textTheme: const TextTheme( headline4: TextStyle( color: Colors.white, ), ), ), debugShowCheckedModeBanner: false, home: Scaffold( body: Center( child: MyWidget(), ), ), ); } } class MyWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( 'Hello, World!', style: Theme.of(context).textTheme.headline4, ), Text( 'Hello, World!', style: Theme.of(context).textTheme.headline4!.copyWith( color: Colors.red, fontStyle: FontStyle.italic, ), ), const Text( 'Hello, Flutter!', style: TextStyle(color: Colors.blue, fontSize: 48), ), const Text( 'inherit: true (the default)', style: TextStyle(), ), const Text( 'inherit: false', style: TextStyle(inherit: false), ), ], ); } }