update my_service_tabs, edit other_menu tabs

parent 44deca23
...@@ -19,7 +19,8 @@ class MyApp extends StatelessWidget { ...@@ -19,7 +19,8 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
), ),
// home: AccountSettingPage(), // home: AccountSettingPage(),
home: service_tab(), home: OtherMenuPage(),
// home: service_tab(),
// home: SplashScreenPage(), // home: SplashScreenPage(),
); );
} }
......
import 'package:feelverapp/ui/my_service/service_paid.dart';
import 'package:feelverapp/ui/my_service/service_ready.dart';
import 'package:feelverapp/ui/my_service/service_success.dart';
import 'package:feelverapp/ui/my_service/service_ticket.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'my_ticket.dart';
class service_tab extends StatefulWidget { class service_tab extends StatefulWidget {
@override @override
...@@ -66,61 +69,61 @@ class _service_tabState extends State<service_tab> with SingleTickerProviderStat ...@@ -66,61 +69,61 @@ class _service_tabState extends State<service_tab> with SingleTickerProviderStat
indicatorColor: Colors.transparent, indicatorColor: Colors.transparent,
controller: controller, controller: controller,
tabs: [ tabs: [
Container( new Tab(
// icon: Icon(Icons.assignment,
child: new Tab( icon: Icon(Icons.system_update,
icon: Icon(Icons.assignment,
color: controller.index == 0 color: controller.index == 0
? Colors.yellowAccent: Colors.white), ? Colors.yellowAccent: Colors.white),
child:Text( child:Text(
'ข้อมูลร้าน', 'การจอง',
style: TextStyle( style: TextStyle(
color: controller.index == 0 color: controller.index == 0
? Colors.yellowAccent: Colors.white, ? Colors.yellowAccent: Colors.white,
fontSize: 11 fontSize: 11
), ),
), textAlign: TextAlign.center,
), ),
), ),
new Tab( new Tab(
icon: Icon(Icons.loyalty, icon: Icon(Icons.check_circle,
color: controller.index == 1 color: controller.index == 1
? Colors.yellowAccent: Colors.white), ? Colors.yellowAccent: Colors.white),
child:Text( child:Text(
'บริการ', 'บริการที่พร้อมใช้งาน',
style: TextStyle( style: TextStyle(
color: controller.index == 1 color: controller.index == 1
? Colors.yellowAccent: Colors.white, ? Colors.yellowAccent: Colors.white,
fontSize: 11 fontSize: 11
), ),
textAlign: TextAlign.center,
), ),
), ),
new Tab( new Tab(
icon: Icon(Icons.star, icon: Icon(Icons.credit_card,
color: controller.index == 2 color: controller.index == 2
? Colors.yellowAccent: Colors.white), ? Colors.yellowAccent: Colors.white),
child:Text( child:Text(
'รีวิว', 'บริการที่ต้องชำระ',
style: TextStyle( style: TextStyle(
color: controller.index == 2 color: controller.index == 2
? Colors.yellowAccent: Colors.white, ? Colors.yellowAccent: Colors.white,
fontSize: 11 fontSize: 11
), ),
textAlign: TextAlign.center,
), ),
), ),
Container( Container(
width: 200, width: 200,
child: Tab( child: Tab(
icon: Icon(Icons.pin_drop, icon: Icon(Icons.thumb_up,
color: controller.index == 3 color: controller.index == 3
? Colors.yellowAccent: Colors.white), ? Colors.yellowAccent: Colors.white),
child: child:
Text( Text(
'สถานที่ใกล้เคียง',maxLines: 1, 'บริการที่แล้วเสร็จ',maxLines: 1,
style: TextStyle( style: TextStyle(
color: controller.index == 3 color: controller.index == 3
? Colors.yellowAccent: Colors.white, ? Colors.yellowAccent: Colors.white,
...@@ -147,23 +150,11 @@ class _service_tabState extends State<service_tab> with SingleTickerProviderStat ...@@ -147,23 +150,11 @@ class _service_tabState extends State<service_tab> with SingleTickerProviderStat
///onWillPop: onWillPop, ///onWillPop: onWillPop,
child: getTabBarView(<Widget>[ child: getTabBarView(<Widget>[
myTicketPage(), ServiceTicketPage(),
ServiceReadyPage(),
ServicePaidPage(),
ServiceSuccessPage(),
Container(
width: double.infinity,
height: double.infinity,
color: Colors.green,
),
Container(
width: double.infinity,
height: double.infinity,
color: Colors.yellow,
),
Container(
width: double.infinity,
height: double.infinity,
color: Colors.blue,
),
]), ]),
......
import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/material.dart';
class ServicePaidPage extends StatefulWidget {
@override
_ServicePaidPageState createState() => _ServicePaidPageState();
}
class _ServicePaidPageState extends State<ServicePaidPage> {
@override
Widget build(BuildContext context) {
SizeConfig(context);
return Container(
child: ListView(
children: <Widget>[
myCard(),
],
),
);
}
Widget myCard(){
return Card(
margin: EdgeInsets.only(right: SizeConfig.getPadding(16),left: SizeConfig.getPadding(16),top: SizeConfig.getPadding(20),bottom: SizeConfig.getPadding(10)),
child: Container(
margin: EdgeInsets.only(right: 15,left: 15,bottom: 20,top: 20),
// color: Colors.yellow,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Container(
// color: Colors.blue,
height: SizeConfig.getHeight(200),
child: Image.asset("assets/images/demo_img.png",
fit: BoxFit.cover,),
),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.only(left: 15),
// color: Colors.yellow,
height: SizeConfig.getHeight(200),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
alignment: Alignment.topLeft,
// color: Colors.red,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Thai Body Balance",style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),),
SizedBox(
height: 5,
),
Text("SPA Cenvaree @ Centara Grand CentralWorld Bangkok",style: TextStyle(
color: Color(0xff969696),
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),),
],
),
),
Container(
padding: EdgeInsets.only(left: 10,right: 10),
alignment: Alignment.topLeft,
// color: Colors.blue,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(Icons.access_time,color: Color(0xffEEAFB7),),
SizedBox(
width: 5,
),
Text("150 Min",style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(13),
fontFamily: "SF_Pro_Text",
),),
],
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text("฿599.0",style: TextStyle(fontSize: SizeConfig.getFontSize(12),decoration: TextDecoration.lineThrough,),),
SizedBox(
width: 15,
),
Text("฿199.00",style: TextStyle(
color: Colors.red,
fontSize: SizeConfig.getFontSize(18),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),),
],
),
],
),
),
Expanded(
child: Container(
// color: Colors.blue,
padding: EdgeInsets.only(left: 10,right: 10,top: 10,bottom: 10),
alignment: Alignment.bottomLeft,
child: Text("ราคาพิเศษนี้ได้รับ \nเมื่อชำระเงินออนไลน์",style: TextStyle(
color: Color(0xff6AB3AA),
fontSize: SizeConfig.getFontSize(14),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),),
),
),
],
),
),
),
],
),
Container(
width: double.infinity,
padding: EdgeInsets.only(bottom: SizeConfig.getPadding(10),top: SizeConfig.getPadding(20),left: 0,right: 0),
height: SizeConfig.getHeight(80),
// color: Colors.blue,
child: RaisedButton(
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(180.0)),
child: Text(
"Payment",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
color: Color(0xffE8A6B4),
onPressed: () {
}
),
),
],
)
),
);
}
}
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class myTicketPage extends StatefulWidget { class ServiceTicketPage extends StatefulWidget {
@override @override
_myTicketPageState createState() => _myTicketPageState(); _ServiceTicketPageState createState() => _ServiceTicketPageState();
} }
class _myTicketPageState extends State<myTicketPage> { class _ServiceTicketPageState extends State<ServiceTicketPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
import 'dart:ui'; import 'dart:ui';
import 'package:feelverapp/ui/booking/bookingflow.dart';
import 'package:feelverapp/ui/home/home.dart';
import 'package:feelverapp/ui/reserve/reserve_date_time.dart';
import 'package:feelverapp/util/AppBar.dart'; import 'package:feelverapp/util/AppBar.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
...@@ -13,7 +10,30 @@ class OtherMenuPage extends StatefulWidget { ...@@ -13,7 +10,30 @@ class OtherMenuPage extends StatefulWidget {
_OtherMenuPageState createState() => _OtherMenuPageState(); _OtherMenuPageState createState() => _OtherMenuPageState();
} }
class _OtherMenuPageState extends State<OtherMenuPage> { class _OtherMenuPageState extends State<OtherMenuPage> with SingleTickerProviderStateMixin{
TabController controller;
@override
void initState() {
// TODO: implement initState
super.initState();
controller = new TabController(length: 3, vsync: this);
controller.addListener(_handleTabSelection);
}
@override
void dispose() {
// TODO: implement dispose
controller.dispose();
super.dispose();
}
void _handleTabSelection() {
setState(() {
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SizeConfig(context); SizeConfig(context);
...@@ -32,7 +52,6 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -32,7 +52,6 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
); );
} }
Widget containt(){ Widget containt(){
return Container( return Container(
child: Column( child: Column(
...@@ -41,15 +60,19 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -41,15 +60,19 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
height: SizeConfig.getHeight(160), height: SizeConfig.getHeight(160),
), ),
Expanded( Expanded(
child: SingleChildScrollView(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
buttonBar(), // buttonBar(),
Card1(), SizedBox(
Card2(), height: 60,
LogoutButton(),
],
), ),
getTabBar(),
Expanded(
child: Container(
child: containTab()
),
),
],
), ),
), ),
], ],
...@@ -84,7 +107,7 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -84,7 +107,7 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
Widget Card1(){ Widget Card1(){
return Card( return Card(
margin: EdgeInsets.only(right: SizeConfig.getPadding(16),left: SizeConfig.getPadding(16),top: SizeConfig.getPadding(10),bottom: SizeConfig.getPadding(10)), margin: EdgeInsets.only(right: SizeConfig.getPadding(16),left: SizeConfig.getPadding(16),top: SizeConfig.getPadding(0),bottom: SizeConfig.getPadding(10)),
child: Container( child: Container(
margin: EdgeInsets.only(right: 10,left: 10), margin: EdgeInsets.only(right: 10,left: 10),
// color: Colors.yellow, // color: Colors.yellow,
...@@ -181,6 +204,7 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -181,6 +204,7 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
); );
} }
Widget Card2(){ Widget Card2(){
return Card( return Card(
margin: EdgeInsets.only(right: SizeConfig.getPadding(16),left: SizeConfig.getPadding(16),top: SizeConfig.getPadding(10),bottom: SizeConfig.getPadding(10)), margin: EdgeInsets.only(right: SizeConfig.getPadding(16),left: SizeConfig.getPadding(16),top: SizeConfig.getPadding(10),bottom: SizeConfig.getPadding(10)),
...@@ -230,90 +254,7 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -230,90 +254,7 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
); );
} }
Widget buttonBar(){
return Container(
child: Row(
children: <Widget>[
Expanded(
child: Container(
height: SizeConfig.getHeight(130),
padding: EdgeInsets.only(bottom: SizeConfig.getHeight(10)),
// color: Colors.green,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Image.asset("assets/images/icon_menu1_gray.png",
width: SizeConfig.getWidth(20),
height: SizeConfig.getHeight(30),
fit: BoxFit.cover,),
SizedBox(
height: SizeConfig.getHeight(8),
),
Text("การจองของฉัน",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),)
],
),
),
),
Expanded(
child: Container(
height: SizeConfig.getHeight(130),
padding: EdgeInsets.only(bottom: SizeConfig.getHeight(10)),
// color: Colors.blue,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Image.asset("assets/images/icon_menu2_gray.png",
width: SizeConfig.getWidth(20),
height: SizeConfig.getHeight(30),
fit: BoxFit.cover,),
SizedBox(
height: SizeConfig.getHeight(5),
),
Text("ประวัติการใช้บริการ",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),)
],
),
),
),
Expanded(
child: Container(
height: SizeConfig.getHeight(130),
padding: EdgeInsets.only(bottom: SizeConfig.getHeight(10)),
// color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Image.asset("assets/images/icon_menu3_gray.png",
width: SizeConfig.getWidth(20),
height: SizeConfig.getHeight(30),
fit: BoxFit.cover,),
SizedBox(
height: SizeConfig.getHeight(5),
),
Text("การแจ้งเตือน",
style: TextStyle(
color: Colors.black,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),)
],
),
),
),
],
),
);
}
Widget header(){ Widget header(){
return Container( return Container(
...@@ -322,8 +263,6 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -322,8 +263,6 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Column( Column(
children: <Widget>[ children: <Widget>[
Container( Container(
...@@ -409,8 +348,6 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -409,8 +348,6 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
), ),
], ],
), ),
], ],
), ),
...@@ -423,4 +360,119 @@ class _OtherMenuPageState extends State<OtherMenuPage> { ...@@ -423,4 +360,119 @@ class _OtherMenuPageState extends State<OtherMenuPage> {
), ),
); );
} }
TabBar getTabBar() {
return new TabBar(
indicatorColor: Colors.transparent,
controller: controller,
tabs: [
new Tab(
icon: Icon(Icons.system_update,
color: controller.index == 0
? Color(0xff6AB3AA): Colors.grey,
size: SizeConfig.getFontSize(24),
),
child:Text(
'การจองของฉัน',
style: TextStyle(
color: controller.index == 0
? Color(0xff6AB3AA): Colors.black,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
),
new Tab(
icon: Icon(Icons.assignment,
color: controller.index == 1
? Color(0xff6AB3AA): Colors.grey,
size: SizeConfig.getFontSize(24),
),
child:Text(
'ประวัติการใช้บริการ',
style: TextStyle(
color: controller.index == 1
? Color(0xff6AB3AA): Colors.black,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
),
new Tab(
icon: Icon(Icons.notifications,
color: controller.index == 2
? Color(0xff6AB3AA): Colors.grey,
size: SizeConfig.getFontSize(24),
),
child:Text(
'การแจ้งเตือน',
style: TextStyle(
color: controller.index == 2
? Color(0xff6AB3AA): Colors.black,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
),
],
);
}
TabBarView getTabBarView(var tabs) {
return new TabBarView(
// Add tabs as widgets
children: tabs,
// set the controller
controller: controller,
);
}
Widget containTab(){
return WillPopScope(
///onWillPop: onWillPop,
child: getTabBarView(<Widget>[
Container(
padding: EdgeInsets.only(top: 10),
// color: Colors.red,
height: double.infinity,
width: double.infinity,
child: ListView(
padding: EdgeInsets.all(0),
children: <Widget>[
Card1(),
Card2(),
LogoutButton(),
],
),
),
Container(
color: Colors.blue,
height: double.infinity,
width: double.infinity,
),
Container(
color: Colors.green,
height: double.infinity,
width: double.infinity,
),
]),
);
}
} }
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