Skip to content

Commit

Permalink
Merge branch 'develop' into frem/overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
fremartini authored Sep 28, 2023
2 parents 98edc13 + ad17be8 commit 881e212
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions lib/core/widgets/pages/splash/splash_loading_page.dart
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,
),
],
),
);
}
}

0 comments on commit 881e212

Please sign in to comment.