From a8d54d260cfdc55460852bd3210e770e4f04cec4 Mon Sep 17 00:00:00 2001 From: ycc Date: Sun, 11 Feb 2024 14:16:07 +0100 Subject: [PATCH] softer colors --- lib/main.dart | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 9b33d3d..99d0644 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,7 +12,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', + title: 'Sept !!', theme: ThemeData( // This is the theme of your application. // @@ -82,9 +82,11 @@ class _MyHomePageState extends State { setState(() { _key = " "; // check if the key is a letter between a and z - if (key.length == 1 && key.codeUnitAt(0) >= 65 && key.codeUnitAt(0) <= 90) _key = key; + if (key.length == 1 && key.codeUnitAt(0) >= 65 && key.codeUnitAt(0) <= 90) + _key = key; // check if the key is a number between 0 and 9 - if (key.length == 1 && key.codeUnitAt(0) >= 48 && key.codeUnitAt(0) <= 57) _key = key; + if (key.length == 1 && key.codeUnitAt(0) >= 48 && key.codeUnitAt(0) <= 57) + _key = key; }); return true; } @@ -120,11 +122,13 @@ class _MyHomePageState extends State { // fast, so that you can just rebuild anything that needs updating rather // than having to individually change instances of widgets. return Scaffold( + backgroundColor: Colors.black45, appBar: AppBar( // TRY THIS: Try changing the color here to a specific color (to // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, + + backgroundColor: Colors.blueGrey, // Here we take the value from the MyHomePage object that was created by // the App.build method, and use it to set our appbar title. title: Text(widget.title), @@ -146,11 +150,17 @@ class _MyHomePageState extends State { // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" // action in the IDE, or press "p" in the console), to see the // wireframe for each widget. + mainAxisAlignment: MainAxisAlignment.center, children: [ Text( '$_key', - style: Theme.of(context).textTheme.headlineLarge, + // set text color to white + + style: TextStyle( + color: Colors.lightGreen, + fontSize: 160.0, // Change this to your preferred color + ), ), ], ),