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.

78 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. PlotActionScreen(
  48. cropId: widget.cropId,
  49. cropCode: widget.cropCode,
  50. )
  51. ],
  52. ),
  53. bottomNavigationBar: new TabBar(
  54. tabs: [
  55. Tab(
  56. text: ''' Chỉ số ''',
  57. ),
  58. Tab(
  59. text: "Canh tác",
  60. ),
  61. ],
  62. labelColor: COLOR_CONST.DEFAULT,
  63. unselectedLabelColor: COLOR_CONST.GRAY1_70,
  64. indicatorSize: TabBarIndicatorSize.label,
  65. indicator: RoundedRectIndicator(
  66. color: COLOR_CONST.DEFAULT,
  67. radius: 2,
  68. padding: 22,
  69. weight: 3.0),
  70. ),
  71. ),
  72. ),
  73. )));
  74. }
  75. }