add rate service
This commit is contained in:
@@ -94,8 +94,12 @@ class _FAQEditorState extends State<FAQEditor> {
|
||||
_pageLink = newValue;
|
||||
});
|
||||
},
|
||||
items: <String>[info, page_buying_instructions, page_payment_methods]
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
items: <String>[
|
||||
info,
|
||||
page_buying_instructions,
|
||||
page_payment_methods,
|
||||
page_rates
|
||||
].map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(
|
||||
@@ -116,6 +120,64 @@ class _FAQEditorState extends State<FAQEditor> {
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
shadowColor: Colors.transparent,
|
||||
title: LocalText(
|
||||
context, _isNew ? 'faq.add.title' : 'faq.edit.title',
|
||||
color: primaryColor, fontSize: 20),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.delete),
|
||||
onPressed: _delete,
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Form(
|
||||
key: _formKey,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 24.0, right: 24.0),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
snBox,
|
||||
Center(child: itemTitle(context, "faq.edit.eng")),
|
||||
subItemTitle(context, "faq.edit.question",
|
||||
iconData: SimpleLineIcons.question),
|
||||
questionEngBox,
|
||||
subItemTitle(context, "faq.edit.answer",
|
||||
iconData: MaterialCommunityIcons.message_reply_text),
|
||||
answerEngBox,
|
||||
Divider(),
|
||||
Center(child: itemTitle(context, "faq.edit.mm")),
|
||||
subItemTitle(context, "faq.edit.question",
|
||||
iconData: SimpleLineIcons.question),
|
||||
questionMmBox,
|
||||
subItemTitle(context, "faq.edit.answer",
|
||||
iconData: MaterialCommunityIcons.message_reply_text),
|
||||
answerMmBox,
|
||||
Divider(),
|
||||
Center(child: itemTitle(context, "faq.edit.page")),
|
||||
pageLinkBox,
|
||||
pageLabelEngBox,
|
||||
pageLabelMmBox,
|
||||
fcsButton(context, getLocalString(context, "btn.save"),
|
||||
callack: _save),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
|
||||
LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
body: CustomScrollView(slivers: [
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:fcs/pages/faq/faq_edit_page.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/payment_methods/payment_method_page.dart';
|
||||
import 'package:fcs/pages/rates/shipment_rates.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_expansion_tile.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
@@ -43,6 +44,32 @@ class _FAQListPageState extends State<FAQListPage>
|
||||
bool isEditable = context.select((MainModel m) => m.faqEditable());
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: LocalText(
|
||||
context,
|
||||
"faq.title",
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
),
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
actions: isEditable
|
||||
? [
|
||||
IconButton(
|
||||
onPressed: () => setState(() {
|
||||
isEditMode = !isEditMode;
|
||||
}),
|
||||
icon: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
))
|
||||
]
|
||||
: [],
|
||||
),
|
||||
floatingActionButton: isEditable
|
||||
? FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -54,54 +81,11 @@ class _FAQListPageState extends State<FAQListPage>
|
||||
backgroundColor: primaryColor,
|
||||
)
|
||||
: Container(),
|
||||
body: CustomScrollView(
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
CupertinoIcons.back,
|
||||
size: 30,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
expandedHeight: 150.0,
|
||||
floating: false,
|
||||
pinned: true,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
centerTitle: true,
|
||||
titlePadding:
|
||||
EdgeInsets.symmetric(vertical: 10, horizontal: 45),
|
||||
title: LocalText(
|
||||
context,
|
||||
"faq.title",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
actions: isEditable
|
||||
? [
|
||||
IconButton(
|
||||
onPressed: () => setState(() {
|
||||
isEditMode = !isEditMode;
|
||||
}),
|
||||
icon: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
))
|
||||
]
|
||||
: [],
|
||||
),
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
return _faqItem(context, faqModel.faqs[index]);
|
||||
},
|
||||
childCount: faqModel.faqs.length,
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
body: ListView.builder(
|
||||
itemCount: faqModel.faqs.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _faqItem(context, faqModel.faqs[index]);
|
||||
}));
|
||||
}
|
||||
|
||||
bool isEditMode = false;
|
||||
@@ -177,6 +161,9 @@ class _FAQListPageState extends State<FAQListPage>
|
||||
} else if (linkPage == page_buying_instructions) {
|
||||
Navigator.of(context)
|
||||
.push(CupertinoPageRoute(builder: (context) => BuyingOnlinePage()));
|
||||
} else if (linkPage == page_rates) {
|
||||
Navigator.of(context)
|
||||
.push(CupertinoPageRoute(builder: (context) => ShipmentRates()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user