From 138dc3537321fef99969c504b796a8d564b0b4b2 Mon Sep 17 00:00:00 2001 From: vedang8 Date: Tue, 3 Oct 2023 00:30:15 +0530 Subject: [PATCH] I have made the loading component and have done the necessary changes for styling --- lib/Screens/splace_screen.dart | 80 +++++++++++++++++++--------------- pubspec.lock | 16 +++---- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/lib/Screens/splace_screen.dart b/lib/Screens/splace_screen.dart index 766ba2f..5276f38 100644 --- a/lib/Screens/splace_screen.dart +++ b/lib/Screens/splace_screen.dart @@ -13,6 +13,8 @@ class SplaceScreen extends StatefulWidget { } class _SplaceScreenState extends State { + bool isLoading = true; // making a loading variable + @override void initState() { super.initState(); @@ -24,47 +26,57 @@ class _SplaceScreenState extends State { SizeConfig().init(context); return Scaffold( backgroundColor: Color.fromRGBO(241, 243, 244, 1), - body: Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/LOGO.png', - width: 130, - height: 130, - ), - SizedBox( - height: 30, - ), - Text( - 'DU Hacks', - style: kRalewayMedium.copyWith( - fontSize: SizeConfig.blockSizeHorizontal! * 5, - color: kBlue), - ), - SizedBox( - height: 5, + body: Stack( + alignment: Alignment.center, + children: [ + Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Your app's logo or splash image + Image.asset( + 'assets/images/LOGO.png', + width: 150, // Adjust the size to your preference + height: 150, + ), + SizedBox(height: 30), + Text( + 'DU Hacks', + style: TextStyle( + fontSize: 36, // Adjust the font size + fontWeight: FontWeight.bold, + color: Colors.blue, // Use a professional color + ), + ), + SizedBox(height: 10), + Text( + 'Get your creative hats on and join us on this\nincredible ride to build something out of the box.', + style: TextStyle( + fontSize: 16, // Adjust the font size + color: Colors.grey, // Use a neutral color + ), + textAlign: TextAlign.center, + ), + SizedBox(height: 50), + ], ), - Text( - 'Get your creative hats on and join us on this\n incredible ride to build something out of the box.', - style: kRalewayMedium.copyWith( - fontSize: SizeConfig.blockSizeHorizontal! * 3, - ), - textAlign: TextAlign.center, - ), - SizedBox( - height: 50, - ), - ], + ), ), - ), + if (isLoading) + CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation(Colors.blue), + ), + ], ), ); } void timer(BuildContext context) { Timer(const Duration(seconds: 3), () { + setState(() { + isLoading = false; // after 3s, it must stop + }); Navigator.pushReplacement( context, MaterialPageRoute( @@ -73,4 +85,4 @@ class _SplaceScreenState extends State { ); }); } -} +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 2ec4ad9..3979aba 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" crypto: dependency: transitive description: @@ -244,18 +244,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -276,10 +276,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" typed_data: dependency: transitive description: