-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into frem/overlay
- Loading branch information
Showing
1 changed file
with
32 additions
and
3 deletions.
There are no files selected for viewing
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,15 +1,44 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:coffeecard/core/styles/app_colors.dart'; | ||
import 'package:coffeecard/core/widgets/images/analog_logo.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:gap/gap.dart'; | ||
|
||
class SplashLoadingPage extends StatelessWidget { | ||
class SplashLoadingPage extends StatefulWidget { | ||
const SplashLoadingPage(); | ||
|
||
@override | ||
State<SplashLoadingPage> createState() => _SplashLoadingPageState(); | ||
} | ||
|
||
class _SplashLoadingPageState extends State<SplashLoadingPage> { | ||
bool showLoadingIndicator = false; | ||
final timeBeforeShowLoadingIndicator = const Duration(seconds: 3); | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
Timer( | ||
timeBeforeShowLoadingIndicator, | ||
() => setState(() => showLoadingIndicator = true), | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const ColoredBox( | ||
return ColoredBox( | ||
color: AppColors.primary, | ||
child: Center(child: AnalogLogo()), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const AnalogLogo(), | ||
const Gap(32), | ||
CircularProgressIndicator( | ||
color: showLoadingIndicator ? AppColors.white : AppColors.primary, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |