-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
562 additions
and
16 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.
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.
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
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,21 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ItemData { | ||
final Color color; | ||
final String image; | ||
final String title; | ||
final String content; | ||
final TextStyle titleStyle; | ||
final TextStyle contentStyle; | ||
final Color btnColor; | ||
|
||
ItemData( | ||
this.color, | ||
this.image, | ||
this.title, | ||
this.content, | ||
this.contentStyle, | ||
this.titleStyle, | ||
this.btnColor, | ||
); | ||
} |
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,82 @@ | ||
import 'dart:async'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:is_first_run/is_first_run.dart'; | ||
import 'package:multivendor_shop/views/splash/splash.dart'; | ||
import '../../components/loading.dart'; | ||
import '../../constants/colors.dart'; | ||
import '../auth/account_type_selector.dart'; | ||
|
||
class EntryScreen extends StatefulWidget { | ||
static const routeName = '/entry-screen'; | ||
|
||
const EntryScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
State<EntryScreen> createState() => _EntryScreenState(); | ||
} | ||
|
||
class _EntryScreenState extends State<EntryScreen> { | ||
_startRun() async { | ||
bool ifr = await IsFirstRun.isFirstRun(); | ||
var duration = const Duration(seconds: 5); | ||
if (ifr != null && !ifr) { | ||
Timer(duration, _navigateToAuthOrHome); | ||
// Timer(duration, _navigateToSplash); | ||
} else { | ||
Timer(duration, _navigateToSplash); | ||
} | ||
} | ||
|
||
_navigateToSplash() { | ||
// Routing to Splash | ||
Navigator.of(context).pushNamed(SplashScreen.routeName); | ||
} | ||
|
||
_navigateToAuthOrHome() { | ||
//Routing to Account Selection Type or Home | ||
FirebaseAuth.instance.authStateChanges().listen((User? user) { | ||
if (user != null) { | ||
// home screen | ||
Navigator.of(context).pushNamed(''); | ||
} else { | ||
// auth screen | ||
Navigator.of(context).pushNamed(AccountTypeSelector.routeName); | ||
} | ||
}); | ||
} | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
_startRun(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
SystemChrome.setSystemUIOverlayStyle( | ||
SystemUiOverlayStyle( | ||
statusBarColor: Colors.transparent, | ||
systemNavigationBarColor: litePrimary, | ||
statusBarIconBrightness: Brightness.dark, | ||
systemNavigationBarDividerColor: Colors.grey, | ||
statusBarBrightness: Brightness.dark, | ||
), | ||
); | ||
return Scaffold( | ||
body: Container( | ||
constraints: const BoxConstraints.expand(), | ||
color: primaryColor, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Image.asset('assets/images/logo1.png'), | ||
const SizedBox(height: 10), | ||
const Loading(color: Colors.white,kSize: 40,), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.