From a6d7fafd15fd8225357e03f07b89f45826d153b8 Mon Sep 17 00:00:00 2001 From: flofriday Date: Mon, 16 Aug 2021 17:57:24 +0200 Subject: [PATCH] Fix visual bug on homescreen [light theme only] --- README.md | 5 +-- lib/main.dart | 61 ++++++++++++++++---------------- lib/screens/image_screen.dart | 8 ++++- lib/screens/settings_screen.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 40 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 94f3320..8b94eb6 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,7 @@ API, the app itself is not official! ## Future Features -So, I currently implemented all features I can think of. However, I will still -maintain the app and update it to be compatible with future OS versions. - -If you have ideas for new features or bug reports, feel free to open an issue. +- Fix light theme ## Build it yourself diff --git a/lib/main.dart b/lib/main.dart index 11eb569..c2da61f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,9 +19,9 @@ class App extends StatelessWidget { locale: Locale('en'), theme: ThemeData( brightness: Brightness.light, - accentColor: Colors.indigo[400], - primarySwatch: Colors.blueGrey, - scaffoldBackgroundColor: Colors.blueGrey[50], + accentColor: Colors.indigo, + primarySwatch: Colors.indigo, + scaffoldBackgroundColor: Colors.indigo[50], cardTheme: CardTheme( shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(10)))), @@ -104,9 +104,10 @@ class _MainPageState extends State { padding: EdgeInsets.all(16), child: ElevatedButton( style: ElevatedButton.styleFrom( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0), - )), + shape: new RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(30.0), + ), + ), onPressed: () { showSearch(context: context, delegate: PersonSearch()); }, @@ -137,28 +138,28 @@ class _MainPageState extends State { return Text(""); return RichText( - text: TextSpan(children: [ - TextSpan( - text: 'Login', - style: - TextStyle(decoration: TextDecoration.underline), - recognizer: TapGestureRecognizer() - ..onTap = () async { - print('WTF'); - await Navigator.push( - context, - MaterialPageRoute( - builder: (context) => LoginScreen(), - ), - ); - print('NOW'); - setState(() { - this._isLoggedIn = - TissLoginManager().isLoggedIn(); - }); - }), - TextSpan(text: ' to find students.') - ]), + text: TextSpan( + style: Theme.of(context).textTheme.bodyText1, + children: [ + TextSpan( + text: 'Login', + style: TextStyle( + decoration: TextDecoration.underline), + recognizer: TapGestureRecognizer() + ..onTap = () async { + await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LoginScreen(), + ), + ); + setState(() { + this._isLoggedIn = + TissLoginManager().isLoggedIn(); + }); + }), + TextSpan(text: ' to find students.') + ]), ); }, ), @@ -170,9 +171,7 @@ class _MainPageState extends State { padding: EdgeInsets.all(8), child: RichText( text: TextSpan( - style: TextStyle( - fontSize: - Theme.of(context).textTheme.caption!.fontSize), + style: Theme.of(context).textTheme.bodyText2, children: [ TextSpan( text: "Made with ❤️ by ", diff --git a/lib/screens/image_screen.dart b/lib/screens/image_screen.dart index 300c679..77363c0 100644 --- a/lib/screens/image_screen.dart +++ b/lib/screens/image_screen.dart @@ -11,9 +11,15 @@ class ImageScreen extends StatelessWidget { return Scaffold( backgroundColor: Colors.black, appBar: AppBar( + brightness: Brightness.dark, + foregroundColor: Colors.black, backgroundColor: Color.fromARGB(0xAA, 0x00, 0x00, 0x00), elevation: 0, - title: Text(_title), + title: Text( + _title, + style: TextStyle(color: Colors.white), + ), + iconTheme: IconThemeData(color: Colors.white), ), body: InteractiveViewer( clipBehavior: Clip.none, diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 01a644b..05bef6a 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -173,7 +173,7 @@ class _SettingsScreenState extends State { child: ListBody( children: const [ Text( - 'Oh no!\nYou found on of my eastereggs, how emberassing. 🙈\n\nOk you can keep it, but please don\'t tell the other about this.'), + 'Oh no!\nYou found on of my eastereggs, how emberassing. 🙈\n\nOk you can keep it, but please don\'t tell the others about this.'), ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 1bb6ff0..cc0f304 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: An addressbook for TU Wien # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.3.0 +version: 1.3.1 environment: sdk: ">=2.12.0 <3.0.0"