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}) {
);
}
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}) {
return TextStyle(
fontFamily: 'OpenSans',
......
// ignore_for_file: sized_box_for_whitespace
import 'package:byod/bloc/search_branch.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../helper/helper.dart';
import '../../helper/widget/style.dart';
import '../bloc/branch_list.dart';
import '../bloc/search_branch.dart';
import '../models/branchs.dart';
class CustomAppBar extends StatelessWidget {
......@@ -17,8 +17,6 @@ class CustomAppBar extends StatelessWidget {
final _searchController = TextEditingController();
@override
Widget build(BuildContext context) {
return BlocBuilder<BranchList, List<Branch>>(
builder: (context, allBranch) {
return Container(
color: backgroundWhite,
padding: const EdgeInsets.symmetric(
......@@ -37,13 +35,15 @@ class CustomAppBar extends StatelessWidget {
const SizedBox(
height: 16,
),
Container(
BlocBuilder<BranchList, List<Branch>>(
builder: (context, allBranch) {
return Container(
height: 36,
child: TextField(
controller: _searchController,
// autofocus: true,
onChanged: (sarchValue) {
context.read<SearchBranch>().search(sarchValue, allBranch);
onChanged: (searchValue) {
context.read<SearchBranch>().search(searchValue, allBranch);
},
key: const Key('SearchField'),
style: TextStyle(
......@@ -83,11 +83,11 @@ class CustomAppBar extends StatelessWidget {
),
),
),
);
},
),
],
),
);
},
);
}
}
......@@ -16,6 +16,10 @@ class NoRoute extends StatelessWidget {
@override
Widget build(BuildContext context) {
LocationPermission? permission;
Geolocator.checkPermission().then((value) {
permission = value;
});
return SafeArea(
child: Scaffold(
backgroundColor: backgroundColor,
......@@ -62,7 +66,7 @@ class NoRoute extends StatelessWidget {
: (identification == locationPermissinDenied)
? defaultText(
context,
"Delivery/Pickup order memerlukan akses lokasi anda",
"Delivery/Pickup order memerlukan akses lokasi anda, Silahkan ubah pengaturan lokasi browser anda",
textAlign: TextAlign.center,
style: textStyleNormalFont(context),
)
......@@ -97,13 +101,15 @@ class NoRoute extends StatelessWidget {
width: 200,
child: ButtonComponent(
buttonColor: buttonColor,
teksButton: 'Aktifkan Lokasi',
teksButton: 'Lanjutkan',
),
),
)
: const SizedBox()
],
),
)));
),
),
);
}
}
......@@ -37,9 +37,19 @@ class CoreBranch extends StatelessWidget {
@override
Widget build(BuildContext context) {
double widthScreen = responsiveWidthScreen(context);
return Container(
padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
child: BlocBuilder<BranchList, List<Branch>>(
width: widthScreen,
// padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
child: Column(
children: [
CustomAppBar(
// allBranch: listB,
),
const SizedBox(
height: 16,
),
BlocBuilder<BranchList, List<Branch>>(
builder: (context, listB) {
return BlocBuilder<SearchBranch, List<Branch>>(
builder: (contextSearch, listSearch) {
......@@ -53,16 +63,7 @@ class CoreBranch extends StatelessWidget {
} else {
listBranch = listSearch;
}
return Column(
children: [
CustomAppBar(
// allBranch: listB,
),
const SizedBox(
height: 16,
),
Expanded(
return Expanded(
child: ListView.builder(
itemCount: listBranch.length,
itemBuilder: (context, i) {
......@@ -94,7 +95,7 @@ class CoreBranch extends StatelessWidget {
borderRadius: BorderRadius.circular(6),
color: backgroundWhite,
),
height: 72,
// height: 72,
child: Container(
padding: const EdgeInsets.only(
left: 16,
......@@ -114,6 +115,8 @@ class CoreBranch extends StatelessWidget {
defaultText(
context,
listBranch[i].name,
// maxLines: 1,
// overFlow: TextOverflow.ellipsis,
style: historyOrderStyle(),
),
const SizedBox(
......@@ -141,7 +144,9 @@ class CoreBranch extends StatelessWidget {
? 'Delivery Tersedia'
: 'Delivery Tidak Tersedia',
style: historyOrderStyle(
color: textGreyDeskripsi,
color: (listBranch[i].isDelivery)
? successColor
: textGreyDeskripsi,
),
),
const SizedBox(
......@@ -153,7 +158,9 @@ class CoreBranch extends StatelessWidget {
? 'Pickup Tersedia'
: 'Pickup Tidak Tersedia',
style: historyOrderStyle(
color: textGreyDeskripsi,
color: (listBranch[i].isPickup)
? successColor
: textGreyDeskripsi,
),
),
],
......@@ -165,13 +172,13 @@ class CoreBranch extends StatelessWidget {
),
);
}),
),
],
);
},
);
},
),
],
),
);
}
}
......@@ -2,13 +2,11 @@
import 'dart:convert';
import 'package:byod/bloc/branch_list.dart';
import 'package:byod/bloc/member_info.dart';
import 'package:byod/helper/helper.dart';
import 'package:byod/helper/prefs.dart';
import 'package:byod/ui/no_route.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_bloc/flutter_bloc.dart';
import 'package:geolocator/geolocator.dart';
......@@ -88,6 +86,7 @@ class _SplashState extends State<Splash> {
widget.context,
getBrancList: true,
);
Future.delayed(const Duration(milliseconds: 2000), () async {
Navigator.pushReplacement(
widget.context,
MaterialPageRoute(
......@@ -95,6 +94,7 @@ class _SplashState extends State<Splash> {
),
);
});
});
} else {
Navigator.pushReplacement(
widget.context,
......@@ -285,12 +285,14 @@ class _SplashState extends State<Splash> {
}
void goToMenu(contexts) {
Future.delayed(const Duration(milliseconds: 2000), () async {
Navigator.pushReplacement(
contexts,
MaterialPageRoute(
builder: (_) => const NewHome2(),
),
);
});
}
@override
......
This diff is collapsed.
// 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:
description: flutter
source: sdk
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:
dependency: "direct main"
description:
......@@ -539,6 +560,41 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:
......@@ -555,4 +611,4 @@ packages:
version: "0.2.0+1"
sdks:
dart: ">=2.17.3 <3.0.0"
flutter: ">=3.0.0"
flutter: ">=3.1.0-0"
......@@ -33,6 +33,8 @@ dependencies:
sdk: flutter
flutter_bloc: ^8.0.1
flutter_easyloading: ^3.0.3
flutter_widget_from_html_core: ^0.8.5+3
fwfh_webview: ^0.6.2+3
geolocator: ^9.0.2
http: ^0.13.4
intl: ^0.17.0
......@@ -45,6 +47,7 @@ dependencies:
url_strategy: ^0.2.0
uuid: ^3.0.6
web_browser_detect: ^2.0.3
webview_flutter_web: ^0.1.0+4
dev_dependencies:
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