You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.0KB

  1. import 'package:farm_tpf/presentation/custom_widgets/widget_rounded_rect_indicator.dart';
  2. import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_action.dart';
  3. import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_information.dart';
  4. import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_parameter.dart';
  5. import 'package:farm_tpf/utils/const_color.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:font_awesome_flutter/font_awesome_flutter.dart';
  8. import 'package:get/get.dart';
  9. class PlotDetailScreen extends StatefulWidget {
  10. int cropId;
  11. String cropCode;
  12. int cropType;
  13. int initialIndex;
  14. PlotDetailScreen(
  15. {this.cropId,
  16. this.initialIndex = 0,
  17. this.cropCode,
  18. @required this.cropType});
  19. @override
  20. _PlotDetailScreenState createState() => _PlotDetailScreenState();
  21. }
  22. class _PlotDetailScreenState extends State<PlotDetailScreen> {
  23. @override
  24. Widget build(BuildContext context) {
  25. return Container(
  26. color: COLOR_CONST.ITEM_BG,
  27. child: SafeArea(
  28. top: false,
  29. bottom: true,
  30. child: Scaffold(
  31. appBar: AppBar(
  32. centerTitle: true,
  33. title: Text("Chi tiết lô"),
  34. actions: <Widget>[
  35. IconButton(
  36. icon: Icon(FontAwesomeIcons.infoCircle),
  37. onPressed: () {
  38. Get.to(PlotInformationScreen(
  39. cropId: widget.cropId,
  40. ));
  41. })
  42. ],
  43. ),
  44. body: DefaultTabController(
  45. initialIndex: widget.initialIndex,
  46. length: 2,
  47. child: new Scaffold(
  48. backgroundColor: COLOR_CONST.ITEM_BG,
  49. body: TabBarView(
  50. children: [
  51. PlotParameterScreen(
  52. cropId: widget.cropId,
  53. ),
  54. PlotActionScreen(
  55. cropId: widget.cropId,
  56. cropCode: widget.cropCode,
  57. cropType: widget.cropType,
  58. )
  59. ],
  60. ),
  61. bottomNavigationBar: new TabBar(
  62. tabs: [
  63. Tab(
  64. text: ''' Chỉ số ''',
  65. ),
  66. Tab(
  67. text: "Canh tác",
  68. ),
  69. ],
  70. labelColor: COLOR_CONST.DEFAULT,
  71. unselectedLabelColor: COLOR_CONST.GRAY1_70,
  72. indicatorSize: TabBarIndicatorSize.label,
  73. indicator: RoundedRectIndicator(
  74. color: COLOR_CONST.DEFAULT,
  75. radius: 2,
  76. padding: 22,
  77. weight: 3.0),
  78. ),
  79. ),
  80. ),
  81. )));
  82. }
  83. }