-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from LiquidGalaxyLAB/development
PR2: Version 0.1
- Loading branch information
Showing
15 changed files
with
553 additions
and
210 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'dart:async'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:lg_space_visualizations/utils/styles.dart'; | ||
import 'package:lg_space_visualizations/widget/logo.dart'; | ||
|
||
/// A widget that represents the splash screen of the app. | ||
/// | ||
/// It displays the logos and a loading indicator at the bottom. | ||
/// When initialized, it waits for 5 seconds before navigating to the home page.s | ||
class SplashPage extends StatefulWidget { | ||
const SplashPage({super.key}); | ||
|
||
@override | ||
_SplashPageState createState() => _SplashPageState(); | ||
} | ||
|
||
class _SplashPageState extends State<SplashPage> { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
|
||
// Timer to navigate to the home page after 5 seconds. | ||
Timer(const Duration(seconds: 5), () { | ||
Navigator.of(context).pushReplacementNamed('/home'); | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: secondaryColor, | ||
body: Center( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
const SizedBox(height: 20), | ||
const Logo(), | ||
Expanded( | ||
child: | ||
Image.asset('assets/images/logos.png', fit: BoxFit.contain), | ||
), | ||
SizedBox( | ||
height: 4, | ||
child: LinearProgressIndicator( | ||
color: backgroundColor, | ||
backgroundColor: secondaryColor, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:lg_space_visualizations/pages/home_page.dart'; | ||
import 'package:lg_space_visualizations/pages/splash_screen.dart'; | ||
|
||
/// Generates a [Route] for the application based on the provided [RouteSettings]. | ||
/// | ||
/// This function takes [settings] as a parameter, which contains the name of | ||
/// the route to be generated. It returns a [Route] corresponding to the route | ||
/// name. If the route name is not recognized, it defaults to the home page. | ||
Route<dynamic> makeRoute(RouteSettings settings) { | ||
WidgetBuilder builder; | ||
switch (settings.name) { | ||
case '/': | ||
return customRoute(const HomePage()); | ||
case '/home': | ||
// Route for the home page. | ||
builder = (BuildContext context) => const HomePage(); | ||
break; | ||
case '/splash': | ||
// Route for the splash screen. | ||
builder = (BuildContext context) => const SplashPage(); | ||
break; | ||
default: | ||
throw 'Route is not defined'; | ||
// Default route if no match is found, redirects to the home page. | ||
builder = (BuildContext context) => const HomePage(); | ||
} | ||
// Return a custom route with a very short transition animation. | ||
return AnimationPageRoute(builder: builder, settings: settings); | ||
} | ||
|
||
PageRouteBuilder customRoute(Widget page) { | ||
return PageRouteBuilder( | ||
pageBuilder: (context, animation1, animation2) => page, | ||
transitionDuration: const Duration(milliseconds: 500), | ||
transitionsBuilder: (context, animation, animation2, child) { | ||
return FadeTransition(opacity: animation, child: child); | ||
}, | ||
); | ||
/// A custom [MaterialPageRoute] that disables transition animations but keeps a transition duration of 10 ms. | ||
class AnimationPageRoute<T> extends MaterialPageRoute<T> { | ||
AnimationPageRoute({required super.builder, super.settings}); | ||
|
||
@override | ||
Duration get transitionDuration => const Duration(milliseconds: 10); | ||
|
||
@override | ||
Widget buildTransitions(BuildContext context, Animation<double> animation, | ||
Animation<double> secondaryAnimation, Widget child) { | ||
// Return the child widget without any transition animations. | ||
return child; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,56 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
// Dimensions | ||
/// Dimensions used in the application. | ||
double borderRadius = 10.0; | ||
double barHeight = 60.0; | ||
double barWidth = 1366.0; | ||
|
||
// Colors | ||
/// Colors used throughout in the application. | ||
Color primaryColor = const Color(0xFF000000); | ||
Color secondaryColor = const Color(0xFF281F5E); | ||
Color backgroundColor = const Color(0xFFD9D9D9); | ||
Color grey = const Color(0xFFA7A7A7); | ||
// Extra | ||
|
||
/// Spacing used between widgets. | ||
double spaceBetweenWidgets = 20.0; | ||
|
||
// Text styles | ||
TextStyle hugeTitle = TextStyle(color: backgroundColor, fontWeight: FontWeight.bold, fontSize: 80); | ||
TextStyle bigTitle = TextStyle(color: primaryColor, fontWeight: FontWeight.bold, fontSize: 40); | ||
TextStyle middleTitle = TextStyle(color: primaryColor, fontWeight: FontWeight.bold, fontSize: 30); | ||
/// Text styles used in the application. | ||
TextStyle hugeTitle = TextStyle( | ||
color: backgroundColor, | ||
fontWeight: FontWeight.bold, | ||
fontSize: 80, | ||
); | ||
|
||
TextStyle bigTitle = TextStyle( | ||
color: primaryColor, | ||
fontWeight: FontWeight.bold, | ||
fontSize: 40, | ||
); | ||
|
||
TextStyle middleTitle = TextStyle( | ||
color: primaryColor, | ||
fontWeight: FontWeight.bold, | ||
fontSize: 30, | ||
); | ||
|
||
TextStyle bigText = TextStyle( | ||
color: primaryColor, | ||
fontSize: 25, | ||
); | ||
|
||
TextStyle middleText = TextStyle( | ||
color: primaryColor, | ||
fontSize: 20, | ||
); | ||
|
||
TextStyle bigText = TextStyle(color: primaryColor, fontSize: 25); | ||
TextStyle middleText = TextStyle(color: primaryColor, fontSize: 20); | ||
TextStyle buttonText = TextStyle( | ||
color: backgroundColor, | ||
fontSize: 20, | ||
); | ||
|
||
TextStyle buttonText = TextStyle(color: backgroundColor, fontSize: 20); | ||
TextStyle buttonTextBold = TextStyle(color: backgroundColor, fontWeight: FontWeight.bold, height: 1.2, fontSize: 40); | ||
TextStyle buttonTextBold = TextStyle( | ||
color: backgroundColor, | ||
fontWeight: FontWeight.bold, | ||
height: 1.2, | ||
fontSize: 40, | ||
); |
Oops, something went wrong.