Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
B
Byodv2
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
Byodv2
Commits
1296ca98
Commit
1296ca98
authored
Oct 03, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
41f23cb1
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
411 additions
and
171 deletions
+411
-171
config.json
assets/config.json
+1
-1
api.dart
lib/api/api.dart
+15
-12
helper.dart
lib/helper/helper.dart
+8
-0
prefs.dart
lib/helper/prefs.dart
+45
-0
main.dart
lib/main.dart
+183
-124
bill.dart
lib/models/bill.dart
+1
-1
no_route.dart
lib/ui/no_route.dart
+53
-8
splash.dart
lib/ui/splash.dart
+54
-23
app_bar.dart
lib/ui/viewbill/app_bar.dart
+2
-2
GeneratedPluginRegistrant.swift
macos/Flutter/GeneratedPluginRegistrant.swift
+2
-0
pubspec.lock
pubspec.lock
+42
-0
pubspec.yaml
pubspec.yaml
+1
-0
generated_plugin_registrant.cc
windows/flutter/generated_plugin_registrant.cc
+3
-0
generated_plugins.cmake
windows/flutter/generated_plugins.cmake
+1
-0
No files found.
assets/config.json
View file @
1296ca98
{
{
"base_url"
:
"https://
neo.ravku.com
/"
,
"base_url"
:
"https://
58a4-125-165-98-228.ap.ngrok.io
/"
,
"title"
:
"Ravintola Dev BYOD"
,
"title"
:
"Ravintola Dev BYOD"
,
"isResponsive"
:
true
,
"isResponsive"
:
true
,
"debug"
:
true
"debug"
:
true
...
...
lib/api/api.dart
View file @
1296ca98
...
@@ -47,7 +47,8 @@ class Api {
...
@@ -47,7 +47,8 @@ class Api {
String
role
,
String
cashierName
,
String
orderId
)
async
{
String
role
,
String
cashierName
,
String
orderId
)
async
{
String
baseUrl
=
getBaseUrl
();
String
baseUrl
=
getBaseUrl
();
String
apiUrl
=
'
$baseUrl${endPoint}
get_branch'
;
String
apiUrl
=
'
$baseUrl${endPoint}
get_branch'
;
String
latitude
=
getLatitude
();
String
longitude
=
getLongitude
();
String
currentSessionId
=
getSessionId
();
String
currentSessionId
=
getSessionId
();
const
uuidInit
=
Uuid
();
const
uuidInit
=
Uuid
();
var
uuid
=
uuidInit
.
v4
();
var
uuid
=
uuidInit
.
v4
();
...
@@ -65,7 +66,10 @@ class Api {
...
@@ -65,7 +66,10 @@ class Api {
"cashier_name"
:
cashierName
,
"cashier_name"
:
cashierName
,
"order_id"
:
orderId
,
"order_id"
:
orderId
,
"session_id"
:
sessionId
,
"session_id"
:
sessionId
,
"from"
:
fromByod
"from"
:
fromByod
,
"url_lookup"
:
'https://dimas.com'
,
"customer_lat"
:
latitude
,
"customer_long"
:
longitude
,
};
};
var
bodies
=
json
.
encode
(
data
);
var
bodies
=
json
.
encode
(
data
);
// var apiResult = await http.post(Uri.parse(apiUrl), body: bodies);
// var apiResult = await http.post(Uri.parse(apiUrl), body: bodies);
...
@@ -102,14 +106,12 @@ class Api {
...
@@ -102,14 +106,12 @@ class Api {
setListHistory
(
listHistory
);
setListHistory
(
listHistory
);
}
}
setOrderId
(
jsonObject
[
'data'
][
'order_id'
]);
setOrderId
(
jsonObject
[
'data'
][
'order_id'
]);
// setTableMode(jsonObject['data']['table_mode']);
setLogoUrl
(
jsonObject
[
'data'
][
'logo'
]);
setLogoUrl
(
jsonObject
[
'data'
][
'logo'
]);
setSesssionId
(
jsonObject
[
'data'
][
'session_id'
]);
setSesssionId
(
jsonObject
[
'data'
][
'session_id'
]);
setSecretKey
(
jsonObject
[
'data'
][
'secret_key'
]);
setSecretKey
(
jsonObject
[
'data'
][
'secret_key'
]);
setSessionCounter
(
jsonObject
[
'data'
][
'session_counter'
]);
setSessionCounter
(
jsonObject
[
'data'
][
'session_counter'
]);
//** save sessionID and Table Mode */
setBranch
(
jsonObject
[
'data'
][
'code'
]);
setBrand
(
jsonObject
[
'data'
][
'brand_code'
]);
// return jsonObject['data']['name'];
return
responseByodBranchExist
;
return
responseByodBranchExist
;
}
else
if
(
jsonObject
[
'status'
]
==
'error'
&&
}
else
if
(
jsonObject
[
'status'
]
==
'error'
&&
(
jsonObject
[
'code'
]
==
'BYOD_ALWAYS_OFF'
||
(
jsonObject
[
'code'
]
==
'BYOD_ALWAYS_OFF'
||
...
@@ -325,8 +327,8 @@ class Api {
...
@@ -325,8 +327,8 @@ class Api {
"session_id"
:
sessionId
,
"session_id"
:
sessionId
,
"count"
:
sessionC
,
"count"
:
sessionC
,
"sign"
:
signString
,
"sign"
:
signString
,
"branch_code"
:
branchCode
,
"branch_code"
:
getBranchPref
()
,
"brand_code"
:
brandCode
,
"brand_code"
:
getBrand
()
,
"role"
:
role
,
"role"
:
role
,
"cashier_name"
:
cashierName
,
"cashier_name"
:
cashierName
,
"secure_token"
:
tokenUser
,
"secure_token"
:
tokenUser
,
...
@@ -803,7 +805,7 @@ class Api {
...
@@ -803,7 +805,7 @@ class Api {
"total"
:
orderDetail
[
d
][
'total'
],
"total"
:
orderDetail
[
d
][
'total'
],
"service"
:
orderDetail
[
d
][
'service'
],
"service"
:
orderDetail
[
d
][
'service'
],
"service_tax"
:
orderDetail
[
d
][
'service_tax'
],
"service_tax"
:
orderDetail
[
d
][
'service_tax'
],
"order_status"
:
orderDetail
[
d
][
'order_
status
'
],
"order_status"
:
orderDetail
[
d
][
'order_
detail_state
'
],
"notes"
:
orderDetail
[
d
][
'notes'
],
"notes"
:
orderDetail
[
d
][
'notes'
],
"image"
:
orderDetail
[
d
][
'image_small'
],
"image"
:
orderDetail
[
d
][
'image_small'
],
"variant"
:
variants
"variant"
:
variants
...
@@ -827,13 +829,14 @@ class Api {
...
@@ -827,13 +829,14 @@ class Api {
"total"
:
orderDetail
[
d
][
'total'
],
"total"
:
orderDetail
[
d
][
'total'
],
"service"
:
orderDetail
[
d
][
'service'
],
"service"
:
orderDetail
[
d
][
'service'
],
"service_tax"
:
orderDetail
[
d
][
'service_tax'
],
"service_tax"
:
orderDetail
[
d
][
'service_tax'
],
"order_status"
:
orderDetail
[
d
][
'order_
status
'
],
"order_status"
:
orderDetail
[
d
][
'order_
detail_state
'
],
"notes"
:
orderDetail
[
d
][
'notes'
],
"notes"
:
orderDetail
[
d
][
'notes'
],
"image"
:
orderDetail
[
d
][
'image_small'
],
"image"
:
orderDetail
[
d
][
'image_small'
],
"variant"
:
variants
"variant"
:
variants
};
};
billDetail
.
add
(
BillDetail
.
createBillDetail
(
z
));
billDetail
.
add
(
BillDetail
.
createBillDetail
(
z
));
int
totalPerCustomer
=
amountParseToInt
(
z
[
'total'
]);
int
totalPerCustomer
=
amountParseToInt
(
z
[
'total'
]);
var
i
=
{
var
i
=
{
"id"
:
jsonObject
[
'data'
][
'id'
],
"id"
:
jsonObject
[
'data'
][
'id'
],
"total"
:
jsonObject
[
'data'
][
'total'
],
"total"
:
jsonObject
[
'data'
][
'total'
],
...
@@ -842,7 +845,7 @@ class Api {
...
@@ -842,7 +845,7 @@ class Api {
"customer_name"
:
orderDetail
[
d
][
'customer_name'
],
"customer_name"
:
orderDetail
[
d
][
'customer_name'
],
"table_status"
:
jsonObject
[
'data'
][
'table_status'
],
"table_status"
:
jsonObject
[
'data'
][
'table_status'
],
"order_status"
:
jsonObject
[
'data'
][
'order_status'
],
"order_status"
:
jsonObject
[
'data'
][
'order_status'
],
"
state"
:
jsonObject
[
'data'
][
'
state'
],
"
order_state"
:
jsonObject
[
'data'
][
'order_
state'
],
"order_detail"
:
billDetail
,
"order_detail"
:
billDetail
,
"payment_list"
:
paymentList
,
"payment_list"
:
paymentList
,
"outstanding"
:
jsonObject
[
'data'
][
'outstanding'
],
"outstanding"
:
jsonObject
[
'data'
][
'outstanding'
],
...
@@ -852,7 +855,7 @@ class Api {
...
@@ -852,7 +855,7 @@ class Api {
"my_self_outstanding"
:
jsonObject
[
'data'
]
"my_self_outstanding"
:
jsonObject
[
'data'
]
[
'my_self_outstanding'
],
[
'my_self_outstanding'
],
"discount_total"
:
jsonObject
[
'data'
][
'discount'
],
"discount_total"
:
jsonObject
[
'data'
][
'discount'
],
"table_number"
:
jsonObject
[
'data'
][
'table_number'
],
"table_number"
:
jsonObject
[
'data'
][
'table_number'
]
??
''
,
"is_feedback"
:
jsonObject
[
'data'
][
'is_feedback'
],
"is_feedback"
:
jsonObject
[
'data'
][
'is_feedback'
],
"doku_minimum_payment"
:
jsonObject
[
'data'
]
"doku_minimum_payment"
:
jsonObject
[
'data'
]
[
'doku_minimum_payment'
],
[
'doku_minimum_payment'
],
...
...
lib/helper/helper.dart
View file @
1296ca98
...
@@ -581,4 +581,12 @@ const int typeMenu = 3;
...
@@ -581,4 +581,12 @@ const int typeMenu = 3;
//** constanta redirect */
//** constanta redirect */
const
String
goBill
=
'go'
;
const
String
goBill
=
'go'
;
//** constanta redirect */
//** constanta redirect */
//** No Route Identification */
String
emptyUri
=
'emptyUri'
;
String
gpsNotActive
=
'gpsDisabled'
;
String
locationPermissinDenied
=
'locationdisabled'
;
String
configError
=
'configError'
;
String
titleError
=
'titleError'
;
//** No Route Identification */
//** END CONSTANT */
//** END CONSTANT */
lib/helper/prefs.dart
View file @
1296ca98
...
@@ -19,6 +19,11 @@ const String _listHistory = 'list_history';
...
@@ -19,6 +19,11 @@ const String _listHistory = 'list_history';
const
String
_logo
=
'logo'
;
const
String
_logo
=
'logo'
;
const
String
_role
=
'role'
;
const
String
_role
=
'role'
;
const
String
_cashierName
=
'cashier_name'
;
const
String
_cashierName
=
'cashier_name'
;
const
String
_urlLookUp
=
'url'
;
const
String
_latitude
=
'lat'
;
const
String
_longitude
=
'long'
;
const
String
_titleWeb
=
'title'
;
const
String
_isDeliveryPickup
=
'is_delivery_pickup'
;
String
getBaseUrl
(
)
{
String
getBaseUrl
(
)
{
return
prefs
.
getString
(
_baseUrl
)
??
''
;
return
prefs
.
getString
(
_baseUrl
)
??
''
;
...
@@ -159,3 +164,43 @@ String getCashierName() {
...
@@ -159,3 +164,43 @@ String getCashierName() {
Future
<
void
>
setCashierName
(
String
value
)
async
{
Future
<
void
>
setCashierName
(
String
value
)
async
{
prefs
.
setString
(
_cashierName
,
value
);
prefs
.
setString
(
_cashierName
,
value
);
}
}
String
getUrlLookUp
(
)
{
return
prefs
.
getString
(
_urlLookUp
)
??
''
;
}
Future
<
void
>
setUrlLookUp
(
String
value
)
async
{
prefs
.
setString
(
_urlLookUp
,
value
);
}
String
getLatitude
(
)
{
return
prefs
.
getString
(
_latitude
)
??
''
;
}
Future
<
void
>
setLatitude
(
String
value
)
async
{
prefs
.
setString
(
_latitude
,
value
);
}
String
getLongitude
(
)
{
return
prefs
.
getString
(
_longitude
)
??
''
;
}
Future
<
void
>
setLongitude
(
String
value
)
async
{
prefs
.
setString
(
_longitude
,
value
);
}
String
getTitleWeb
(
)
{
return
prefs
.
getString
(
_titleWeb
)
??
''
;
}
Future
<
void
>
setTitleWeb
(
String
value
)
async
{
prefs
.
setString
(
_titleWeb
,
value
);
}
bool
getIsDeliveryPickup
(
)
{
return
prefs
.
getBool
(
_isDeliveryPickup
)
??
false
;
}
Future
<
void
>
setIsDeliveryPickup
(
bool
value
)
async
{
prefs
.
setBool
(
_isDeliveryPickup
,
value
);
}
lib/main.dart
View file @
1296ca98
...
@@ -8,7 +8,9 @@ import 'package:byod/bloc/member_info.dart';
...
@@ -8,7 +8,9 @@ import 'package:byod/bloc/member_info.dart';
import
'package:byod/bloc/order_bloc.dart'
;
import
'package:byod/bloc/order_bloc.dart'
;
import
'package:byod/bloc/search_menu.dart'
;
import
'package:byod/bloc/search_menu.dart'
;
import
'package:byod/helper/helper.dart'
;
import
'package:byod/helper/helper.dart'
;
import
'package:byod/helper/logger.dart'
;
import
'package:byod/helper/prefs.dart'
;
import
'package:byod/helper/prefs.dart'
;
import
'package:byod/ui/home/shimmer_menu_new.dart'
;
import
'package:byod/ui/no_route.dart'
;
import
'package:byod/ui/no_route.dart'
;
import
'package:byod/ui/splash.dart'
;
import
'package:byod/ui/splash.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -33,6 +35,7 @@ import 'bloc/search_active.dart';
...
@@ -33,6 +35,7 @@ import 'bloc/search_active.dart';
import
'bloc/search_history.dart'
;
import
'bloc/search_history.dart'
;
import
'bloc/view_bill.dart'
;
import
'bloc/view_bill.dart'
;
import
'package:flutter/services.dart'
as
bundle_root
;
import
'package:flutter/services.dart'
as
bundle_root
;
import
'package:geolocator/geolocator.dart'
;
import
'bloc/voucher_list.dart'
;
import
'bloc/voucher_list.dart'
;
...
@@ -60,13 +63,13 @@ void main() async {
...
@@ -60,13 +63,13 @@ void main() async {
setPathUrlStrategy
();
setPathUrlStrategy
();
WidgetsFlutterBinding
.
ensureInitialized
();
WidgetsFlutterBinding
.
ensureInitialized
();
prefs
=
await
SharedPreferences
.
getInstance
();
prefs
=
await
SharedPreferences
.
getInstance
();
configLoading
();
configLoading
();
loadAssetConfig
().
then
((
value
)
{
loadAssetConfig
().
then
((
title
)
{
setTitleWeb
(
title
);
runApp
(
runApp
(
MyApp
(
MyApp
(
title:
valu
e
,
title:
titl
e
,
),
),
);
);
});
});
...
@@ -109,7 +112,7 @@ Future<String> loadAssetConfig() async {
...
@@ -109,7 +112,7 @@ Future<String> loadAssetConfig() async {
}
}
// ignore: must_be_immutable
// ignore: must_be_immutable
class
MyApp
extends
State
less
Widget
{
class
MyApp
extends
State
ful
Widget
{
// String myUrl, branch, brand, tn, role, cashierName, toViewBill;
// String myUrl, branch, brand, tn, role, cashierName, toViewBill;
String
title
;
String
title
;
MyApp
({
MyApp
({
...
@@ -117,6 +120,38 @@ class MyApp extends StatelessWidget {
...
@@ -117,6 +120,38 @@ class MyApp extends StatelessWidget {
required
this
.
title
,
required
this
.
title
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
@override
State
<
MyApp
>
createState
()
=>
_MyAppState
();
}
class
_MyAppState
extends
State
<
MyApp
>
{
Position
?
_currentPosition
;
bool
?
permissionLocation
;
_getCurrentLocation
()
{
Geolocator
.
checkPermission
().
then
((
value
)
{
if
(
value
!=
LocationPermission
.
denied
)
{
permissionLocation
=
true
;
Geolocator
.
getCurrentPosition
(
desiredAccuracy:
LocationAccuracy
.
best
,
forceAndroidLocationManager:
true
)
.
then
((
Position
position
)
{
setLatitude
(
position
.
latitude
.
toString
());
setLongitude
(
position
.
longitude
.
toString
());
setState
(()
{
_currentPosition
=
position
;
});
}).
catchError
((
e
)
{
if
(
debug
)
{
logd
(
'GET CURRENTLOCATION, MAIN.DART'
,
'ERROR:
$e
'
);
}
});
}
else
{
permissionLocation
=
false
;
}
});
}
// This widget is the root of your application.
// This widget is the root of your application.
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -143,6 +178,16 @@ class MyApp extends StatelessWidget {
...
@@ -143,6 +178,16 @@ class MyApp extends StatelessWidget {
String
cashierNameStrg
=
''
;
String
cashierNameStrg
=
''
;
String
tokenUser
=
''
;
String
tokenUser
=
''
;
// Future<bool> getLocationStatus() async {
// LocationPermission? permission;
// permission = await _geolocatorPlatform.requestPermission();
// if (permission == LocationPermission.denied) {
// return false;
// }
// return true;
// }
return
MultiBlocProvider
(
return
MultiBlocProvider
(
providers:
[
providers:
[
BlocProvider
(
create:
(
_
)
=>
OrdersBloc
()),
BlocProvider
(
create:
(
_
)
=>
OrdersBloc
()),
...
@@ -166,19 +211,29 @@ class MyApp extends StatelessWidget {
...
@@ -166,19 +211,29 @@ class MyApp extends StatelessWidget {
BlocProvider
(
create:
(
_
)
=>
SearchHistory
()),
BlocProvider
(
create:
(
_
)
=>
SearchHistory
()),
],
],
child:
MaterialApp
(
child:
MaterialApp
(
title:
(
title
==
null
)
?
defaultTitle
:
title
,
title:
(
widget
.
title
==
null
)
?
defaultTitle
:
widget
.
title
,
builder:
EasyLoading
.
init
(),
builder:
EasyLoading
.
init
(),
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
onGenerateRoute:
(
routes
)
{
onGenerateRoute:
(
routes
)
{
var
uri
=
Uri
.
parse
(
routes
.
name
!);
var
uri
=
Uri
.
parse
(
routes
.
name
!);
if
(
uri
.
pathSegments
.
isEmpty
)
{
if
(
uri
.
pathSegments
.
isEmpty
)
{
setTableMode
(
closebill
);
setTableMode
(
closebill
);
setUrlLookUp
(
Uri
.
base
.
toString
());
setIsDeliveryPickup
(
true
);
return
MaterialPageRoute
(
return
MaterialPageRoute
(
builder:
(
context
)
=>
NoRoute
(
builder:
(
_
)
=>
Splash
(
identification:
'emptyUri'
,
branch:
branchStrg
,
brand:
brandStrg
,
tn:
tnStrg
,
role:
roleStrg
,
cashierName:
cashierNameStrg
,
toBill:
toBill
,
orderId:
orderId
,
token:
tokenUser
,
),
),
);
);
}
else
if
(
uri
.
pathSegments
.
length
==
2
)
{
}
else
if
(
uri
.
pathSegments
.
length
==
2
)
{
setIsDeliveryPickup
(
false
);
String
firstPath
=
uri
.
pathSegments
.
first
;
String
firstPath
=
uri
.
pathSegments
.
first
;
if
(
firstPath
==
'o'
)
{
if
(
firstPath
==
'o'
)
{
setTableMode
(
openBill
);
setTableMode
(
openBill
);
...
@@ -199,6 +254,7 @@ class MyApp extends StatelessWidget {
...
@@ -199,6 +254,7 @@ class MyApp extends StatelessWidget {
),
),
);
);
}
else
if
(
uri
.
pathSegments
.
length
==
3
)
{
}
else
if
(
uri
.
pathSegments
.
length
==
3
)
{
setIsDeliveryPickup
(
false
);
brandStrg
=
uri
.
pathSegments
.
first
;
brandStrg
=
uri
.
pathSegments
.
first
;
branchStrg
=
uri
.
pathSegments
[
1
];
branchStrg
=
uri
.
pathSegments
[
1
];
tnStrg
=
uri
.
pathSegments
[
2
];
tnStrg
=
uri
.
pathSegments
[
2
];
...
@@ -216,6 +272,7 @@ class MyApp extends StatelessWidget {
...
@@ -216,6 +272,7 @@ class MyApp extends StatelessWidget {
),
),
);
);
}
else
if
(
uri
.
pathSegments
.
length
==
4
)
{
}
else
if
(
uri
.
pathSegments
.
length
==
4
)
{
setIsDeliveryPickup
(
false
);
brandStrg
=
uri
.
pathSegments
.
first
;
brandStrg
=
uri
.
pathSegments
.
first
;
branchStrg
=
uri
.
pathSegments
[
1
];
branchStrg
=
uri
.
pathSegments
[
1
];
tnStrg
=
uri
.
pathSegments
[
2
];
tnStrg
=
uri
.
pathSegments
[
2
];
...
@@ -240,6 +297,7 @@ class MyApp extends StatelessWidget {
...
@@ -240,6 +297,7 @@ class MyApp extends StatelessWidget {
),
),
);
);
}
else
if
(
uri
.
pathSegments
.
length
==
5
)
{
}
else
if
(
uri
.
pathSegments
.
length
==
5
)
{
setIsDeliveryPickup
(
false
);
brandStrg
=
uri
.
pathSegments
.
first
;
brandStrg
=
uri
.
pathSegments
.
first
;
branchStrg
=
uri
.
pathSegments
[
1
];
branchStrg
=
uri
.
pathSegments
[
1
];
tnStrg
=
uri
.
pathSegments
[
2
];
tnStrg
=
uri
.
pathSegments
[
2
];
...
@@ -267,6 +325,7 @@ class MyApp extends StatelessWidget {
...
@@ -267,6 +325,7 @@ class MyApp extends StatelessWidget {
);
);
}
}
return
null
;
return
null
;
}));
}),
);
}
}
}
}
lib/models/bill.dart
View file @
1296ca98
...
@@ -58,7 +58,7 @@ class Bill {
...
@@ -58,7 +58,7 @@ class Bill {
customerName:
json
[
'customer_name'
],
customerName:
json
[
'customer_name'
],
tableStatus:
json
[
'table_status'
],
tableStatus:
json
[
'table_status'
],
orderStatus:
json
[
'order_status'
],
orderStatus:
json
[
'order_status'
],
state:
json
[
'state'
],
state:
json
[
'
order_
state'
],
billDetail:
json
[
'order_detail'
],
billDetail:
json
[
'order_detail'
],
paymentList:
json
[
'payment_list'
],
paymentList:
json
[
'payment_list'
],
outStandingPay:
json
[
'outstanding'
],
outStandingPay:
json
[
'outstanding'
],
...
...
lib/ui/no_route.dart
View file @
1296ca98
// ignore_for_file: must_be_immutable
// ignore_for_file: must_be_immutable
, avoid_unnecessary_containers
import
'package:byod/helper/helper.dart'
;
import
'package:byod/helper/helper.dart'
;
import
'package:byod/helper/prefs.dart'
;
import
'package:byod/helper/widget/style.dart'
;
import
'package:byod/helper/widget/style.dart'
;
import
'package:byod/main.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'../helper/widget/button_modal.dart'
;
class
NoRoute
extends
StatelessWidget
{
class
NoRoute
extends
StatelessWidget
{
String
identification
;
String
identification
;
...
@@ -32,26 +37,66 @@ class NoRoute extends StatelessWidget {
...
@@ -32,26 +37,66 @@ class NoRoute extends StatelessWidget {
SizedBox
(
SizedBox
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.05
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.05
,
),
),
(
identification
==
'titleError'
)
(
identification
==
titleError
)
?
defaultText
(
?
defaultText
(
context
,
context
,
"Scan QR Atau Kunjungi Alamat Outlet (Error: title)"
,
"Scan QR Atau Kunjungi Alamat Outlet (Error: title)"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
textStyleNormalFont
(
context
),
style:
textStyleNormalFont
(
context
),
)
)
:
(
identification
==
'configError'
)
:
(
identification
==
configError
)
?
defaultText
(
?
defaultText
(
context
,
context
,
"Scan QR Atau Kunjungi Alamat Outlet (Error: config)"
,
"Scan QR Atau Kunjungi Alamat Outlet (Error: config)"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
textStyleNormalFont
(
context
),
style:
textStyleNormalFont
(
context
),
)
)
:
(
identification
==
gpsNotActive
)
?
defaultText
(
context
,
"Delivery/Pickup order memerlukan akses GPS"
,
textAlign:
TextAlign
.
center
,
style:
textStyleNormalFont
(
context
),
)
:
(
identification
==
locationPermissinDenied
)
?
defaultText
(
context
,
"Delivery/Pickup order memerlukan akses lokasi anda"
,
textAlign:
TextAlign
.
center
,
style:
textStyleNormalFont
(
context
),
)
:
defaultText
(
:
defaultText
(
context
,
context
,
"Scan QR Atau Kunjungi Alamat Outlet"
,
"Scan QR Atau Kunjungi Alamat Outlet"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
textStyleNormalFont
(
context
),
style:
textStyleNormalFont
(
context
),
),
),
(
identification
==
locationPermissinDenied
)
?
GestureDetector
(
onTap:
()
{
Geolocator
.
requestPermission
().
then
((
value
)
{
if
(
value
!=
LocationPermission
.
denied
)
{
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
MyApp
(
title:
getTitleWeb
(),
),
),
);
}
});
},
child:
Container
(
margin:
const
EdgeInsets
.
only
(
top:
15
),
width:
200
,
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Aktifkan Lokasi'
,
),
),
)
:
const
SizedBox
()
],
],
),
),
)));
)));
...
...
lib/ui/splash.dart
View file @
1296ca98
...
@@ -9,19 +9,29 @@ import 'package:byod/ui/no_route.dart';
...
@@ -9,19 +9,29 @@ import 'package:byod/ui/no_route.dart';
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:byod/ui/viewbill/view_bill_new.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'../bloc/branch_exist.dart'
;
import
'../bloc/branch_exist.dart'
;
import
'../main.dart'
;
import
'../main.dart'
;
import
'package:flutter/services.dart'
as
bundle_root
;
import
'package:flutter/services.dart'
as
bundle_root
;
import
'home/new_home2.dart'
;
import
'home/new_home2.dart'
;
import
'home/shimmer_menu.dart'
;
import
'home/shimmer_menu_new.dart'
;
import
'home/shimmer_menu_new.dart'
;
import
'screen_responsive.dart'
;
import
'screen_responsive.dart'
;
class
Splash
extends
StatefulWidget
{
class
Splash
extends
StatefulWidget
{
final
String
branch
,
brand
,
tn
,
role
,
cashierName
,
toBill
,
orderId
,
token
;
final
String
branch
,
const
Splash
(
brand
,
{
Key
?
key
,
tn
,
role
,
cashierName
,
toBill
,
orderId
,
token
,
url
,
lat
,
long
;
const
Splash
({
Key
?
key
,
required
this
.
branch
,
required
this
.
branch
,
required
this
.
brand
,
required
this
.
brand
,
required
this
.
tn
,
required
this
.
tn
,
...
@@ -29,8 +39,11 @@ class Splash extends StatefulWidget {
...
@@ -29,8 +39,11 @@ class Splash extends StatefulWidget {
required
this
.
cashierName
,
required
this
.
cashierName
,
required
this
.
toBill
,
required
this
.
toBill
,
required
this
.
orderId
,
required
this
.
orderId
,
required
this
.
token
})
required
this
.
token
,
:
super
(
key:
key
);
this
.
url
=
''
,
this
.
lat
=
''
,
this
.
long
=
''
,
})
:
super
(
key:
key
);
@override
@override
State
<
Splash
>
createState
()
=>
_SplashState
();
State
<
Splash
>
createState
()
=>
_SplashState
();
...
@@ -55,6 +68,11 @@ class _SplashState extends State<Splash> {
...
@@ -55,6 +68,11 @@ class _SplashState extends State<Splash> {
@override
@override
void
initState
()
{
void
initState
()
{
loadBaseUrl
().
then
((
baseUrl
)
{
loadBaseUrl
().
then
((
baseUrl
)
{
Geolocator
.
checkPermission
().
then
((
permission
)
{
if
(
permission
!=
LocationPermission
.
denied
)
{
Geolocator
.
getCurrentPosition
().
then
((
position
)
{
setLatitude
(
position
.
latitude
.
toString
());
setLongitude
(
position
.
longitude
.
toString
());
setBaseUrl
(
baseUrl
);
setBaseUrl
(
baseUrl
);
context
.
read
<
BranchExist
>().
branchExist
(
context
.
read
<
BranchExist
>().
branchExist
(
widget
.
branch
,
widget
.
branch
,
...
@@ -65,6 +83,19 @@ class _SplashState extends State<Splash> {
...
@@ -65,6 +83,19 @@ class _SplashState extends State<Splash> {
context
,
context
,
getMenu:
true
,
getMenu:
true
,
);
);
});
}
else
{
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
NoRoute
(
identification:
locationPermissinDenied
,
),
),
);
}
});
// context.read<CategoryMenu>().catAndMenu(widget.branch, widget.brand,
// context.read<CategoryMenu>().catAndMenu(widget.branch, widget.brand,
// widget.role, widget.cashierName, widget.token);
// widget.role, widget.cashierName, widget.token);
...
@@ -76,8 +107,8 @@ class _SplashState extends State<Splash> {
...
@@ -76,8 +107,8 @@ class _SplashState extends State<Splash> {
}
}
Future
.
delayed
(
const
Duration
(
milliseconds:
1000
),
()
async
{
Future
.
delayed
(
const
Duration
(
milliseconds:
1000
),
()
async
{
setToken
(
widget
.
token
);
setToken
(
widget
.
token
);
setBranch
(
widget
.
branch
);
//
setBranch(widget.branch);
setBrand
(
widget
.
brand
);
//
setBrand(widget.brand);
setTableNumber
(
widget
.
tn
);
setTableNumber
(
widget
.
tn
);
setRole
(
widget
.
role
);
setRole
(
widget
.
role
);
setCashierName
(
widget
.
cashierName
);
setCashierName
(
widget
.
cashierName
);
...
...
lib/ui/viewbill/app_bar.dart
View file @
1296ca98
...
@@ -23,7 +23,7 @@ class CustomAppBar extends StatelessWidget {
...
@@ -23,7 +23,7 @@ class CustomAppBar extends StatelessWidget {
String
brandCode
=
getBrand
();
String
brandCode
=
getBrand
();
String
role
=
getRole
();
String
role
=
getRole
();
String
cashierName
=
getCashierName
();
String
cashierName
=
getCashierName
();
String
session
Id
=
getOrderId
();
String
order
Id
=
getOrderId
();
return
Container
(
return
Container
(
padding:
const
EdgeInsets
.
only
(
padding:
const
EdgeInsets
.
only
(
top:
15
,
top:
15
,
...
@@ -46,7 +46,7 @@ class CustomAppBar extends StatelessWidget {
...
@@ -46,7 +46,7 @@ class CustomAppBar extends StatelessWidget {
brandCode
,
brandCode
,
role
,
role
,
cashierName
,
cashierName
,
session
Id
,
order
Id
,
context
,
context
,
);
);
}
else
{
}
else
{
...
...
macos/Flutter/GeneratedPluginRegistrant.swift
View file @
1296ca98
...
@@ -5,10 +5,12 @@
...
@@ -5,10 +5,12 @@
import
FlutterMacOS
import
FlutterMacOS
import
Foundation
import
Foundation
import
geolocator_apple
import
shared_preferences_macos
import
shared_preferences_macos
import
url_launcher_macos
import
url_launcher_macos
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
GeolocatorPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"GeolocatorPlugin"
))
SharedPreferencesPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharedPreferencesPlugin"
))
SharedPreferencesPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharedPreferencesPlugin"
))
UrlLauncherPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"UrlLauncherPlugin"
))
UrlLauncherPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"UrlLauncherPlugin"
))
}
}
pubspec.lock
View file @
1296ca98
...
@@ -135,6 +135,48 @@ packages:
...
@@ -135,6 +135,48 @@ packages:
description: flutter
description: flutter
source: sdk
source: sdk
version: "0.0.0"
version: "0.0.0"
geolocator:
dependency: "direct main"
description:
name: geolocator
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.2"
geolocator_android:
dependency: transitive
description:
name: geolocator_android
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.3"
geolocator_apple:
dependency: transitive
description:
name: geolocator_apple
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
geolocator_platform_interface:
dependency: transitive
description:
name: geolocator_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.6"
geolocator_web:
dependency: transitive
description:
name: geolocator_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.6"
geolocator_windows:
dependency: transitive
description:
name: geolocator_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
html:
html:
dependency: transitive
dependency: transitive
description:
description:
...
...
pubspec.yaml
View file @
1296ca98
...
@@ -33,6 +33,7 @@ dependencies:
...
@@ -33,6 +33,7 @@ dependencies:
sdk
:
flutter
sdk
:
flutter
flutter_bloc
:
^8.0.1
flutter_bloc
:
^8.0.1
flutter_easyloading
:
^3.0.3
flutter_easyloading
:
^3.0.3
geolocator
:
^9.0.2
http
:
^0.13.4
http
:
^0.13.4
intl
:
^0.17.0
intl
:
^0.17.0
loading_animations
:
^2.2.0
loading_animations
:
^2.2.0
...
...
windows/flutter/generated_plugin_registrant.cc
View file @
1296ca98
...
@@ -6,9 +6,12 @@
...
@@ -6,9 +6,12 @@
#include "generated_plugin_registrant.h"
#include "generated_plugin_registrant.h"
#include <geolocator_windows/geolocator_windows.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <url_launcher_windows/url_launcher_windows.h>
void
RegisterPlugins
(
flutter
::
PluginRegistry
*
registry
)
{
void
RegisterPlugins
(
flutter
::
PluginRegistry
*
registry
)
{
GeolocatorWindowsRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"GeolocatorWindows"
));
UrlLauncherWindowsRegisterWithRegistrar
(
UrlLauncherWindowsRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"UrlLauncherWindows"
));
registry
->
GetRegistrarForPlugin
(
"UrlLauncherWindows"
));
}
}
windows/flutter/generated_plugins.cmake
View file @
1296ca98
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#
#
list
(
APPEND FLUTTER_PLUGIN_LIST
list
(
APPEND FLUTTER_PLUGIN_LIST
geolocator_windows
url_launcher_windows
url_launcher_windows
)
)
...
...
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