Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 123 additions & 83 deletions lib/presentation/intro/pages/get_started.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,104 +4,144 @@
* @ Message: 🎯 Happy coding and Have a nice day! 🌤️
*/

import 'dart:async';

import 'package:cinema_booking/common/widgets/footer/footer_section.dart';
import 'package:flutter/material.dart';
import 'package:cinema_booking/common/helpers/is_dark_mode.dart';
import 'package:cinema_booking/common/widgets/button/basic_app_button.dart';
import 'package:cinema_booking/core/configs/assets/app_images.dart';
import 'package:cinema_booking/core/configs/theme/app_color.dart';
import 'package:cinema_booking/presentation/choose_mode/pages/choose_mode.dart';

class GetStartedPage extends StatelessWidget {
class GetStartedPage extends StatefulWidget {
const GetStartedPage({super.key});

@override
State<GetStartedPage> createState() => _GetStartedPageState();
}

class _GetStartedPageState extends State<GetStartedPage> {
double _progress = 0;

@override
void initState() {
super.initState();
redirect();
}

Future<void> redirect() async {
Timer.periodic(const Duration(milliseconds: 200), (timer) {
setState(() {
_progress += 0.1;
if (_progress >= 2 && mounted) {
timer.cancel();
// TODO: need change to Router
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) => const GetStartedPage(),
// ),
// );
}
});
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
//
// TODO: Case use BackGround
//
// Container(
// padding: const EdgeInsets.symmetric(
// horizontal: 40,
// vertical: 50,
// ),
// decoration: const BoxDecoration(
// image: DecorationImage(
// fit: BoxFit.cover,
// image: AssetImage(
// AppImages.introBG,
// ),
// ),
// ),
// // child:
// ),
// Container(
// color: context.isDarkMode ? AppColors.dark : AppColors.white,
// ),
//
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 35.0),
child: Stack(
children: [
_loadingBar(),
_logoWidget(),
_ourGoal(),
_bar(),
FooterSection(),
],
),
),
);
}

Padding(
padding: const EdgeInsets.symmetric(vertical: 50.0, horizontal: 40.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(
height: 100,
),
Align(
alignment: Alignment.center,
child: Image.asset(
context.isDarkMode ? AppImages.logo : AppImages.logo,
),
),
// const Spacer(),
const SizedBox(
height: 25,
),
Text(
'Flutter Journey',
style: TextStyle(
fontWeight: FontWeight.w900,
color: context.isDarkMode ? AppColors.white : AppColors.darkBackground,
fontSize: 32,
),
),
const SizedBox(
height: 25,
),
Text(
'Our goal is to share our knowledge through helpful project, create a positive open source community '
'that helps developers improve their Flutter skills. We focus on clear, achievable tasks '
'and encourage learning by doing',
style: TextStyle(
fontWeight: FontWeight.w500,
color: context.isDarkMode ? AppColors.greyTitle : AppColors.darkBackground,
fontSize: 16,
),
textAlign: TextAlign.center,
),
// const SizedBox(
// height: 100,
// ),
// BasicAppButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) => const ChooseModePage(),
// ),
// );
// },
// title: "Get Start",
// ),
],
Widget _logoWidget() {
return Align(
alignment: Alignment(0, -0.6),
child: Image.asset(
AppImages.logo,
),
);
}

Widget _ourGoal() {
return Align(
alignment: Alignment(0, 0.5),
child: Column(
mainAxisSize: MainAxisSize.min,
spacing: 25,
children: [
Text(
'Cinema Booking',
style: TextStyle(
fontWeight: FontWeight.w900,
color: context.isDarkMode ? AppColors.white : AppColors.darkBackground,
fontSize: 32,
),
),
Text(
'Our goal is to simplify the process of finding and booking movie tickets across all cinemas in Hanoi. '
'We aim to create a seamless and user-friendly platform that enhances the movie-going experience, '
'connecting users with the best options effortlessly.',
style: TextStyle(
fontWeight: FontWeight.w500,
color: context.isDarkMode ? AppColors.greyTitle : AppColors.darkBackground,
fontSize: 16,
),
textAlign: TextAlign.center,
),
],
),
);
}

Widget _loadingBar() {
return Align(
alignment: const Alignment(-0.85, -0.82),
child: Container(
width: MediaQuery.of(context).size.width * 0.2,
height: 10,
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(20),
),
child: Stack(
children: [
AnimatedContainer(
duration: const Duration(milliseconds: 200),
width: MediaQuery.of(context).size.width * 0.1 * _progress,
height: 10,
decoration: BoxDecoration(
color: AppColors.defaultColor,
borderRadius: BorderRadius.circular(20),
),
),
],
),
),
);
}

Widget _bar() {
return Align(
alignment: Alignment(0, 0.7),
child: Container(
width: MediaQuery.of(context).size.width * 0.6,
height: 3,
decoration: BoxDecoration(
color: AppColors.greyTitle,
borderRadius: BorderRadius.circular(10),
),
),
);
}
}
2 changes: 1 addition & 1 deletion lib/presentation/splash/pages/splash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import 'dart:async';
import 'package:cinema_booking/core/configs/theme/app_color.dart';
import 'package:cinema_booking/presentation/intro/pages/get_started.dart';
import 'package:cinema_booking/presentation/splash/widgets/footer_section.dart';
import 'package:cinema_booking/common/widgets/footer/footer_section.dart';
import 'package:flutter/material.dart';
import 'package:cinema_booking/core/configs/assets/app_images.dart';

Expand Down