|
|
|
@@ -19,12 +19,19 @@ import 'package:flutter_bloc/flutter_bloc.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:keyboard_dismisser/keyboard_dismisser.dart'; |
|
|
|
|
|
|
|
import 'dung/widget_dung_supply.dart'; |
|
|
|
import 'plant/widget_plant_supply.dart'; |
|
|
|
import 'spraying/widget_spraying_supply.dart'; |
|
|
|
import 'state_management_helper/change_file_controller.dart'; |
|
|
|
|
|
|
|
class ActionScreen extends StatefulWidget { |
|
|
|
final int idAction; |
|
|
|
final String activityType; |
|
|
|
final String title; |
|
|
|
ActionScreen({@required this.idAction, @required this.title}); |
|
|
|
ActionScreen( |
|
|
|
{@required this.idAction, |
|
|
|
@required this.title, |
|
|
|
@required this.activityType}); |
|
|
|
|
|
|
|
@override |
|
|
|
_ActionScreenState createState() => _ActionScreenState(); |
|
|
|
@@ -183,6 +190,58 @@ class _ActionScreenState extends State<ActionScreen> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// |
|
|
|
// GENERATE SUPPLY |
|
|
|
// |
|
|
|
|
|
|
|
Widget generateSupply(String activityType) { |
|
|
|
switch (activityType) { |
|
|
|
case 'ACTIVE_TYPE_NURSERY': |
|
|
|
return Container(); |
|
|
|
break; |
|
|
|
case 'ACTIVE_TYPE_PLANTING': |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 16, |
|
|
|
color: Colors.grey[200], |
|
|
|
), |
|
|
|
WidgetPlantSupply(currentItems: [], onChangeSupplies: (value) {}), |
|
|
|
], |
|
|
|
); |
|
|
|
break; |
|
|
|
case 'ACTIVE_TYPE_FERTILIZE': |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 16, |
|
|
|
color: Colors.grey[200], |
|
|
|
), |
|
|
|
WidgetDungSupply(currentItems: [], onChangeSupplies: (value) {}), |
|
|
|
], |
|
|
|
); |
|
|
|
break; |
|
|
|
case 'ACTIVE_TYPE_SPRAYING_PESTICIDES': |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 16, |
|
|
|
color: Colors.grey[200], |
|
|
|
), |
|
|
|
WidgetSprayingSupply( |
|
|
|
currentItems: [], onChangeSupplies: (value) {}), |
|
|
|
], |
|
|
|
); |
|
|
|
break; |
|
|
|
default: |
|
|
|
return Container(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) => KeyboardDismisser( |
|
|
|
gestures: [ |
|
|
|
@@ -268,6 +327,7 @@ class _ActionScreenState extends State<ActionScreen> { |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
generateSupply(widget.activityType), |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 16, |