Commit bfc893f0 authored by Dio Maulana's avatar Dio Maulana

design delivery pickup dan select branch, masih 1/2 jadi

parent 3e82ff72
...@@ -108,6 +108,15 @@ TextStyle customerNameViewbill({font = 14, Color color = textColorBlack}) { ...@@ -108,6 +108,15 @@ TextStyle customerNameViewbill({font = 14, Color color = textColorBlack}) {
); );
} }
TextStyle pickUpdeliveryStyleFont({font = 16, Color color = textColorBlack}) {
return TextStyle(
fontFamily: (fontFamily == '') ? null : fontFamily,
fontSize: font,
fontWeight: FontWeight.w600,
color: color,
);
}
TextStyle noteViewBill({font = 8, Color color = textColorBlack}) { TextStyle noteViewBill({font = 8, Color color = textColorBlack}) {
return TextStyle( return TextStyle(
fontFamily: 'OpenSans', fontFamily: 'OpenSans',
......
// ignore_for_file: sized_box_for_whitespace // ignore_for_file: sized_box_for_whitespace
import 'package:byod/bloc/search_branch.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 '../../helper/helper.dart'; import '../../helper/helper.dart';
import '../../helper/widget/style.dart'; import '../../helper/widget/style.dart';
import '../bloc/branch_list.dart'; import '../bloc/branch_list.dart';
import '../bloc/search_branch.dart';
import '../models/branchs.dart'; import '../models/branchs.dart';
class CustomAppBar extends StatelessWidget { class CustomAppBar extends StatelessWidget {
...@@ -17,33 +17,33 @@ class CustomAppBar extends StatelessWidget { ...@@ -17,33 +17,33 @@ class CustomAppBar extends StatelessWidget {
final _searchController = TextEditingController(); final _searchController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocBuilder<BranchList, List<Branch>>( return Container(
builder: (context, allBranch) { color: backgroundWhite,
return Container( padding: const EdgeInsets.symmetric(
color: backgroundWhite, horizontal: paddingLeftRight, vertical: 15),
padding: const EdgeInsets.symmetric( child: Column(
horizontal: paddingLeftRight, vertical: 15), children: [
child: Column( Center(
children: [ child: defaultText(
Center( context,
child: defaultText( 'Silahkan Pilih Outlet',
context, maxLines: 1,
'Silahkan Pilih Outlet', overFlow: TextOverflow.ellipsis,
maxLines: 1, style: appBarNameViewBill(),
overFlow: TextOverflow.ellipsis, ),
style: appBarNameViewBill(), ),
), const SizedBox(
), height: 16,
const SizedBox( ),
height: 16, BlocBuilder<BranchList, List<Branch>>(
), builder: (context, allBranch) {
Container( return Container(
height: 36, height: 36,
child: TextField( child: TextField(
controller: _searchController, controller: _searchController,
// autofocus: true, // autofocus: true,
onChanged: (sarchValue) { onChanged: (searchValue) {
context.read<SearchBranch>().search(sarchValue, allBranch); context.read<SearchBranch>().search(searchValue, allBranch);
}, },
key: const Key('SearchField'), key: const Key('SearchField'),
style: TextStyle( style: TextStyle(
...@@ -83,11 +83,11 @@ class CustomAppBar extends StatelessWidget { ...@@ -83,11 +83,11 @@ class CustomAppBar extends StatelessWidget {
), ),
), ),
), ),
), );
], },
), ),
); ],
}, ),
); );
} }
} }
...@@ -16,94 +16,100 @@ class NoRoute extends StatelessWidget { ...@@ -16,94 +16,100 @@ class NoRoute extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
LocationPermission? permission;
Geolocator.checkPermission().then((value) {
permission = value;
});
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
body: Center( body: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// const Icon( // const Icon(
// Icons.highlight_remove_outlined, // Icons.highlight_remove_outlined,
// size: 80, // size: 80,
// color: Colors.red, // color: Colors.red,
// ), // ),
fontAwesome( fontAwesome(
context, context,
timesCircleIcon, timesCircleIcon,
timesCircleIconSize, timesCircleIconSize,
color: dangerColor, color: dangerColor,
isBold: false, isBold: false,
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.05, height: MediaQuery.of(context).size.height * 0.05,
), ),
(identification == titleError) (identification == titleError)
? defaultText(
context,
"Scan QR Atau Kunjungi Alamat Outlet (Error: title)",
textAlign: TextAlign.center,
style: textStyleNormalFont(context),
)
: (identification == configError)
? defaultText( ? defaultText(
context, context,
"Scan QR Atau Kunjungi Alamat Outlet (Error: title)", "Scan QR Atau Kunjungi Alamat Outlet (Error: config)",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: textStyleNormalFont(context), style: textStyleNormalFont(context),
) )
: (identification == configError) : (identification == gpsNotActive)
? defaultText( ? defaultText(
context, context,
"Scan QR Atau Kunjungi Alamat Outlet (Error: config)", "Delivery/Pickup order memerlukan akses GPS",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: textStyleNormalFont(context), style: textStyleNormalFont(context),
) )
: (identification == gpsNotActive) : (identification == locationPermissinDenied)
? defaultText( ? defaultText(
context, context,
"Delivery/Pickup order memerlukan akses GPS", "Delivery/Pickup order memerlukan akses lokasi anda, Silahkan ubah pengaturan lokasi browser anda",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: textStyleNormalFont(context), style: textStyleNormalFont(context),
) )
: (identification == locationPermissinDenied) : defaultText(
? defaultText(
context,
"Delivery/Pickup order memerlukan akses lokasi anda",
textAlign: TextAlign.center,
style: textStyleNormalFont(context),
)
: defaultText(
context,
"Scan QR Atau Kunjungi Alamat Outlet",
textAlign: TextAlign.center,
style: textStyleNormalFont(context),
),
(identification == locationPermissinDenied)
? GestureDetector(
onTap: () {
Geolocator.requestPermission().then((value) {
if (value != LocationPermission.denied &&
value != LocationPermission.deniedForever) {
Navigator.pushReplacement(
context, context,
MaterialPageRoute( "Scan QR Atau Kunjungi Alamat Outlet",
builder: (_) => MyApp( textAlign: TextAlign.center,
title: getTitleWeb(), style: textStyleNormalFont(context),
), ),
), (identification == locationPermissinDenied)
); ? GestureDetector(
} else { onTap: () {
EasyLoading.showToast( Geolocator.requestPermission().then((value) {
'Silahkan aktifkan lokasi browser anda'); if (value != LocationPermission.denied &&
} value != LocationPermission.deniedForever) {
}); Navigator.pushReplacement(
}, context,
child: Container( MaterialPageRoute(
margin: const EdgeInsets.only(top: 15), builder: (_) => MyApp(
width: 200, title: getTitleWeb(),
child: ButtonComponent( ),
buttonColor: buttonColor, ),
teksButton: 'Aktifkan Lokasi', );
), } else {
), EasyLoading.showToast(
) 'Silahkan aktifkan lokasi browser anda');
: const SizedBox() }
], });
), },
))); child: Container(
margin: const EdgeInsets.only(top: 15),
width: 200,
child: ButtonComponent(
buttonColor: buttonColor,
teksButton: 'Lanjutkan',
),
),
)
: const SizedBox()
],
),
),
),
);
} }
} }
...@@ -37,32 +37,33 @@ class CoreBranch extends StatelessWidget { ...@@ -37,32 +37,33 @@ class CoreBranch extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double widthScreen = responsiveWidthScreen(context);
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight), width: widthScreen,
child: BlocBuilder<BranchList, List<Branch>>( // padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
builder: (context, listB) { child: Column(
return BlocBuilder<SearchBranch, List<Branch>>( children: [
builder: (contextSearch, listSearch) { CustomAppBar(
List<Branch> listBranch; // allBranch: listB,
if (listSearch.isNotEmpty) { ),
if (listSearch[0].id == '0') { const SizedBox(
listBranch = listB; height: 16,
} else { ),
listBranch = listSearch; BlocBuilder<BranchList, List<Branch>>(
} builder: (context, listB) {
} else { return BlocBuilder<SearchBranch, List<Branch>>(
listBranch = listSearch; builder: (contextSearch, listSearch) {
} List<Branch> listBranch;
if (listSearch.isNotEmpty) {
return Column( if (listSearch[0].id == '0') {
children: [ listBranch = listB;
CustomAppBar( } else {
// allBranch: listB, listBranch = listSearch;
), }
const SizedBox( } else {
height: 16, listBranch = listSearch;
), }
Expanded( return Expanded(
child: ListView.builder( child: ListView.builder(
itemCount: listBranch.length, itemCount: listBranch.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
...@@ -94,7 +95,7 @@ class CoreBranch extends StatelessWidget { ...@@ -94,7 +95,7 @@ class CoreBranch extends StatelessWidget {
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
color: backgroundWhite, color: backgroundWhite,
), ),
height: 72, // height: 72,
child: Container( child: Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 16, left: 16,
...@@ -114,6 +115,8 @@ class CoreBranch extends StatelessWidget { ...@@ -114,6 +115,8 @@ class CoreBranch extends StatelessWidget {
defaultText( defaultText(
context, context,
listBranch[i].name, listBranch[i].name,
// maxLines: 1,
// overFlow: TextOverflow.ellipsis,
style: historyOrderStyle(), style: historyOrderStyle(),
), ),
const SizedBox( const SizedBox(
...@@ -141,7 +144,9 @@ class CoreBranch extends StatelessWidget { ...@@ -141,7 +144,9 @@ class CoreBranch extends StatelessWidget {
? 'Delivery Tersedia' ? 'Delivery Tersedia'
: 'Delivery Tidak Tersedia', : 'Delivery Tidak Tersedia',
style: historyOrderStyle( style: historyOrderStyle(
color: textGreyDeskripsi, color: (listBranch[i].isDelivery)
? successColor
: textGreyDeskripsi,
), ),
), ),
const SizedBox( const SizedBox(
...@@ -153,7 +158,9 @@ class CoreBranch extends StatelessWidget { ...@@ -153,7 +158,9 @@ class CoreBranch extends StatelessWidget {
? 'Pickup Tersedia' ? 'Pickup Tersedia'
: 'Pickup Tidak Tersedia', : 'Pickup Tidak Tersedia',
style: historyOrderStyle( style: historyOrderStyle(
color: textGreyDeskripsi, color: (listBranch[i].isPickup)
? successColor
: textGreyDeskripsi,
), ),
), ),
], ],
...@@ -165,12 +172,12 @@ class CoreBranch extends StatelessWidget { ...@@ -165,12 +172,12 @@ class CoreBranch extends StatelessWidget {
), ),
); );
}), }),
), );
], },
); );
}, },
); ),
}, ],
), ),
); );
} }
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
import 'dart:convert'; import 'dart:convert';
import 'package:byod/bloc/branch_list.dart';
import 'package:byod/bloc/member_info.dart'; import 'package:byod/bloc/member_info.dart';
import 'package:byod/helper/helper.dart'; import 'package:byod/helper/helper.dart';
import 'package:byod/helper/prefs.dart'; import 'package:byod/helper/prefs.dart';
import 'package:byod/ui/no_route.dart'; import 'package:byod/ui/no_route.dart';
import 'package:byod/ui/select_branch.dart'; import 'package:byod/ui/select_branch.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 'package:geolocator/geolocator.dart';
...@@ -88,12 +86,14 @@ class _SplashState extends State<Splash> { ...@@ -88,12 +86,14 @@ class _SplashState extends State<Splash> {
widget.context, widget.context,
getBrancList: true, getBrancList: true,
); );
Navigator.pushReplacement( Future.delayed(const Duration(milliseconds: 2000), () async {
widget.context, Navigator.pushReplacement(
MaterialPageRoute( widget.context,
builder: (_) => const SelectBranch(), MaterialPageRoute(
), builder: (_) => const SelectBranch(),
); ),
);
});
}); });
} else { } else {
Navigator.pushReplacement( Navigator.pushReplacement(
...@@ -285,12 +285,14 @@ class _SplashState extends State<Splash> { ...@@ -285,12 +285,14 @@ class _SplashState extends State<Splash> {
} }
void goToMenu(contexts) { void goToMenu(contexts) {
Navigator.pushReplacement( Future.delayed(const Duration(milliseconds: 2000), () async {
contexts, Navigator.pushReplacement(
MaterialPageRoute( contexts,
builder: (_) => const NewHome2(), MaterialPageRoute(
), builder: (_) => const NewHome2(),
); ),
);
});
} }
@override @override
......
...@@ -9,6 +9,7 @@ import 'package:byod/helper/widget/style.dart'; ...@@ -9,6 +9,7 @@ import 'package:byod/helper/widget/style.dart';
import 'package:byod/ui/history_order/history_new.dart'; import 'package:byod/ui/history_order/history_new.dart';
import 'package:byod/ui/payment/payment_balance.dart'; import 'package:byod/ui/payment/payment_balance.dart';
import 'package:byod/ui/screen_responsive.dart'; import 'package:byod/ui/screen_responsive.dart';
import 'package:dotted_line/dotted_line.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:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
...@@ -365,6 +366,7 @@ class CoreBill extends StatelessWidget { ...@@ -365,6 +366,7 @@ class CoreBill extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bool isDeliveryPickuup = getIsDeliveryPickup();
return BlocBuilder<MemberInfoBloc, MemberInfo>( return BlocBuilder<MemberInfoBloc, MemberInfo>(
builder: (contextMember, memberinfo) { builder: (contextMember, memberinfo) {
int outStandingTopayMember = 0; int outStandingTopayMember = 0;
...@@ -387,34 +389,192 @@ class CoreBill extends StatelessWidget { ...@@ -387,34 +389,192 @@ class CoreBill extends StatelessWidget {
), ),
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
color: backgroundWhite, color: backgroundWhite.withOpacity(0.9),
padding: const EdgeInsets.symmetric( height: 115,
horizontal: paddingLeftRight), child: Row(
child: defaultText( mainAxisAlignment: MainAxisAlignment.spaceBetween,
context, 'Meja ${dataBill[0].tableName}', crossAxisAlignment: CrossAxisAlignment.center,
style: viewbillStyle()), children: [
), Column(
Container( mainAxisSize: MainAxisSize.min,
width: double.infinity, crossAxisAlignment: CrossAxisAlignment.start,
color: backgroundWhite, children: [
padding: const EdgeInsets.only( Container(
left: paddingLeftRight, padding: const EdgeInsets.symmetric(
right: paddingLeftRight, horizontal: paddingLeftRight),
bottom: 18, child: defaultText(
context,
(isDeliveryPickuup)
? 'Delivery'
: 'Meja ${dataBill[0].tableName}',
style: viewbillStyle()),
),
Container(
padding: const EdgeInsets.only(
left: paddingLeftRight,
right: paddingLeftRight,
// bottom: 18,
),
child: defaultText(
context, dataBill[0].customerName,
style: customerNameViewbill()),
),
],
),
(isDeliveryPickuup)
? GestureDetector(
onTap: () {
showModalBottomSheet(
backgroundColor: backgroundWhite,
context: context,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(19),
topRight: Radius.circular(19),
),
),
barrierColor:
Colors.grey.withOpacity(0.9),
builder: (contextModal) {
return Container(
padding:
const EdgeInsets.symmetric(
horizontal: paddingLeftRight,
),
child: Column(
mainAxisSize:
MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Center(
child: Container(
margin: const EdgeInsets
.only(
top: 8,
bottom: 28,
),
width: 50,
height: 3,
color: disabledColor,
),
),
defaultText(
context,
'Pilih Tipe Order',
style:
pickUpdeliveryStyleFont(),
),
Container(
padding:
const EdgeInsets.only(
top: 19,
bottom: 25,
left: 10),
child: Row(
children: [
const Image(
image: AssetImage(
'assets/icons/pickup-icon.png'),
),
const SizedBox(
width: 12,
),
defaultText(
context,
'Pick Up',
style:
pickUpdeliveryStyleFont(),
)
],
),
),
Container(
padding:
const EdgeInsets.only(
left: 10,
bottom: 24),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Row(
children: [
const Image(
image: AssetImage(
'assets/icons/delivery-icon.png'),
),
const SizedBox(
width: 12,
),
defaultText(
context,
'Delivery',
style:
pickUpdeliveryStyleFont(),
)
],
),
defaultText(
context,
'23 Menit',
style:
pickUpdeliveryStyleFont(),
)
],
),
)
],
),
);
},
);
},
child: Container(
height: 30,
width: 69,
margin: const EdgeInsets.only(
right: 20,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(40),
color: buttonColor,
),
child: Center(
child: defaultText(
context,
'Ganti',
style: addButton(
font: 8,
),
),
),
),
)
: const SizedBox()
],
), ),
child: defaultText(
context, dataBill[0].customerName,
style: customerNameViewbill()),
), ),
// const Divider( (isDeliveryPickuup)
// color: backgroundColorViewBill, ? Container(
// thickness: 24, color: backgroundWhite,
// ), child: const DottedLine(
dashColor: dashGrey,
dashLength: 12,
),
)
: const SizedBox(),
(isDeliveryPickuup)
? const DeliveryPickupDetail()
: const SizedBox(),
const SizedBox( const SizedBox(
height: 24, height: 24,
), ),
...@@ -812,7 +972,7 @@ class CoreBill extends StatelessWidget { ...@@ -812,7 +972,7 @@ class CoreBill extends StatelessWidget {
], ],
), ),
), ),
) ),
], ],
), ),
Positioned( Positioned(
...@@ -1192,6 +1352,135 @@ class CoreBill extends StatelessWidget { ...@@ -1192,6 +1352,135 @@ class CoreBill extends StatelessWidget {
} }
} }
class DeliveryPickupDetail extends StatelessWidget {
const DeliveryPickupDetail({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(
horizontal: paddingLeftRight,
vertical: 12,
),
color: backgroundWhite.withOpacity(0.9),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
defaultText(context, 'Alamat Pengantaran'),
const SizedBox(
height: 6,
),
defaultText(context, 'Blok M Barat'),
],
),
),
const SizedBox(
width: 5,
),
Container(
width: 98,
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: backgroundWhite,
border: Border.all(
color: buttonColor,
),
),
child: Center(
child: defaultText(
context,
'Ganti Alamat',
style: addButton(
font: 8,
color: buttonColor,
),
),
),
)
],
),
const SizedBox(
height: 21,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width: 100,
height: 23,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: buttonColor,
),
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Image(
image: AssetImage('assets/icons/pin-address.png'),
),
const SizedBox(
width: 12.6,
),
defaultText(
context,
'Detail Alamat',
style: addButton(
font: 8,
),
)
],
),
),
),
const SizedBox(
width: 16,
),
Container(
width: 84,
height: 23,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: buttonColor,
),
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Image(
image: AssetImage('assets/icons/note.png'),
),
const SizedBox(
width: 10,
),
defaultText(
context,
'Catatan',
style: addButton(font: 8),
)
],
),
),
)
],
),
],
),
);
}
}
class EmptyBill extends StatelessWidget { class EmptyBill extends StatelessWidget {
EmptyBill({ EmptyBill({
Key? key, Key? key,
......
// ignore_for_file: sized_box_for_whitespace
import 'package:flutter/material.dart';
import '../../helper/helper.dart';
import '../../helper/widget/style.dart';
class CustomAppBar extends StatelessWidget {
const CustomAppBar({Key? key, required this.titleAppBar}) : super(key: key);
final String titleAppBar;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(
top: 15,
bottom: 19,
left: paddingLeftRight,
right: paddingLeftRight,
),
// padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
color: backgroundWhite,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Container(
width: 24,
height: 24,
child: Center(
child: fontAwesomeNew(
arrowBack,
arrowBackSize,
),
),
),
),
const SizedBox(
width: 16,
),
Center(
child: defaultText(
context,
titleAppBar,
maxLines: 1,
overFlow: TextOverflow.ellipsis,
style: appBarNameViewBill(),
),
),
],
),
Container(
width: 24,
height: 24,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: buttonColor),
)
],
),
);
}
}
import 'dart:async';
import 'package:flutter/material.dart';
// import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:fwfh_webview/fwfh_webview.dart';
import '../splash.dart';
import 'app_bar_webview.dart';
// import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart';
class WebViewHtml extends StatelessWidget {
const WebViewHtml({
super.key,
required this.titleAppBar,
required this.url,
});
final String titleAppBar;
final String url;
Future<bool> tapUrl(x, BuildContext context) async {
if (x.contains('jasaotp')) {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => Splash(
// pathSegmentString: [''],
// context: context,
// ),
// ),
// );
}
return true;
}
@override
Widget build(BuildContext context) {
return Column(
children: [
CustomAppBar(
titleAppBar: titleAppBar,
),
Expanded(
child: HtmlWidget(
'<iframe src="$url"></iframe>',
factoryBuilder: () => MyWidgetFactory(),
onTapImage: (x) {
print(x);
},
onTapUrl: (x) {
return tapUrl(x, context);
},
),
),
// WebView(
// initialUrl: url,
// onWebViewCreated: (WebViewController controller) {
// _controller.complete(controller);
// },
// )
],
);
// return Scaffold(
// appBar: AppBar(
// title: const Text('Flutter WebView example'),
// // actions: <Widget>[
// // _SampleMenu(_controller.future),
// // ],
// ),
// body: WebView(
// initialUrl: url,
// onWebViewCreated: (WebViewController controller) {
// _controller.complete(controller);
// },
// ),
// );
}
}
class MyWidgetFactory extends WidgetFactory with WebViewFactory {}
...@@ -135,6 +135,27 @@ packages: ...@@ -135,6 +135,27 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_widget_from_html_core:
dependency: "direct main"
description:
name: flutter_widget_from_html_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+3"
fwfh_text_style:
dependency: transitive
description:
name: fwfh_text_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.22.08+1"
fwfh_webview:
dependency: "direct main"
description:
name: fwfh_webview
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2+3"
geolocator: geolocator:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -539,6 +560,41 @@ packages: ...@@ -539,6 +560,41 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.3" version: "2.0.3"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.4"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.10.4"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
webview_flutter_web:
dependency: "direct main"
description:
name: webview_flutter_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0+4"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.5"
win32: win32:
dependency: transitive dependency: transitive
description: description:
...@@ -555,4 +611,4 @@ packages: ...@@ -555,4 +611,4 @@ packages:
version: "0.2.0+1" version: "0.2.0+1"
sdks: sdks:
dart: ">=2.17.3 <3.0.0" dart: ">=2.17.3 <3.0.0"
flutter: ">=3.0.0" flutter: ">=3.1.0-0"
...@@ -33,6 +33,8 @@ dependencies: ...@@ -33,6 +33,8 @@ 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
flutter_widget_from_html_core: ^0.8.5+3
fwfh_webview: ^0.6.2+3
geolocator: ^9.0.2 geolocator: ^9.0.2
http: ^0.13.4 http: ^0.13.4
intl: ^0.17.0 intl: ^0.17.0
...@@ -45,6 +47,7 @@ dependencies: ...@@ -45,6 +47,7 @@ dependencies:
url_strategy: ^0.2.0 url_strategy: ^0.2.0
uuid: ^3.0.6 uuid: ^3.0.6
web_browser_detect: ^2.0.3 web_browser_detect: ^2.0.3
webview_flutter_web: ^0.1.0+4
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.0 flutter_lints: ^2.0.0
......
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