import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart'; import 'package:farm_tpf/presentation/screens/plot_detail/widget_tab.dart'; import 'package:farm_tpf/utils/const_assets.dart'; import 'package:farm_tpf/utils/formatter.dart'; import 'package:flutter/material.dart'; class PlotDetailScreen extends StatefulWidget { int cropId; String cropCode; int cropType; int initialIndex; String code; num areaM2; String suppliesName; PlotDetailScreen( {this.cropId, this.initialIndex = 0, this.cropCode, @required this.cropType, @required this.code, @required this.areaM2, @required this.suppliesName}); @override _PlotDetailScreenState createState() => _PlotDetailScreenState(); } class _PlotDetailScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBarWidget(), body: Column( children: [ Container( padding: EdgeInsets.all(8), width: double.infinity, color: Colors.white, child: Row( children: [ SizedBox( width: 12, ), Expanded( child: Container( height: 75, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Text('${widget.suppliesName ?? ''}', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 18)), Expanded( child: SizedBox(), ), Row( children: [ Text('Mã lô: ${widget.code ?? ''}', style: TextStyle(color: Colors.grey)), SizedBox( width: 16, ), Text( 'Diện tích: ${widget.areaM2.formatNumtoStringDecimal() ?? '0'} m\u00B2', style: TextStyle(color: Colors.grey)) ], ) ], ), ), ), Image.asset( AppAssets.tempImage, width: 75, height: 75, ) ], ), ), Expanded( child: HomeTabbarWidget( cropType: widget.cropType, cropId: widget.cropId, cropCode: widget.cropCode, initialIndex: widget.initialIndex, )) ], ), ); } }