Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dolan SelfService Topup
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Faizol
Dolan SelfService Topup
Commits
7f183f40
Commit
7f183f40
authored
May 05, 2023
by
Izol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust splash screen
parent
5f80d00b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
87 deletions
+76
-87
splash_page.dart
lib/ui/pages/splash_page.dart
+76
-87
No files found.
lib/ui/pages/splash_page.dart
View file @
7f183f40
...
@@ -57,88 +57,76 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin{
...
@@ -57,88 +57,76 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin{
curve:
Curves
.
easeIn
curve:
Curves
.
easeIn
);
);
void
navigationToGetOutlet
()
{
Navigator
.
of
(
context
)
@override
.
restorablePopAndPushNamed
(
'/set-merchant'
,
arguments:
kIsTap
);
void
initState
()
{
super
.
initState
();
checkPermissionAndStartService
();
}
}
void
navigationToAktivation
()
{
void
checkPermissionAndStartService
()
async
{
// Navigator.of(context).pushReplacementNamed('/tap-card-aktivasi');
var
storageStatus
=
await
Permission
.
storage
.
request
();
Navigator
.
pushReplacement
(
var
phoneStatus
=
await
Permission
.
phone
.
request
();
context
,
MaterialPageRoute
(
while
(!(
storageStatus
.
isGranted
&&
phoneStatus
.
isGranted
))
{
builder:
(
BuildContext
context
)
=>
bool
shouldRequestStorage
=
storageStatus
.
isDenied
||
storageStatus
.
isPermanentlyDenied
;
const
TapCardAktivasi
(
isTap:
true
)));
bool
shouldRequestPhone
=
phoneStatus
.
isDenied
||
phoneStatus
.
isPermanentlyDenied
;
if
(
shouldRequestStorage
)
{
storageStatus
=
await
Permission
.
storage
.
request
();
}
if
(
shouldRequestPhone
)
{
phoneStatus
=
await
Permission
.
phone
.
request
();
}
if
(!(
shouldRequestStorage
||
shouldRequestPhone
))
{
// Handle the case when user declines the permission request permanently
break
;
}
}
if
(
storageStatus
.
isGranted
&&
phoneStatus
.
isGranted
)
{
await
initService
();
checkActivationAfterDelay
();
}
else
{
// Handle the case when user declines the permission request
}
}
}
Future
<
void
>
initService
()
async
{
await
StartService
.
initLibrary
();
}
void
checkActivationAfterDelay
()
{
Future
.
delayed
(
Duration
(
seconds:
3
),
()
{
checkActivation
();
});
}
void
navigationToSetConfig
()
{
void
navigationToSetConfig
()
{
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
BuildContext
context
)
=>
builder:
(
BuildContext
context
)
=>
const
SetMerchant
(
isConfig:
true
)));
const
SetMerchant
(
isConfig:
true
)));
}
}
@override
void
navigationToGetOutlet
()
{
void
initState
()
{
Navigator
.
of
(
context
)
super
.
initState
();
.
restorablePopAndPushNamed
(
'/set-merchant'
,
arguments:
kIsTap
);
permissionState
();
}
}
void
permissionState
()
async
{
void
navigationToAktivation
()
{
if
(
await
Permission
.
storage
.
request
().
isGranted
&&
Navigator
.
pushReplacement
(
await
Permission
.
phone
.
request
().
isGranted
)
{
context
,
StartService
.
initLibrary
().
then
((
value
)
{
MaterialPageRoute
(
Future
.
delayed
(
Duration
(
seconds:
3
),
()
{
builder:
(
BuildContext
context
)
=>
checkAktivation
();
const
TapCardAktivasi
(
isTap:
true
)));
});
});
// Future.delayed(Duration(seconds: 10), () {
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// title: Text("Error"),
// content: Text("The app is taking too long to start. Please try again."),
// actions: <Widget>[
// TextButton(
// child: Text("Try Again"),
// onPressed: () {
// Navigator.of(context).pop();
// permissionState();
// },
// ),
// TextButton(
// child: Text("Cancel"),
// onPressed: () {
// Navigator.of(context).pop();
// },
// ),
// ],
// );
// },
// );
// });
}
// You can request multiple permissions at once.
Map
<
Permission
,
PermissionStatus
>
statuses
=
await
[
Permission
.
phone
,
Permission
.
storage
,
].
request
();
print
(
"phone :
${statuses[Permission.phone]}
"
);
print
(
"storage :
${statuses[Permission.storage]}
"
);
}
}
void
checkA
k
tivation
()
{
void
checkA
c
tivation
()
{
bool
isDoneConfig
=
PreferencesHelper
.
getBool
(
kIsDoneConfig
);
bool
isDoneConfig
=
PreferencesHelper
.
getBool
(
kIsDoneConfig
);
bool
isTapConfig
=
PreferencesHelper
.
getBool
(
kIsTap
);
bool
isTapConfig
=
PreferencesHelper
.
getBool
(
kIsTap
);
// bool isHashOutlet = PreferencesHelper.getBool(kTap);
// bool isHashOutlet = PreferencesHelper.getString('multioutletname',"false") ;
print
(
'ini pesan:
$isDoneConfig
'
);
print
(
"ini pesan
$isTapConfig
"
);
if
(
isDoneConfig
)
{
if
(
isDoneConfig
)
{
if
(
isTapConfig
&&
isDoneConfig
)
{
if
(
isTapConfig
&&
isDoneConfig
)
{
...
@@ -151,41 +139,42 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin{
...
@@ -151,41 +139,42 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin{
}
}
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
backgroundColor:
lightBackgroundColor
,
backgroundColor:
lightBackgroundColor
,
body:
Center
(
body:
Center
(
child:
Stack
(
child:
Stack
(
children:
[
children:
[
FadeTransition
(
FadeTransition
(
opacity:
_animation
,
opacity:
_animation
,
child:
Center
(
child:
Center
(
child:
Container
(
child:
Container
(
width:
300
,
width:
300
,
height:
300
,
height:
300
,
decoration:
const
BoxDecoration
(
decoration:
const
BoxDecoration
(
image:
DecorationImage
(
image:
DecorationImage
(
image:
AssetImage
(
image:
AssetImage
(
'assets/logo.png'
,
'assets/logo.png'
,
),
),
),
),
),
// child: Text(
// 'UNDER MAINTENANCE',
// style: blackTextStyle.copyWith(
// fontSize: 30,
// fontWeight: semiBold,
// ),
// ),
),
),
// child: Text(
// 'UNDER MAINTENANCE',
// style: blackTextStyle.copyWith(
// fontSize: 30,
// fontWeight: semiBold,
// ),
// ),
),
),
),
),
),
]
]
),
),
),
),
);
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment