You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App/lib/pages/feedback/status_feedback_page.dart

144 lines
6.1 KiB
Dart

import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class StatusFeedbackPage extends StatefulWidget {
@override
_StatusFeedbackPageState createState() => _StatusFeedbackPageState();
}
class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
@override
Widget build(BuildContext context) {
return BaseView<FeedbackViewModel>(
onModelReady: (model) => model.getCOC(),
builder: (_, model, widget) => AppScaffold(
baseViewModel: model,
isShowDecPage: false,
body: model.cOCItemList.isNotEmpty
? Container(
margin: EdgeInsets.only(
top: 8.0, left: 8.0, right: 8.0, bottom: 80),
padding: EdgeInsets.all(15.0),
child: ListView.builder(
itemCount: model.cOCItemList.length,
itemBuilder: (context, index) => InkWell(
onTap: () {
gotodetails(model.cOCItemList[index]);
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
margin: EdgeInsets.all(4),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
'${model.cOCItemList[index].cOCTitle}'),
Texts(
TranslationBase.of(context).number +
' : ${model.cOCItemList[index].itemID}',
variant: 'overline',
),
],
),
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
'${model.cOCItemList[index].status}'),
Texts(
'${model.cOCItemList[index].date}',
variant: 'overline',
),
],
),
),
],
),
Texts('${model.cOCItemList[index].formType}'),
Divider(
height: 4.5,
color: Colors.grey[500],
)
],
),
),
))),
)
: Container(
child: Center(
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.4,
),
Image.asset(
'assets/images/comments.png',
width: 80,
height: 80,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).noSearchResult),
],
),
),
),
bottomSheet: Container(
height: 80,
width: double.infinity,
padding: EdgeInsets.all(15.0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.1,
child: SecondaryButton(
label: TranslationBase.of(context).search,
textColor: Colors.white,
disabled: true,
onTap: () {},
),
),
),
),
),
);
}
gotodetails(item) {
Navigator.pushReplacement(
context, FadePage(page: FeedbackDetails(items: item)));
}
}