Commit 1296ca98 authored by Dio Maulana's avatar Dio Maulana

s

parent 41f23cb1
{ {
"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
......
...@@ -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'],
......
...@@ -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 */
...@@ -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);
}
...@@ -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: value, title: title,
), ),
); );
}); });
...@@ -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 StatelessWidget { class MyApp extends StatefulWidget {
// 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;
})); }),
);
} }
} }
...@@ -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'],
......
// 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()
], ],
), ),
))); )));
......
...@@ -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);
......
...@@ -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 sessionId = getOrderId(); String orderId = 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,
sessionId, orderId,
context, context,
); );
} else { } else {
......
...@@ -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"))
} }
...@@ -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:
......
...@@ -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
......
...@@ -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"));
} }
...@@ -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
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment