merge changes-2
parent
14561d0ac6
commit
c07a8f54c7
@ -0,0 +1,48 @@
|
||||
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
import '../base_view_model.dart';
|
||||
|
||||
|
||||
class RRTService extends BaseService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
class RRTViewModel extends BaseViewModel{
|
||||
var _service = RRTService();
|
||||
|
||||
Future createRequest(){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Future getAllRequest(){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Future getRequestDetails(){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Future getAllQuestions(){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Future getCancelReasons(){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Future cancelRequest(){
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class RRTLogPage extends StatefulWidget{
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => RRTLogPageState();
|
||||
|
||||
}
|
||||
class RRTLogPageState extends State<RRTLogPage>{
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<RRTViewModel>(
|
||||
onModelReady: (viewModel){
|
||||
|
||||
},
|
||||
builder: (ctx, vm, widget){
|
||||
return ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (ctx, idx) => RRTLogListItem()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------------------
|
||||
// List Item Widget
|
||||
// ------------------------
|
||||
|
||||
|
||||
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
|
||||
|
||||
class RRTLogListItem extends StatelessWidget{
|
||||
BuildContext _context;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_context = context;
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_contentItem(label: "Request ID", value: "2318"),
|
||||
_item_content_seperator,
|
||||
_contentItem(label: "Status", value: "2318"),
|
||||
_item_content_seperator,
|
||||
_contentItem(label: "Pickup Date", value: "2318"),
|
||||
_item_content_seperator,
|
||||
_contentItem(label: "Location", value: "2318"),
|
||||
_item_content_seperator,
|
||||
SizedBox(height: 10),
|
||||
FractionallySizedBox(child: cancelButton())
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _contentItem({@required String label, String value}){
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),),
|
||||
SizedBox(height: 5,),
|
||||
Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget cancelButton() => MaterialButton(
|
||||
height: 45,
|
||||
color: Color(0xFFc5272d),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
|
||||
onPressed: () { },
|
||||
child: Text("CANCEL", style: TextStyle(color: Colors.white, fontSize: 13),),
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
|
||||
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RRTMainScreen extends StatefulWidget{
|
||||
@override
|
||||
State<StatefulWidget> createState() => RRTMainScreenState();
|
||||
}
|
||||
|
||||
class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderStateMixin{
|
||||
|
||||
int currentIndex = 0;
|
||||
TabController tabController;
|
||||
PageController pageController = PageController(initialPage: 0, keepPage: true);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
tabController = TabController(length: 2, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return AppScaffold(
|
||||
appBarTitle: 'Rapid Response Team',
|
||||
isShowAppBar: true,
|
||||
body: Column(
|
||||
children: [
|
||||
tabBar(),
|
||||
Expanded(
|
||||
child: contentPager()
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tabBar() => Container(
|
||||
margin: EdgeInsets.all(15),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
|
||||
child: TabBar(
|
||||
onTap: onPageChanged,
|
||||
indicatorWeight: 3,
|
||||
indicatorColor: Color(0xFFc5272d),
|
||||
isScrollable: false,
|
||||
controller: tabController,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Text("Rapid Response Team", style: TextStyle(color: Theme.of(context).appBarTheme.color),),
|
||||
),
|
||||
Tab(
|
||||
child: Text("Order Log", style: TextStyle(color: Theme.of(context).appBarTheme.color),),
|
||||
),
|
||||
]
|
||||
),
|
||||
);
|
||||
|
||||
Widget contentPager() => PageView(
|
||||
onPageChanged: onPageChanged,
|
||||
controller: pageController,
|
||||
children: [
|
||||
RRTRequestPage(),
|
||||
RRTLogPage(),
|
||||
],
|
||||
);
|
||||
|
||||
void onPageChanged(int index) {
|
||||
pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut);
|
||||
tabController.animateTo(index);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class RRTRequestPickupAddressPage extends StatefulWidget{
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => RRTRequestPickupAddressPageState();
|
||||
|
||||
}
|
||||
class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage>{
|
||||
bool acceptTerms = false;
|
||||
Completer<GoogleMapController> mapController = Completer();
|
||||
|
||||
static final CameraPosition mapCamera = CameraPosition(
|
||||
target: LatLng(37.42796133580664, -122.085749655962),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<RRTViewModel>(
|
||||
onModelReady: (viewModel){
|
||||
|
||||
},
|
||||
builder: (ctx, vm, widget) => AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).pickupLocation,
|
||||
isShowAppBar: true,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
selectAddress(),
|
||||
Expanded(
|
||||
child: GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
initialCameraPosition: mapCamera,
|
||||
onCameraIdle: (){
|
||||
|
||||
},
|
||||
onMapCreated: (controller){
|
||||
mapController.complete(controller);
|
||||
},
|
||||
)
|
||||
),
|
||||
continueButton()
|
||||
],
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Widget selectAddress(){
|
||||
return Container(
|
||||
margin: EdgeInsets.all(15),
|
||||
child: Expanded(
|
||||
child: MaterialButton(
|
||||
height: 50,
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
|
||||
onPressed: () { },
|
||||
child: Row(
|
||||
children: [
|
||||
Text(TranslationBase.of(context).selectAddress, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
|
||||
Spacer(),
|
||||
Icon(Icons.keyboard_arrow_down, size: 15, color: Colors.grey,)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget continueButton(){
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: MaterialButton(
|
||||
height: 50,
|
||||
color: Theme.of(context).appBarTheme.color,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
|
||||
onPressed: () { },
|
||||
child: Text(TranslationBase.of(context).continues, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RRTRequestPage extends StatefulWidget{
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => RRTRequestPageState();
|
||||
|
||||
}
|
||||
class RRTRequestPageState extends State<RRTRequestPage>{
|
||||
bool acceptTerms = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<RRTViewModel>(
|
||||
onModelReady: (viewModel){
|
||||
|
||||
},
|
||||
builder: (ctx, vm, widget) => Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
children: [
|
||||
serviceDescription(context),
|
||||
SizedBox(height: 20),
|
||||
priceTable(context),
|
||||
|
||||
acceptPolicy(),
|
||||
|
||||
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator
|
||||
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20, bottom: 5),
|
||||
alignment: Alignment.center,
|
||||
child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)
|
||||
),
|
||||
|
||||
paymentOptions(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
actionButtons()
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Widget serviceDescription(BuildContext context) =>
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Text(
|
||||
TranslationBase.of(context).RRTDDetails,
|
||||
textAlign: TextAlign.justify,
|
||||
style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300),
|
||||
),
|
||||
);
|
||||
|
||||
Widget priceTable(BuildContext context){
|
||||
var radius = Radius.circular(8);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Container(
|
||||
height: 30,
|
||||
decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)),
|
||||
child: Center(child: Text(TranslationBase.of(context).ApproximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))),
|
||||
),
|
||||
|
||||
pricingRow(label: TranslationBase.of(context).AmountBeforeTax, value: '500 SAR'),
|
||||
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
|
||||
|
||||
pricingRow(label: TranslationBase.of(context).TaxAmount, value: '50 SAR'),
|
||||
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
|
||||
|
||||
pricingRow(label: TranslationBase.of(context).TotalAmountPayable, value: '550 SAR', labelBold: true),
|
||||
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}){
|
||||
return
|
||||
Container(
|
||||
height: 40, margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)),
|
||||
Spacer(),
|
||||
Container(height: 40, color: Theme.of(context).appBarTheme.color, width: 0.5,),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
width: MediaQuery.of(context).size.width * 0.25,
|
||||
child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal))
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget acceptPolicy(){
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(value: acceptTerms, onChanged: (v){
|
||||
setState(() => acceptTerms = v);
|
||||
}),
|
||||
SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
width: MediaQuery.of(context).size.width * 0.25,
|
||||
child: TextButton(
|
||||
child: Text(TranslationBase.of(context).clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)),
|
||||
onPressed: (){
|
||||
|
||||
}
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget paymentOptions()=> Container(
|
||||
height: 30,
|
||||
alignment: Alignment.center,
|
||||
child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,)
|
||||
);
|
||||
|
||||
Widget actionButtons(){
|
||||
return Container(
|
||||
margin: EdgeInsets.all(15),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: MaterialButton(
|
||||
height: 50,
|
||||
color: Theme.of(context).appBarTheme.color,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
|
||||
onPressed: () { },
|
||||
child: Text(TranslationBase.of(context).cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
|
||||
|
||||
),
|
||||
),
|
||||
SizedBox(width: 20,),
|
||||
Expanded(
|
||||
child: MaterialButton(
|
||||
height: 50,
|
||||
color: Theme.of(context).appBarTheme.color,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
|
||||
child: Text(TranslationBase.of(context).ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: RRTRequestPickupAddressPage()));
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue