From e8c15aad21a9db79f4a83082a29e94daa86a8234 Mon Sep 17 00:00:00 2001 From: Saisriram Gunturu Date: Sun, 24 Mar 2024 15:52:08 -0400 Subject: [PATCH] fixed a couple more dynamic sizing --- bu_passport/lib/components/event_widget.dart | 9 +++++++-- bu_passport/lib/pages/signup_page.dart | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bu_passport/lib/components/event_widget.dart b/bu_passport/lib/components/event_widget.dart index 1ee8a49..b2bbd07 100644 --- a/bu_passport/lib/components/event_widget.dart +++ b/bu_passport/lib/components/event_widget.dart @@ -13,6 +13,11 @@ class EventWidget extends StatefulWidget { class _EventWidgetState extends State { @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + + double sizedBoxHeight = (MediaQuery.of(context).size.height * 0.02); + double edgeInsets = (MediaQuery.of(context).size.width * 0.02); return GestureDetector( onTap: () { // Navigate to the event page @@ -24,7 +29,7 @@ class _EventWidgetState extends State { ); }, child: Container( - padding: EdgeInsets.all(16.0), + padding: EdgeInsets.all(edgeInsets), child: Stack( children: [ // Background image @@ -49,7 +54,7 @@ class _EventWidgetState extends State { color: Colors.white, // Text color on top of the image ), ), - SizedBox(height: 8.0), + SizedBox(height: sizedBoxHeight), Text( '${widget.event.eventLocation}', style: TextStyle(fontSize: 16.0, color: Colors.white), diff --git a/bu_passport/lib/pages/signup_page.dart b/bu_passport/lib/pages/signup_page.dart index 63718d5..5668ca6 100644 --- a/bu_passport/lib/pages/signup_page.dart +++ b/bu_passport/lib/pages/signup_page.dart @@ -50,14 +50,14 @@ class _SignUpPageState extends State { labelText: 'Last Name', ), ), - SizedBox(height: 20), + SizedBox(height: sizedBoxHeight), TextField( controller: _emailController, decoration: const InputDecoration( labelText: 'Email', ), ), - SizedBox(height: 20), + SizedBox(height: sizedBoxHeight), TextField( controller: _buIDController, decoration: const InputDecoration(