From 643315362a73e03efa74bfff4f303ff80ab6afc5 Mon Sep 17 00:00:00 2001 From: 3TTemi Date: Wed, 1 May 2024 18:01:12 -0400 Subject: [PATCH] Header updates to pages --- game/lib/achievements/achievements_page.dart | 29 +++++++++++++-- .../global_leaderboard_widget.dart | 5 +-- game/lib/profile/completed_feed.dart | 36 +++++++++++-------- game/lib/profile/settings_page.dart | 36 ++++++++++++------- 4 files changed, 75 insertions(+), 31 deletions(-) diff --git a/game/lib/achievements/achievements_page.dart b/game/lib/achievements/achievements_page.dart index 4aeece12..9b34613f 100644 --- a/game/lib/achievements/achievements_page.dart +++ b/game/lib/achievements/achievements_page.dart @@ -49,9 +49,15 @@ class _AchievementsPageState extends State { List selectedCategories = []; List selectedLocations = []; String selectedDifficulty = ''; - @override Widget build(BuildContext context) { + var headerStyle = TextStyle( + color: Color(0xFFFFF8F1), + fontSize: 20, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ); + return Container( decoration: BoxDecoration( color: Color(0xFFED5656), @@ -60,7 +66,26 @@ class _AchievementsPageState extends State { bottom: false, child: Scaffold( appBar: AppBar( - title: const Text('Achievements'), + backgroundColor: Color.fromARGB(255, 237, 86, 86), + toolbarHeight: MediaQuery.of(context).size.height * 0.1, + leading: Align( + alignment: Alignment.center, + child: IconButton( + icon: Icon(Icons.navigate_before), + color: Colors.white, + onPressed: () => Navigator.pop(context), + ), + ), + title: Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.01), + child: Text( + 'Achievements', + style: headerStyle, + ), + ), + centerTitle: true, // Still useful for horizontal centering + actions: [], ), body: Container( width: double.infinity, diff --git a/game/lib/global_leaderboard/global_leaderboard_widget.dart b/game/lib/global_leaderboard/global_leaderboard_widget.dart index 3f4c1b5c..f2b84fd3 100644 --- a/game/lib/global_leaderboard/global_leaderboard_widget.dart +++ b/game/lib/global_leaderboard/global_leaderboard_widget.dart @@ -44,12 +44,13 @@ class _GlobalLeaderboardWidgetState extends State { key: scaffoldKey, backgroundColor: Color.fromARGB(255, 255, 248, 241), appBar: AppBar( - toolbarHeight: 85, + toolbarHeight: MediaQuery.sizeOf(context).height * 0.1, automaticallyImplyLeading: false, backgroundColor: Color.fromARGB(255, 237, 86, 86), flexibleSpace: FlexibleSpaceBar( title: Padding( - padding: const EdgeInsets.only(bottom: 8), + padding: EdgeInsets.only( + bottom: MediaQuery.sizeOf(context).height * 0.01), child: Text( 'Leaderboard', style: leaderboardStyle, diff --git a/game/lib/profile/completed_feed.dart b/game/lib/profile/completed_feed.dart index 882f842b..5ecacae9 100644 --- a/game/lib/profile/completed_feed.dart +++ b/game/lib/profile/completed_feed.dart @@ -16,27 +16,35 @@ import 'package:tuple/tuple.dart'; class CompletedFeedWidget extends StatelessWidget { @override Widget build(BuildContext context) { + var headerStyle = TextStyle( + color: Color(0xFFFFF8F1), + fontSize: 20, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ); + return Scaffold( backgroundColor: Color.fromARGB(255, 255, 248, 241), appBar: AppBar( backgroundColor: Color.fromARGB(255, 237, 86, 86), - leading: IconButton( - icon: const Icon(Icons.navigate_before), - color: Colors.white, - onPressed: () { - Navigator.pop( - context, - ); - }, - ), - title: const Text( - 'Completed', - style: TextStyle( + toolbarHeight: MediaQuery.of(context).size.height * 0.1, + leading: Align( + alignment: Alignment.center, + child: IconButton( + icon: Icon(Icons.navigate_before), color: Colors.white, - fontFamily: 'Poppins', - fontWeight: FontWeight.bold, + onPressed: () => Navigator.pop(context), + ), + ), + title: Padding( + padding: + EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.01), + child: Text( + 'Completed', + style: headerStyle, ), ), + centerTitle: true, // Still useful for horizontal centering actions: [], ), body: Consumer4( diff --git a/game/lib/profile/settings_page.dart b/game/lib/profile/settings_page.dart index 098ff33b..e6da3fa2 100644 --- a/game/lib/profile/settings_page.dart +++ b/game/lib/profile/settings_page.dart @@ -13,25 +13,35 @@ class SettingsPage extends StatelessWidget { @override Widget build(BuildContext context) { + var headerStyle = TextStyle( + color: Color(0xFFFFF8F1), + fontSize: 20, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ); + return Scaffold( backgroundColor: Color.fromARGB(255, 255, 248, 241), appBar: AppBar( backgroundColor: Color.fromARGB(255, 237, 86, 86), - // Set widget before appBar title - leading: IconButton( - icon: const Icon(Icons.navigate_before), - color: Colors.white, - onPressed: () { - Navigator.pop(context); - }, + toolbarHeight: MediaQuery.of(context).size.height * 0.1, + leading: Align( + alignment: Alignment.center, + child: IconButton( + icon: Icon(Icons.navigate_before), + color: Colors.white, + onPressed: () => Navigator.pop(context), + ), ), - title: const Text( - 'Settings', - style: TextStyle( - color: Colors.white, - fontFamily: 'Poppins', - fontWeight: FontWeight.bold), + title: Padding( + padding: + EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.01), + child: Text( + 'Settings', + style: headerStyle, + ), ), + centerTitle: true, // Still useful for horizontal centering actions: [], ), body: Center(child: LayoutBuilder(