Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
Tour Travel Agency AGR
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
Dio Maulana
Tour Travel Agency AGR
Commits
2a690716
Commit
2a690716
authored
Jun 12, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
easy loading init
parent
f2b2433e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
main.dart
lib/main.dart
+29
-0
No files found.
lib/main.dart
View file @
2a690716
import
'package:flutter/material.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'package:package_info_plus/package_info_plus.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:tour_travel_agr/helper/prefs.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
import
'package:url_strategy/url_strategy.dart'
;
late
SharedPreferences
prefs
;
bool
debug
=
true
;
String
titleApp
=
'Tour & Travel Agency'
;
String
baseUrl
=
"https://hibiscus-dev.ravku.com/"
;
String
endPoint
=
"agency/api/"
;
String
initialRoute
=
Routes
.
splashRoute
;
void
main
(
)
{
WidgetsFlutterBinding
.
ensureInitialized
();
setPathUrlStrategy
();
configLoading
();
SharedPreferences
.
getInstance
().
then
(
(
value
)
{
prefs
=
value
;
...
...
@@ -18,11 +26,31 @@ void main() {
initialRoute
=
"
${Routes.resetPasswordRoute}
/
${pathUri[1]}
"
;
}
}
PackageInfo
.
fromPlatform
().
then
((
packageInfo
)
{
setAppVersion
(
packageInfo
.
version
.
toString
());
});
runApp
(
const
MyApp
());
},
);
}
//easy loading
void
configLoading
(
)
{
EasyLoading
.
instance
..
displayDuration
=
const
Duration
(
milliseconds:
2000
)
..
indicatorType
=
EasyLoadingIndicatorType
.
fadingCircle
..
loadingStyle
=
EasyLoadingStyle
.
dark
..
indicatorSize
=
45.0
..
radius
=
10.0
..
progressColor
=
Colors
.
yellow
..
backgroundColor
=
Colors
.
green
..
indicatorColor
=
Colors
.
yellow
..
textColor
=
Colors
.
yellow
..
maskColor
=
Colors
.
blue
.
withOpacity
(
0.5
)
..
userInteractions
=
true
..
dismissOnTap
=
false
;
}
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
super
.
key
});
...
...
@@ -34,6 +62,7 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner:
false
,
onGenerateRoute:
RouteGenerator
.
getRoute
,
initialRoute:
initialRoute
,
builder:
EasyLoading
.
init
(),
);
}
}
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