123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- import 'package:fis_i18n/i18n.dart';
- import 'package:fis_ui/index.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:vitalapp/components/button.dart';
- import 'package:vitalapp/pages/medical_checkup_station/appointment/state/list.dart';
- import 'package:vitalapp/pages/medical_checkup_station/appointment/widgets/filter.dart';
- import 'package:vitalapp/pages/medical_checkup_station/appointment/widgets/form.dart';
- import 'package:vitalapp/pages/medical_checkup_station/appointment/widgets/table.dart';
- import 'controller.dart';
- class AppointmentPage extends GetView<AppointmentController> {
- const AppointmentPage({Key? key}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return GetBuilder<AppointmentController>(
- id: "appointment",
- builder: (_) {
- return Scaffold(
- body: SafeArea(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- AppointmentFilter(),
- _buildCreateAppointment(),
- ],
- ),
- _buildAppointmentTable(),
- _buildTablePagination(),
- SizedBox(
- height: 16,
- )
- ],
- ),
- ),
- // floatingActionButton: _buildCreateAppointment(),
- );
- },
- );
- }
- Widget _buildAppointmentTable() {
- return GetBuilder<AppointmentController>(
- id: "appointment_table",
- builder: (_) {
- return Expanded(
- child: AppointmentTable(
- appointmentList: controller.appointmentModelList,
- ),
- );
- },
- );
- }
- Widget _buildCreateAppointment() {
- return Container(
- width: 180,
- margin: EdgeInsets.only(right: 20),
- child: VButton(
- onTap: () async {
- controller.appointment = AppointmentModel(
- appointmentName: '',
- appointmentAddress: '',
- );
- await Get.dialog<AppointmentModel>(
- AppointmentFormDialog(appointment: controller.appointment),
- barrierDismissible: false,
- );
- },
- child: FText(
- "新建",
- style: TextStyle(color: Colors.white, fontSize: 22),
- ),
- ),
- );
- }
- Widget _buildTablePagination() {
- return GetBuilder<AppointmentController>(
- id: "appointment_table_pagination",
- builder: (_) {
- return Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- FTablePagination(
- currListLength: controller.appointmentModelListLength,
- currPageIndex: controller.currPageIndex,
- pageSize: 10,
- onChangePage: (pageIndex, listLength) {
- controller.listController.getHealthExamBookingPageAsync(
- pageIndex: pageIndex,
- pageSize: listLength,
- );
- // _tableScrollToTop();
- },
- totalItemNumText: i18nBook.common.ofTerm
- .translate(['${controller.appointmentModelListLength}']),
- previousFivePageText: i18nBook.common.previousFivePageText.t,
- nextFivePageText: i18nBook.common.nextFivePageText.t,
- ),
- SizedBox(
- width: 20,
- )
- ],
- );
- },
- );
- }
- }
|