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.

92 lines
2.8KB

  1. import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart';
  2. import 'package:farm_tpf/presentation/screens/plot_detail/widget_tab.dart';
  3. import 'package:farm_tpf/utils/const_assets.dart';
  4. import 'package:farm_tpf/utils/formatter.dart';
  5. import 'package:flutter/material.dart';
  6. class PlotDetailScreen extends StatefulWidget {
  7. int cropId;
  8. String cropCode;
  9. int cropType;
  10. int initialIndex;
  11. String code;
  12. num areaM2;
  13. String suppliesName;
  14. PlotDetailScreen(
  15. {this.cropId,
  16. this.initialIndex = 0,
  17. this.cropCode,
  18. @required this.cropType,
  19. @required this.code,
  20. @required this.areaM2,
  21. @required this.suppliesName});
  22. @override
  23. _PlotDetailScreenState createState() => _PlotDetailScreenState();
  24. }
  25. class _PlotDetailScreenState extends State<PlotDetailScreen> {
  26. @override
  27. Widget build(BuildContext context) {
  28. return Scaffold(
  29. appBar: AppBarWidget(),
  30. body: Column(
  31. children: [
  32. Container(
  33. padding: EdgeInsets.all(8),
  34. width: double.infinity,
  35. color: Colors.white,
  36. child: Row(
  37. children: [
  38. SizedBox(
  39. width: 12,
  40. ),
  41. Expanded(
  42. child: Container(
  43. height: 75,
  44. child: Column(
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. mainAxisSize: MainAxisSize.min,
  47. children: [
  48. Text('${widget.suppliesName ?? ''}',
  49. style: TextStyle(
  50. fontWeight: FontWeight.bold, fontSize: 18)),
  51. Expanded(
  52. child: SizedBox(),
  53. ),
  54. Row(
  55. children: [
  56. Text('Mã lô: ${widget.code ?? ''}',
  57. style: TextStyle(color: Colors.grey)),
  58. SizedBox(
  59. width: 16,
  60. ),
  61. Text(
  62. 'Diện tích: ${widget.areaM2.formatNumtoStringDecimal() ?? '0'} m\u00B2',
  63. style: TextStyle(color: Colors.grey))
  64. ],
  65. )
  66. ],
  67. ),
  68. ),
  69. ),
  70. Image.asset(
  71. AppAssets.tempImage,
  72. width: 75,
  73. height: 75,
  74. )
  75. ],
  76. ),
  77. ),
  78. Expanded(
  79. child: HomeTabbarWidget(
  80. cropType: widget.cropType,
  81. cropId: widget.cropId,
  82. cropCode: widget.cropCode,
  83. initialIndex: widget.initialIndex,
  84. ))
  85. ],
  86. ),
  87. );
  88. }
  89. }