no message

merge-requests/337/head
Zohaib Iqbal Kambrani 4 years ago
parent 08e0ce52c8
commit 5f1d753895

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -120,7 +121,7 @@ class _ErOptionsState extends State<ErOptions> {
Navigator.push(
context,
FadePage(
page: NearestEr()));
page: RRTMainScreen()));
}),
)
],

@ -0,0 +1,87 @@
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 Center(
child: 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,76 @@
import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-logs-page.dart';
import 'package:diplomaticquarterapp/pages/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);
@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.only(left: 15, right: 15, top: 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,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RRTRequestPage extends StatefulWidget{
@override
State<StatefulWidget> createState() => RRTRequestPageState();
}
class RRTRequestPageState extends State<RRTRequestPage>{
@override
Widget build(BuildContext context) {
return ListView(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
children: [
serviceDescription(context),
SizedBox(height: 20),
priceTable(context),
],
);
}
Widget serviceDescription(BuildContext context) =>
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
"The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home",
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("Approximate Service Fee", style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))),
)
],
);
}
}
Loading…
Cancel
Save