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.

80 lines
2.8KB

  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 initialIndex;
  13. PlotDetailScreen({this.cropId, this.initialIndex = 0, this.cropCode});
  14. @override
  15. _PlotDetailScreenState createState() => _PlotDetailScreenState();
  16. }
  17. class _PlotDetailScreenState extends State<PlotDetailScreen> {
  18. @override
  19. Widget build(BuildContext context) {
  20. return Container(
  21. color: COLOR_CONST.ITEM_BG,
  22. child: SafeArea(
  23. top: false,
  24. bottom: true,
  25. child: Scaffold(
  26. appBar: AppBar(
  27. centerTitle: true,
  28. title: Text("Chi tiết lô"),
  29. actions: <Widget>[
  30. IconButton(
  31. icon: Icon(FontAwesomeIcons.infoCircle),
  32. onPressed: () {
  33. Get.to(PlotInformationScreen(
  34. cropId: widget.cropId,
  35. ));
  36. })
  37. ],
  38. ),
  39. body: DefaultTabController(
  40. initialIndex: widget.initialIndex,
  41. length: 2,
  42. child: new Scaffold(
  43. backgroundColor: COLOR_CONST.ITEM_BG,
  44. body: TabBarView(
  45. children: [
  46. PlotParameterScreen(
  47. cropId: widget.cropId,
  48. ),
  49. PlotActionScreen(
  50. cropId: widget.cropId,
  51. cropCode: widget.cropCode,
  52. )
  53. ],
  54. ),
  55. bottomNavigationBar: new TabBar(
  56. tabs: [
  57. Tab(
  58. text: ''' Chỉ số ''',
  59. ),
  60. Tab(
  61. text: "Canh tác",
  62. ),
  63. ],
  64. labelColor: COLOR_CONST.DEFAULT,
  65. unselectedLabelColor: COLOR_CONST.GRAY1_70,
  66. indicatorSize: TabBarIndicatorSize.label,
  67. indicator: RoundedRectIndicator(
  68. color: COLOR_CONST.DEFAULT,
  69. radius: 2,
  70. padding: 22,
  71. weight: 3.0),
  72. ),
  73. ),
  74. ),
  75. )));
  76. }
  77. }