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.

76 lines
2.7KB

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