| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
| import 'package:get/get.dart'; | |||||
| import 'authentication/bloc/authentication_bloc.dart'; | import 'authentication/bloc/authentication_bloc.dart'; | ||||
| import 'data/repository/authentication_repository.dart'; | import 'data/repository/authentication_repository.dart'; | ||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return MaterialApp( | |||||
| return GetMaterialApp( | |||||
| debugShowCheckedModeBanner: false, | debugShowCheckedModeBanner: false, | ||||
| theme: ThemeData( | theme: ThemeData( | ||||
| backgroundColor: Colors.white, | backgroundColor: Colors.white, |
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; | import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot/widget_search.dart'; | import 'package:farm_tpf/presentation/screens/plot/widget_search.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart'; | import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_information.dart'; | |||||
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
| import 'package:farm_tpf/utils/const_string.dart'; | import 'package:farm_tpf/utils/const_string.dart'; | ||||
| import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||||
| import 'package:farm_tpf/utils/formatter.dart'; | import 'package:farm_tpf/utils/formatter.dart'; | ||||
| import 'package:get/get.dart'; | |||||
| import 'bloc/plot_bloc.dart'; | import 'bloc/plot_bloc.dart'; | ||||
| centerTitle: true, | centerTitle: true, | ||||
| title: Text("Danh sách lô"), | title: Text("Danh sách lô"), | ||||
| actions: <Widget>[ | actions: <Widget>[ | ||||
| IconButton(icon: Icon(FontAwesomeIcons.qrcode), onPressed: () {}) | |||||
| IconButton( | |||||
| icon: Icon(FontAwesomeIcons.infoCircle), | |||||
| onPressed: () { | |||||
| Get.to(PlotInformationScreen()); | |||||
| }) | |||||
| ], | ], | ||||
| ), | ), | ||||
| body: InfinityView()); | body: InfinityView()); |
| import 'package:farm_tpf/presentation/custom_widgets/widget_rounded_rect_indicator.dart'; | import 'package:farm_tpf/presentation/custom_widgets/widget_rounded_rect_indicator.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_action.dart'; | import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_action.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_information.dart'; | import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_information.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_parameter.dart'; | |||||
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| child: new Scaffold( | child: new Scaffold( | ||||
| backgroundColor: COLOR_CONST.ITEM_BG, | backgroundColor: COLOR_CONST.ITEM_BG, | ||||
| body: TabBarView( | body: TabBarView( | ||||
| children: [PlotInformationScreen(), PlotActionScreen()], | |||||
| children: [PlotParameterScreen(), PlotActionScreen()], | |||||
| ), | ), | ||||
| bottomNavigationBar: new TabBar( | bottomNavigationBar: new TabBar( | ||||
| tabs: [ | tabs: [ | ||||
| Tab( | Tab( | ||||
| text: "Thông tin", | |||||
| text: "Chỉ số", | |||||
| ), | ), | ||||
| Tab( | Tab( | ||||
| text: "Canh tác", | text: "Canh tác", |
| import 'package:farm_tpf/models/Plot.dart'; | |||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_media_helper.dart'; | import 'package:farm_tpf/presentation/custom_widgets/widget_media_helper.dart'; | ||||
| import 'package:farm_tpf/utils/const_color.dart'; | |||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:keyboard_dismisser/keyboard_dismisser.dart'; | |||||
| class PlotInformationScreen extends StatefulWidget { | class PlotInformationScreen extends StatefulWidget { | ||||
| final Plot plot; | |||||
| PlotInformationScreen({this.plot}); | |||||
| @override | @override | ||||
| _PlotInformationScreenState createState() => _PlotInformationScreenState(); | _PlotInformationScreenState createState() => _PlotInformationScreenState(); | ||||
| } | } | ||||
| class _PlotInformationScreenState extends State<PlotInformationScreen> { | class _PlotInformationScreenState extends State<PlotInformationScreen> { | ||||
| @override | |||||
| Widget build(BuildContext context) { | |||||
| return Container(); | |||||
| final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); | |||||
| GlobalKey<FormState> _formKey = GlobalKey(); | |||||
| bool _autoValidate = false; | |||||
| Plot _plot = Plot(); | |||||
| _validateInputs() async { | |||||
| if (_formKey.currentState.validate()) { | |||||
| _formKey.currentState.save(); | |||||
| } else { | |||||
| _autoValidate = true; | |||||
| } | |||||
| } | |||||
| Widget _statusField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Trạng thái"), | |||||
| ); | |||||
| } | |||||
| Widget _houseNameField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Nhà màng"), | |||||
| ); | |||||
| } | |||||
| Widget _codeField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Mã lô"), | |||||
| ); | |||||
| } | |||||
| Widget _supplyNameField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Giống"), | |||||
| ); | |||||
| } | |||||
| Widget _seedingDateField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Ngày gieo trồng"), | |||||
| ); | |||||
| } | |||||
| Widget _timeSoakSeedField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Thời gian ngâm hạt"), | |||||
| ); | |||||
| } | |||||
| Widget _timeNurserySeedField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Thời gian vô khây ươm"), | |||||
| ); | |||||
| } | } | ||||
| Widget _quantityPlantField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Số lượng cây trồng"), | |||||
| ); | |||||
| } | |||||
| Widget _currentPlantField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Số lượng cây hiện tại"), | |||||
| ); | |||||
| } | |||||
| Widget _timeEndGrowField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Ngày kết thúc canh tác"), | |||||
| ); | |||||
| } | |||||
| Widget _mainTechnicianField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Kỹ sư trực tiếp"), | |||||
| ); | |||||
| } | |||||
| Widget _areaField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Diện tích (m\u00B2)"), | |||||
| ); | |||||
| } | |||||
| Widget _descriptionField() { | |||||
| return TextFormField( | |||||
| decoration: InputDecoration(labelText: "Ghi chú"), | |||||
| ); | |||||
| } | |||||
| _actionAppBar() { | |||||
| IconButton iconButton; | |||||
| if (_plot.id != null) { | |||||
| iconButton = IconButton( | |||||
| icon: Icon( | |||||
| Icons.done, | |||||
| color: COLOR_CONST.DEFAULT, | |||||
| ), | |||||
| onPressed: () {}, | |||||
| ); | |||||
| return <Widget>[iconButton]; | |||||
| } | |||||
| return <Widget>[Container()]; | |||||
| } | |||||
| @override | |||||
| Widget build(BuildContext context) => KeyboardDismisser( | |||||
| gestures: [ | |||||
| GestureType.onTap, | |||||
| GestureType.onPanUpdateDownDirection, | |||||
| ], | |||||
| child: Container( | |||||
| color: COLOR_CONST.ITEM_BG, | |||||
| child: SafeArea( | |||||
| top: false, | |||||
| bottom: true, | |||||
| child: Scaffold( | |||||
| key: _scaffoldKey, | |||||
| appBar: AppBar( | |||||
| centerTitle: true, | |||||
| title: Text("Thông tin lô"), | |||||
| actions: _actionAppBar()), | |||||
| body: KeyboardDismisser( | |||||
| child: Form( | |||||
| key: _formKey, | |||||
| autovalidate: _autoValidate, | |||||
| child: SingleChildScrollView( | |||||
| padding: EdgeInsets.all(8.0), | |||||
| child: Column( | |||||
| children: <Widget>[ | |||||
| _statusField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _houseNameField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _codeField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _supplyNameField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _seedingDateField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _timeSoakSeedField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _timeNurserySeedField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _quantityPlantField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _currentPlantField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _timeEndGrowField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _mainTechnicianField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _areaField(), | |||||
| SizedBox( | |||||
| height: 4.0, | |||||
| ), | |||||
| _descriptionField() | |||||
| ], | |||||
| ), | |||||
| ))))))); | |||||
| } | } |
| import 'package:flutter/material.dart'; | |||||
| class PlotParameterScreen extends StatefulWidget { | |||||
| @override | |||||
| _PlotParameterScreenState createState() => _PlotParameterScreenState(); | |||||
| } | |||||
| class _PlotParameterScreenState extends State<PlotParameterScreen> { | |||||
| @override | |||||
| Widget build(BuildContext context) { | |||||
| return Container(); | |||||
| } | |||||
| } |
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.3.0" | version: "0.3.0" | ||||
| get: | |||||
| dependency: "direct main" | |||||
| description: | |||||
| name: get | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "3.8.0" | |||||
| glob: | glob: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| source: hosted | source: hosted | ||||
| version: "2.2.1" | version: "2.2.1" | ||||
| sdks: | sdks: | ||||
| dart: ">=2.7.0 <3.0.0" | |||||
| dart: ">=2.8.0 <3.0.0" | |||||
| flutter: ">=1.16.0 <2.0.0" | flutter: ">=1.16.0 <2.0.0" |
| package_info: ^0.4.3 | package_info: ^0.4.3 | ||||
| change_app_package_name: ^0.1.2 | change_app_package_name: ^0.1.2 | ||||
| firebase_messaging: ^7.0.0 | firebase_messaging: ^7.0.0 | ||||
| get: ^3.8.0 | |||||
| dev_dependencies: | dev_dependencies: | ||||
| flutter_test: | flutter_test: |