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.

83 lines
2.9KB

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