|
|
|
@@ -6,12 +6,13 @@ import 'package:farm_tpf/data/repository/repository.dart'; |
|
|
|
import 'package:farm_tpf/data/repository/user_repository.dart'; |
|
|
|
import 'package:farm_tpf/main.dart'; |
|
|
|
import 'package:farm_tpf/models/index.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/bottom_loader.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/loading_list_page.dart'; |
|
|
|
import 'package:farm_tpf/presentation/screens/plot/widget_search.dart'; |
|
|
|
import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart'; |
|
|
|
import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_information.dart'; |
|
|
|
import 'package:farm_tpf/presentation/screens/tabbar/tabbar.dart'; |
|
|
|
import 'package:farm_tpf/utils/const_assets.dart'; |
|
|
|
import 'package:farm_tpf/utils/const_color.dart'; |
|
|
|
import 'package:farm_tpf/utils/const_common.dart'; |
|
|
|
import 'package:farm_tpf/utils/pref.dart'; |
|
|
|
@@ -19,7 +20,6 @@ import 'package:firebase_messaging/firebase_messaging.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart'; |
|
|
|
import 'package:farm_tpf/utils/const_string.dart'; |
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; |
|
|
|
import 'package:farm_tpf/utils/formatter.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
|
|
|
|
@@ -145,18 +145,10 @@ class HoldInfinityWidget extends StatelessWidget { |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Scaffold( |
|
|
|
backgroundColor: Colors.white, |
|
|
|
key: _scaffoldKey, |
|
|
|
appBar: AppBar( |
|
|
|
centerTitle: true, |
|
|
|
title: Text("Danh sách lô"), |
|
|
|
actions: <Widget>[ |
|
|
|
IconButton( |
|
|
|
icon: Icon(FontAwesomeIcons.qrcode), |
|
|
|
onPressed: () { |
|
|
|
// scan(context); |
|
|
|
Get.to(TabbarScreen()); |
|
|
|
}) |
|
|
|
], |
|
|
|
appBar: AppBarWidget( |
|
|
|
isBack: false, |
|
|
|
), |
|
|
|
body: InfinityView()); |
|
|
|
} |
|
|
|
@@ -188,7 +180,15 @@ class _InfinityViewState extends State<InfinityView> { |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
color: Colors.white, |
|
|
|
child: Text( |
|
|
|
'Danh sách lô trồng', |
|
|
|
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 22), |
|
|
|
)), |
|
|
|
WidgetSearch(), |
|
|
|
Expanded(child: BlocBuilder<PlotBloc, PlotState>( |
|
|
|
builder: (context, state) { |
|
|
|
@@ -256,16 +256,83 @@ class ItemInfinityWidget extends StatelessWidget { |
|
|
|
} |
|
|
|
|
|
|
|
return GestureDetector( |
|
|
|
child: Card( |
|
|
|
color: backgroundColor, |
|
|
|
child: ListTile( |
|
|
|
title: Text("${item.code ?? ''} - ${item.suppliesName ?? ''}", |
|
|
|
style: TextStyle(color: textColor)), |
|
|
|
subtitle: Text(item.startDate.format_DDMMYY_HHmm().toString(), |
|
|
|
style: TextStyle(color: textColor)), |
|
|
|
trailing: Text( |
|
|
|
item.areaM2.formatNumtoStringDecimal().toString() + " m\u00B2", |
|
|
|
style: TextStyle(color: textColor)), |
|
|
|
child: Container( |
|
|
|
margin: EdgeInsets.all(8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: backgroundColor, |
|
|
|
border: Border.all(color: Colors.grey[300], width: 0.35), |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.grey[300], |
|
|
|
blurRadius: 3, |
|
|
|
offset: Offset(0, 3)) |
|
|
|
]), |
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
child: Stack( |
|
|
|
children: [ |
|
|
|
Image.asset( |
|
|
|
AppAssets.tempImage, |
|
|
|
width: 65, |
|
|
|
height: 65, |
|
|
|
), |
|
|
|
Positioned( |
|
|
|
child: Container( |
|
|
|
color: Colors.grey.withOpacity(0.5), |
|
|
|
width: 65, |
|
|
|
height: 20, |
|
|
|
child: Text( |
|
|
|
item.areaM2.formatNumtoStringDecimal().toString() + |
|
|
|
" m\u00B2", |
|
|
|
textAlign: TextAlign.center, |
|
|
|
style: TextStyle(color: Colors.white)), |
|
|
|
), |
|
|
|
bottom: 0, |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
width: 12, |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
child: Container( |
|
|
|
height: 75, |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
children: [ |
|
|
|
Text("${item.code ?? ''} - ${item.suppliesName ?? ''}", |
|
|
|
style: TextStyle( |
|
|
|
color: textColor, fontWeight: FontWeight.bold)), |
|
|
|
Expanded( |
|
|
|
child: SizedBox(), |
|
|
|
), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Icon( |
|
|
|
Icons.access_time, |
|
|
|
size: 16, |
|
|
|
color: textColor, |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
width: 4, |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
item.startDate.format_DDMMYY_HHmm().toString(), |
|
|
|
style: TextStyle(color: textColor)), |
|
|
|
), |
|
|
|
], |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
onTap: () { |