Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splash Screen Created #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions fuel_ease_app/assets/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions fuel_ease_app/assets/splash_screen_pic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion fuel_ease_app/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -171,6 +171,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -185,6 +186,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
8 changes: 3 additions & 5 deletions fuel_ease_app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fuel_ease_app/screens/splash_screen.dart';

void main() {
runApp(const MyApp());
Expand All @@ -11,15 +12,12 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Scaffold(
body: Center(
child: Text('Sample Home Page'),
),
),
home: Adaptive(),
);
}
}
290 changes: 290 additions & 0 deletions fuel_ease_app/lib/screens/splash_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
// ignore_for_file: prefer_const_constructors, sort_child_properties_last, prefer_const_literals_to_create_immutables

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:fuel_ease_app/widgets/page_swipe.dart';

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

@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: const Size(390, 844),
builder: (context, child) {
return Scaffold(
body: SplashScreen1(),
);
});
}
}

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

@override
State<SplashScreen1> createState() => _SplashScreen1State();
}

class _SplashScreen1State extends State<SplashScreen1> {
final PageController _pageController = PageController(initialPage: 0);
int _currentIndex = 0;
@override
Widget build(BuildContext context) {
return SafeArea(
child: Stack(
children: [
PageView(
controller: _pageController,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Container()),
Container(
padding: EdgeInsets.fromLTRB(0, 10.w, 25.w, 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.r),
),
child: SizedBox(
height: 19.h,
width: 55.w,
child: ElevatedButton(
child: Text(
'Skip',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
color: Color.fromRGBO(48, 48, 48, 1)),
),
onPressed: () {
_pageController.animateToPage(2,
duration: Duration(milliseconds: 500),
curve: Curves.easeIn);
},
style: ElevatedButton.styleFrom(
backgroundColor:
Color.fromRGBO(255, 96, 125, 0.6),
),
),
),
),
],
),
SizedBox(
height: 31.h,
),
SvgPicture.asset(
'assets/Logo.svg',
height: 60.h,
width: 240.w,
),
SizedBox(
height: 150.h,
),
// SvgPicture.asset(
// 'assets/splash_screen_pic.svg',
// height: 315.h,
// width: 453.w,

Container(
height: 315.h,
width: MediaQuery.of(context).size.width,
child: Image.network(
'https://img.freepik.com/premium-vector/character-filling-car-gas-station-pouring-fuel-into-vehicle-petroleum-refueling-automobile-transport-gasoline-service-drivers-benzene-ring-formula-cartoon-people-vector-illustration_87771-11191.jpg'),
),
SizedBox(
height: 22.h,
),
RichText(
text: TextSpan(
text: 'Welcome to ',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(250, 17, 62, 1)),
children: <TextSpan>[
TextSpan(
text: 'Refuelers!',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(0, 0, 0, 1)),
),
]),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Container()),
Container(
padding: EdgeInsets.fromLTRB(0, 10.w, 25.w, 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.r),
),
child: SizedBox(
height: 19.h,
width: 55.w,
child: ElevatedButton(
child: Text(
'Skip',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
color: Color.fromRGBO(48, 48, 48, 1)),
),
onPressed: () {
_pageController.animateToPage(2,
duration: Duration(milliseconds: 250),
curve: Curves.easeIn);
},
style: ElevatedButton.styleFrom(
backgroundColor:
Color.fromRGBO(255, 96, 125, 0.6),
),
),
),
),
],
),
SizedBox(
height: 31.h,
),
SvgPicture.asset(
'assets/Logo.svg',
height: 60.h,
width: 240.w,
),
SizedBox(
height: 150.h,
),
Container(
height: 315.h,
width: MediaQuery.of(context).size.width,
child: Image.network(
'https://img.freepik.com/premium-vector/character-filling-car-gas-station-pouring-fuel-into-vehicle-petroleum-refueling-automobile-transport-gasoline-service-drivers-benzene-ring-formula-cartoon-people-vector-illustration_87771-11191.jpg'),
),
SizedBox(
height: 22.h,
),
RichText(
text: TextSpan(
text: 'Out Of Fuel? ',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(0, 0, 0, 1)),
children: <TextSpan>[
TextSpan(
text: 'No Worries!',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(250, 17, 62, 1)),
),
]),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 30.h,
width: 55.w,
),
SizedBox(
height: 31.h,
),
SvgPicture.asset(
'assets/Logo.svg',
height: 60.h,
width: 240.w,
),
SizedBox(
height: 150.h,
),
Container(
height: 315.h,
width: MediaQuery.of(context).size.width,
child: Image.network(
'https://img.freepik.com/premium-vector/character-filling-car-gas-station-pouring-fuel-into-vehicle-petroleum-refueling-automobile-transport-gasoline-service-drivers-benzene-ring-formula-cartoon-people-vector-illustration_87771-11191.jpg'),
),
SizedBox(
height: 20.h,
),
RichText(
text: TextSpan(
text: 'Login ',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(250, 17, 62, 1)),
children: <TextSpan>[
TextSpan(
text: 'To Enter',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(0, 0, 0, 1)),
),
]),
),
SizedBox(
height: 20.h,
),
GestureDetector(
onTap: () {},
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(48, 48, 48, 1),
borderRadius: BorderRadius.circular(100.r),
),
height: 45.h,
width: 302.w,
child: Center(
child: Text(
'Refuel Now',
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(255, 255, 255, 1)),
),
),
),
),
],
),
],
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(bottom: 23.0),
child: PageSwipe(
currentIndex: _currentIndex,
pageCount: 3,
),
),
),
],
),
);
}
}
58 changes: 58 additions & 0 deletions fuel_ease_app/lib/screens/trial.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// import 'package:flutter/material.dart';

// class SwappableScreen extends StatefulWidget {
// final List<Widget> screens;
// SwappableScreen({Key? key, required this.screens}) : super(key: key);

// @override
// _SwappableScreenState createState() => _SwappableScreenState();
// }

// class _SwappableScreenState extends State<SwappableScreen> {
// late PageController _pageController;
// int _currentPageIndex = 0;

// @override
// void initState() {
// super.initState();
// _pageController = PageController(initialPage: _currentPageIndex);
// }

// @override
// Widget build(BuildContext context) {
// return GestureDetector(
// onHorizontalDragEnd: (details) {
// // Check if swipe direction is right to left or left to right
// if (details.velocity.pixelsPerSecond.dx > 0) {
// // Swipe from left to right
// if (_currentPageIndex > 0) {
// setState(() {
// _currentPageIndex--;
// });
// _pageController.animateToPage(
// _currentPageIndex,
// duration: Duration(milliseconds: 300),
// curve: Curves.easeInOut,
// );
// }
// } else {
// // Swipe from right to left
// if (_currentPageIndex < widget.screens.length - 1) {
// setState(() {
// _currentPageIndex++;
// });
// _pageController.animateToPage(
// _currentPageIndex,
// duration: Duration(milliseconds: 300),
// curve: Curves.easeInOut,
// );
// }
// }
// },
// child: PageView(
// controller: _pageController,
// children: widget.screens,
// ),
// );
// }
// }
Loading