| { | { | ||||
| "tbCropDTO": "$plot", | |||||
| "activities": "$[]historyAction", | |||||
| "tbCropDTO": "$plotCrop", | |||||
| "activities": "$[]historyActivity", | |||||
| "sowingDate": "2020-08-20T02:34:18Z", | "sowingDate": "2020-08-20T02:34:18Z", | ||||
| "soakSeedsTime": 1, | "soakSeedsTime": 1, | ||||
| "seedIncubationTime": 1, | "seedIncubationTime": 1, |
| import 'package:dio/dio.dart'; | import 'package:dio/dio.dart'; | ||||
| import 'package:farm_tpf/custom_model/account.dart'; | |||||
| import 'package:farm_tpf/custom_model/password.dart'; | |||||
| import 'package:farm_tpf/custom_model/user.dart'; | |||||
| import 'package:farm_tpf/custom_model/user_request.dart'; | |||||
| import 'package:farm_tpf/models/Supply.dart'; | import 'package:farm_tpf/models/Supply.dart'; | ||||
| import 'package:farm_tpf/models/account.dart'; | |||||
| import 'package:farm_tpf/models/index.dart'; | import 'package:farm_tpf/models/index.dart'; | ||||
| import 'package:farm_tpf/models/password.dart'; | |||||
| import 'package:farm_tpf/models/user.dart'; | |||||
| import 'package:farm_tpf/models/user_request.dart'; | |||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| import 'package:retrofit/retrofit.dart'; | import 'package:retrofit/retrofit.dart'; | ||||
| Future<void> updateFcmToken(@Body() String token); | Future<void> updateFcmToken(@Body() String token); | ||||
| @GET("/api/tb-crops?page={page}&size={size}&query={query}") | @GET("/api/tb-crops?page={page}&size={size}&query={query}") | ||||
| Future<List<Plot>> getPlots( | |||||
| Future<List<PlotCrop>> getPlots( | |||||
| {@Path() int page = 0, @Path() int size = 20, @Path() String query = ""}); | {@Path() int page = 0, @Path() int size = 20, @Path() String query = ""}); | ||||
| @GET("/api/listActivityTypesOther") | @GET("/api/listActivityTypesOther") | ||||
| Future<List<ActionType>> getActionTypes(); | Future<List<ActionType>> getActionTypes(); |
| // GENERATED CODE - DO NOT MODIFY BY HAND | |||||
| part of 'rest_client.dart'; | |||||
| // ************************************************************************** | |||||
| // RetrofitGenerator | |||||
| // ************************************************************************** | |||||
| class _RestClient implements RestClient { | |||||
| _RestClient(this._dio, {this.baseUrl}) { | |||||
| ArgumentError.checkNotNull(_dio, '_dio'); | |||||
| this.baseUrl ??= 'http://tpf.aztrace.vn'; | |||||
| } | |||||
| final Dio _dio; | |||||
| String baseUrl; | |||||
| @override | |||||
| login(userRequest) async { | |||||
| ArgumentError.checkNotNull(userRequest, 'userRequest'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| _data.addAll(userRequest?.toJson() ?? <String, dynamic>{}); | |||||
| final Response<Map<String, dynamic>> _result = await _dio.request( | |||||
| '/api/authenticate', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'POST', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| final value = User.fromJson(_result.data); | |||||
| return value; | |||||
| } | |||||
| @override | |||||
| getMe() async { | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| final Response<Map<String, dynamic>> _result = await _dio.request( | |||||
| '/api/account', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'GET', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| final value = Account.fromJson(_result.data); | |||||
| return value; | |||||
| } | |||||
| @override | |||||
| forgotPassword(email) async { | |||||
| ArgumentError.checkNotNull(email, 'email'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = email; | |||||
| await _dio.request<void>('/api/account/reset-password/init', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'POST', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| return null; | |||||
| } | |||||
| @override | |||||
| resetPassword(password) async { | |||||
| ArgumentError.checkNotNull(password, 'password'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| _data.addAll(password?.toJson() ?? <String, dynamic>{}); | |||||
| await _dio.request<void>('/api/account/reset-password/finish', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'POST', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| return null; | |||||
| } | |||||
| @override | |||||
| changePassword(password) async { | |||||
| ArgumentError.checkNotNull(password, 'password'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| _data.addAll(password?.toJson() ?? <String, dynamic>{}); | |||||
| await _dio.request<void>('/api/account/change-password', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'POST', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| return null; | |||||
| } | |||||
| @override | |||||
| updateProfile(account) async { | |||||
| ArgumentError.checkNotNull(account, 'account'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| _data.addAll(account?.toJson() ?? <String, dynamic>{}); | |||||
| final Response<Map<String, dynamic>> _result = await _dio.request( | |||||
| '/api/update-my-profile', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'PUT', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| final value = Account.fromJson(_result.data); | |||||
| return value; | |||||
| } | |||||
| @override | |||||
| getSupplies(type) async { | |||||
| ArgumentError.checkNotNull(type, 'type'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| final Response<List<dynamic>> _result = await _dio.request( | |||||
| '/api/tb-supplies-by-type/$type', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'GET', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| var value = _result.data | |||||
| .map((dynamic i) => Supply.fromJson(i as Map<String, dynamic>)) | |||||
| .toList(); | |||||
| return value; | |||||
| } | |||||
| @override | |||||
| updateFcmToken(token) async { | |||||
| ArgumentError.checkNotNull(token, 'token'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = token; | |||||
| await _dio.request<void>('/api/update-fcmToken', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'PUT', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| return null; | |||||
| } | |||||
| @override | |||||
| getPlots({page = 0, size = 20, query = ""}) async { | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| queryParameters.removeWhere((k, v) => v == null); | |||||
| final _data = <String, dynamic>{}; | |||||
| final Response<List<dynamic>> _result = await _dio.request( | |||||
| '/api/tb-crops?page=$page&size=$size&query=$query', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'GET', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| var value = _result.data | |||||
| .map((dynamic i) => PlotCrop.fromJson(i as Map<String, dynamic>)) | |||||
| .toList(); | |||||
| return value; | |||||
| } | |||||
| @override | |||||
| getActionTypes() async { | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| final _data = <String, dynamic>{}; | |||||
| final Response<List<dynamic>> _result = await _dio.request( | |||||
| '/api/listActivityTypesOther', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'GET', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| var value = _result.data | |||||
| .map((dynamic i) => ActionType.fromJson(i as Map<String, dynamic>)) | |||||
| .toList(); | |||||
| return value; | |||||
| } | |||||
| @override | |||||
| getCropDetail(cropId, {page = 0, size = 20}) async { | |||||
| ArgumentError.checkNotNull(cropId, 'cropId'); | |||||
| const _extra = <String, dynamic>{}; | |||||
| final queryParameters = <String, dynamic>{}; | |||||
| queryParameters.removeWhere((k, v) => v == null); | |||||
| final _data = <String, dynamic>{}; | |||||
| final Response<Map<String, dynamic>> _result = await _dio.request( | |||||
| '/api/tb-crops-detail/$cropId?page=$page&size=$size&sort=executeDate,DESC', | |||||
| queryParameters: queryParameters, | |||||
| options: RequestOptions( | |||||
| method: 'GET', | |||||
| headers: <String, dynamic>{}, | |||||
| extra: _extra, | |||||
| baseUrl: baseUrl), | |||||
| data: _data); | |||||
| final value = Crop.fromJson(_result.data); | |||||
| return value; | |||||
| } | |||||
| } |
| import 'package:farm_tpf/data/api/dio_provider.dart'; | import 'package:farm_tpf/data/api/dio_provider.dart'; | ||||
| import 'package:farm_tpf/data/api/rest_client.dart'; | import 'package:farm_tpf/data/api/rest_client.dart'; | ||||
| import 'package:farm_tpf/models/PagedResult.dart'; | import 'package:farm_tpf/models/PagedResult.dart'; | ||||
| import 'package:farm_tpf/models/Plot.dart'; | |||||
| import 'package:farm_tpf/models/Supply.dart'; | import 'package:farm_tpf/models/Supply.dart'; | ||||
| import 'package:farm_tpf/models/index.dart'; | import 'package:farm_tpf/models/index.dart'; | ||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| return client.getCropDetail(cropId, page: page, size: size); | return client.getCropDetail(cropId, page: page, size: size); | ||||
| } | } | ||||
| Future<List<Plot>> getPlots({int page, int size, String searchString}) { | |||||
| Future<List<PlotCrop>> getPlots({int page, int size, String searchString}) { | |||||
| final client = RestClient(dio); | final client = RestClient(dio); | ||||
| return client.getPlots(page: page, size: size, query: searchString); | return client.getPlots(page: page, size: size, query: searchString); | ||||
| } | } | ||||
| Object getInstanceClass() { | Object getInstanceClass() { | ||||
| var instanceClass; | var instanceClass; | ||||
| if (1 == 1) { | if (1 == 1) { | ||||
| instanceClass = new Plot(); | |||||
| instanceClass = new PlotCrop(); | |||||
| } | } | ||||
| return instanceClass; | return instanceClass; | ||||
| } | } |
| <String, dynamic>{ | <String, dynamic>{ | ||||
| 'id': instance.id, | 'id': instance.id, | ||||
| 'name': instance.name, | 'name': instance.name, | ||||
| 'description': instance.description | |||||
| 'description': instance.description, | |||||
| }; | }; |
| import 'package:farm_tpf/models/index.dart'; | |||||
| import 'package:json_annotation/json_annotation.dart'; | import 'package:json_annotation/json_annotation.dart'; | ||||
| import "plot.dart"; | |||||
| import "historyAction.dart"; | |||||
| part 'Crop.g.dart'; | part 'Crop.g.dart'; | ||||
| @JsonSerializable() | @JsonSerializable() | ||||
| class Crop { | class Crop { | ||||
| Crop(); | |||||
| Crop(); | |||||
| Plot tbCropDTO; | |||||
| List<HistoryAction> activities; | |||||
| String sowingDate; | |||||
| num soakSeedsTime; | |||||
| num seedIncubationTime; | |||||
| num numberPlants; | |||||
| num numberCurrentPlants; | |||||
| String endOfFarmingDate; | |||||
| factory Crop.fromJson(Map<String,dynamic> json) => _$CropFromJson(json); | |||||
| Map<String, dynamic> toJson() => _$CropToJson(this); | |||||
| PlotCrop tbCropDTO; | |||||
| List<HistoryActivity> activities; | |||||
| String sowingDate; | |||||
| num soakSeedsTime; | |||||
| num seedIncubationTime; | |||||
| num numberPlants; | |||||
| num numberCurrentPlants; | |||||
| String endOfFarmingDate; | |||||
| factory Crop.fromJson(Map<String, dynamic> json) => _$CropFromJson(json); | |||||
| Map<String, dynamic> toJson() => _$CropToJson(this); | |||||
| } | } |
| 'seedIncubationTime': instance.seedIncubationTime, | 'seedIncubationTime': instance.seedIncubationTime, | ||||
| 'numberPlants': instance.numberPlants, | 'numberPlants': instance.numberPlants, | ||||
| 'numberCurrentPlants': instance.numberCurrentPlants, | 'numberCurrentPlants': instance.numberCurrentPlants, | ||||
| 'endOfFarmingDate': instance.endOfFarmingDate | |||||
| 'endOfFarmingDate': instance.endOfFarmingDate, | |||||
| }; | }; |
| import 'package:json_annotation/json_annotation.dart'; | |||||
| part 'HistoryAction.g.dart'; | |||||
| @JsonSerializable() | |||||
| class HistoryAction { | |||||
| HistoryAction(); | |||||
| num id; | |||||
| num ageDay; | |||||
| num cropId; | |||||
| String executeDate; | |||||
| String description; | |||||
| num activityTypeId; | |||||
| String activityTypeName; | |||||
| factory HistoryAction.fromJson(Map<String,dynamic> json) => _$HistoryActionFromJson(json); | |||||
| Map<String, dynamic> toJson() => _$HistoryActionToJson(this); | |||||
| } |
| import 'package:json_annotation/json_annotation.dart'; | |||||
| part 'HistoryActivity.g.dart'; | |||||
| @JsonSerializable() | |||||
| class HistoryActivity { | |||||
| HistoryActivity(); | |||||
| num id; | |||||
| num ageDay; | |||||
| num cropId; | |||||
| String executeDate; | |||||
| String description; | |||||
| num activityTypeId; | |||||
| String activityTypeName; | |||||
| factory HistoryActivity.fromJson(Map<String,dynamic> json) => _$HistoryActivityFromJson(json); | |||||
| Map<String, dynamic> toJson() => _$HistoryActivityToJson(this); | |||||
| } |
| // GENERATED CODE - DO NOT MODIFY BY HAND | // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| part of 'HistoryAction.dart'; | |||||
| part of 'HistoryActivity.dart'; | |||||
| // ************************************************************************** | // ************************************************************************** | ||||
| // JsonSerializableGenerator | // JsonSerializableGenerator | ||||
| // ************************************************************************** | // ************************************************************************** | ||||
| HistoryAction _$HistoryActionFromJson(Map<String, dynamic> json) { | |||||
| return HistoryAction() | |||||
| HistoryActivity _$HistoryActivityFromJson(Map<String, dynamic> json) { | |||||
| return HistoryActivity() | |||||
| ..id = json['id'] as num | ..id = json['id'] as num | ||||
| ..ageDay = json['ageDay'] as num | ..ageDay = json['ageDay'] as num | ||||
| ..cropId = json['cropId'] as num | ..cropId = json['cropId'] as num | ||||
| ..activityTypeName = json['activityTypeName'] as String; | ..activityTypeName = json['activityTypeName'] as String; | ||||
| } | } | ||||
| Map<String, dynamic> _$HistoryActionToJson(HistoryAction instance) => | |||||
| Map<String, dynamic> _$HistoryActivityToJson(HistoryActivity instance) => | |||||
| <String, dynamic>{ | <String, dynamic>{ | ||||
| 'id': instance.id, | 'id': instance.id, | ||||
| 'ageDay': instance.ageDay, | 'ageDay': instance.ageDay, | ||||
| 'executeDate': instance.executeDate, | 'executeDate': instance.executeDate, | ||||
| 'description': instance.description, | 'description': instance.description, | ||||
| 'activityTypeId': instance.activityTypeId, | 'activityTypeId': instance.activityTypeId, | ||||
| 'activityTypeName': instance.activityTypeName | |||||
| 'activityTypeName': instance.activityTypeName, | |||||
| }; | }; |
| 'executeDate': instance.executeDate, | 'executeDate': instance.executeDate, | ||||
| 'description': instance.description, | 'description': instance.description, | ||||
| 'activityTypeName': instance.activityTypeName, | 'activityTypeName': instance.activityTypeName, | ||||
| 'workerName': instance.workerName | |||||
| 'workerName': instance.workerName, | |||||
| }; | }; |
| import 'package:json_annotation/json_annotation.dart'; | import 'package:json_annotation/json_annotation.dart'; | ||||
| part 'Plot.g.dart'; | |||||
| part 'PlotCrop.g.dart'; | |||||
| @JsonSerializable() | @JsonSerializable() | ||||
| class Plot { | |||||
| Plot(); | |||||
| class PlotCrop { | |||||
| PlotCrop(); | |||||
| num id; | num id; | ||||
| String qrCode; | String qrCode; | ||||
| num areaId; | num areaId; | ||||
| String area; | String area; | ||||
| factory Plot.fromJson(Map<String,dynamic> json) => _$PlotFromJson(json); | |||||
| Map<String, dynamic> toJson() => _$PlotToJson(this); | |||||
| factory PlotCrop.fromJson(Map<String,dynamic> json) => _$PlotCropFromJson(json); | |||||
| Map<String, dynamic> toJson() => _$PlotCropToJson(this); | |||||
| } | } |
| // GENERATED CODE - DO NOT MODIFY BY HAND | // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| part of 'Plot.dart'; | |||||
| part of 'PlotCrop.dart'; | |||||
| // ************************************************************************** | // ************************************************************************** | ||||
| // JsonSerializableGenerator | // JsonSerializableGenerator | ||||
| // ************************************************************************** | // ************************************************************************** | ||||
| Plot _$PlotFromJson(Map<String, dynamic> json) { | |||||
| return Plot() | |||||
| PlotCrop _$PlotCropFromJson(Map<String, dynamic> json) { | |||||
| return PlotCrop() | |||||
| ..id = json['id'] as num | ..id = json['id'] as num | ||||
| ..qrCode = json['qrCode'] as String | ..qrCode = json['qrCode'] as String | ||||
| ..code = json['code'] as String | ..code = json['code'] as String | ||||
| ..area = json['area'] as String; | ..area = json['area'] as String; | ||||
| } | } | ||||
| Map<String, dynamic> _$PlotToJson(Plot instance) => <String, dynamic>{ | |||||
| Map<String, dynamic> _$PlotCropToJson(PlotCrop instance) => <String, dynamic>{ | |||||
| 'id': instance.id, | 'id': instance.id, | ||||
| 'qrCode': instance.qrCode, | 'qrCode': instance.qrCode, | ||||
| 'code': instance.code, | 'code': instance.code, | ||||
| 'netHouseId': instance.netHouseId, | 'netHouseId': instance.netHouseId, | ||||
| 'netHouseName': instance.netHouseName, | 'netHouseName': instance.netHouseName, | ||||
| 'areaId': instance.areaId, | 'areaId': instance.areaId, | ||||
| 'area': instance.area | |||||
| 'area': instance.area, | |||||
| }; | }; |
| 'id': instance.id, | 'id': instance.id, | ||||
| 'name': instance.name, | 'name': instance.name, | ||||
| 'description': instance.description, | 'description': instance.description, | ||||
| 'isSelected': instance.isSelected | |||||
| 'isSelected': instance.isSelected, | |||||
| }; | }; |
| export 'HistoryActivity.dart' ; | |||||
| export 'PlotCrop.dart' ; | |||||
| export 'Supply.dart' ; | export 'Supply.dart' ; | ||||
| export 'Plot.dart' ; | |||||
| export 'Crop.dart' ; | export 'Crop.dart' ; | ||||
| export 'ResourceHelper.dart' ; | export 'ResourceHelper.dart' ; | ||||
| export 'HistoryAction.dart' ; | |||||
| export 'ActionType.dart' ; | export 'ActionType.dart' ; | ||||
| export 'OtherAction.dart' ; | export 'OtherAction.dart' ; |
| MaterialButton( | MaterialButton( | ||||
| child: Text("Chi tiết lô"), | child: Text("Chi tiết lô"), | ||||
| onPressed: () { | onPressed: () { | ||||
| Navigator.of(context).push( | |||||
| MaterialPageRoute(builder: (_) => PlotDetailScreen())); | |||||
| Navigator.of(context).push(MaterialPageRoute( | |||||
| builder: (_) => PlotDetailScreen( | |||||
| cropId: 1, | |||||
| ))); | |||||
| }), | }), | ||||
| MaterialButton( | MaterialButton( | ||||
| child: Text("Danh sách lô"), | child: Text("Danh sách lô"), |
| import 'package:farm_tpf/data/repository/repository.dart'; | import 'package:farm_tpf/data/repository/repository.dart'; | ||||
| import 'package:farm_tpf/models/Plot.dart'; | |||||
| import 'package:farm_tpf/models/index.dart'; | |||||
| import 'package:farm_tpf/presentation/custom_widgets/bottom_loader.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/custom_widgets/loading_list_page.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; | import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; | ||||
| } | } | ||||
| class ItemInfinityWidget extends StatelessWidget { | class ItemInfinityWidget extends StatelessWidget { | ||||
| final Plot item; | |||||
| final PlotCrop item; | |||||
| const ItemInfinityWidget({Key key, @required this.item}) : super(key: key); | const ItemInfinityWidget({Key key, @required this.item}) : super(key: key); | ||||
| } | } | ||||
| class ItemInfinityWidget extends StatelessWidget { | class ItemInfinityWidget extends StatelessWidget { | ||||
| final HistoryAction item; | |||||
| final HistoryActivity item; | |||||
| const ItemInfinityWidget({Key key, @required this.item}) : super(key: key); | const ItemInfinityWidget({Key key, @required this.item}) : super(key: key); | ||||
| import 'package:farm_tpf/models/Plot.dart'; | |||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_media_helper.dart'; | |||||
| import 'package:farm_tpf/models/index.dart'; | |||||
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:keyboard_dismisser/keyboard_dismisser.dart'; | import 'package:keyboard_dismisser/keyboard_dismisser.dart'; | ||||
| class PlotInformationScreen extends StatefulWidget { | class PlotInformationScreen extends StatefulWidget { | ||||
| final Plot plot; | |||||
| final PlotCrop plot; | |||||
| PlotInformationScreen({this.plot}); | PlotInformationScreen({this.plot}); | ||||
| @override | @override | ||||
| _PlotInformationScreenState createState() => _PlotInformationScreenState(); | _PlotInformationScreenState createState() => _PlotInformationScreenState(); | ||||
| final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); | final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); | ||||
| GlobalKey<FormState> _formKey = GlobalKey(); | GlobalKey<FormState> _formKey = GlobalKey(); | ||||
| bool _autoValidate = false; | bool _autoValidate = false; | ||||
| Plot _plot = Plot(); | |||||
| PlotCrop _plot = PlotCrop(); | |||||
| _validateInputs() async { | _validateInputs() async { | ||||
| if (_formKey.currentState.validate()) { | if (_formKey.currentState.validate()) { |
| # Generated by pub | # Generated by pub | ||||
| # See https://dart.dev/tools/pub/glossary#lockfile | # See https://dart.dev/tools/pub/glossary#lockfile | ||||
| packages: | packages: | ||||
| _fe_analyzer_shared: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: _fe_analyzer_shared | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "6.0.0" | |||||
| analyzer: | analyzer: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: analyzer | name: analyzer | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.36.4" | |||||
| version: "0.39.14" | |||||
| archive: | archive: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: bloc | name: bloc | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "6.0.1" | |||||
| version: "6.0.3" | |||||
| boolean_selector: | boolean_selector: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: build | name: build | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.1.6" | |||||
| version: "1.3.0" | |||||
| build_config: | build_config: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: build_config | name: build_config | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.4.1+1" | |||||
| version: "0.4.2" | |||||
| build_daemon: | build_daemon: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: build_resolvers | name: build_resolvers | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.1" | |||||
| version: "1.3.11" | |||||
| build_runner: | build_runner: | ||||
| dependency: "direct dev" | dependency: "direct dev" | ||||
| description: | description: | ||||
| name: build_runner | name: build_runner | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.6.9" | |||||
| version: "1.10.1" | |||||
| build_runner_core: | build_runner_core: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: build_runner_core | name: build_runner_core | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "3.1.1" | |||||
| version: "6.0.1" | |||||
| built_collection: | built_collection: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.0.2" | version: "1.0.2" | ||||
| cli_util: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: cli_util | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "0.1.4" | |||||
| code_builder: | code_builder: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: code_builder | name: code_builder | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "3.4.0" | |||||
| version: "3.4.1" | |||||
| collection: | collection: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: dart_style | name: dart_style | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.9" | |||||
| version: "1.3.6" | |||||
| dio: | dio: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: equatable | name: equatable | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.3" | |||||
| version: "1.2.5" | |||||
| file: | file: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: flutter_bloc | name: flutter_bloc | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "6.0.1" | |||||
| version: "6.0.5" | |||||
| flutter_datetime_picker: | flutter_datetime_picker: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.3.0" | version: "0.3.0" | ||||
| front_end: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: front_end | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "0.1.19" | |||||
| get: | get: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: get | name: get | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "3.8.0" | |||||
| version: "3.10.1" | |||||
| glob: | glob: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: image_picker | name: image_picker | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.6.7+4" | |||||
| version: "0.6.7+7" | |||||
| image_picker_platform_interface: | image_picker_platform_interface: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: json_annotation | name: json_annotation | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.3.0" | |||||
| json_model: | |||||
| dependency: "direct dev" | |||||
| description: | |||||
| name: json_model | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "0.0.2" | |||||
| version: "3.0.1" | |||||
| json_serializable: | json_serializable: | ||||
| dependency: "direct dev" | dependency: "direct dev" | ||||
| description: | description: | ||||
| name: json_serializable | name: json_serializable | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.3.0" | |||||
| kernel: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: kernel | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "0.3.19" | |||||
| version: "3.4.1" | |||||
| keyboard_dismisser: | keyboard_dismisser: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: mime | name: mime | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.9.6+3" | |||||
| version: "0.9.7" | |||||
| nested: | nested: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.4.3" | version: "0.4.3" | ||||
| package_resolver: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: package_resolver | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.0.10" | |||||
| path: | path: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: path_provider_platform_interface | name: path_provider_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.0.2" | |||||
| version: "1.0.3" | |||||
| pattern_formatter: | pattern_formatter: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: provider | name: provider | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "4.3.1" | |||||
| version: "4.3.2+2" | |||||
| pub_semver: | pub_semver: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.1.3" | version: "2.1.3" | ||||
| retrofit: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: retrofit | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.3.4" | |||||
| retrofit_generator: | |||||
| dependency: "direct dev" | |||||
| description: | |||||
| name: retrofit_generator | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.3.7+6" | |||||
| rxdart: | rxdart: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: shared_preferences | name: shared_preferences | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.5.8" | |||||
| version: "0.5.10" | |||||
| shared_preferences_linux: | shared_preferences_linux: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences_linux | name: shared_preferences_linux | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.2+1" | |||||
| version: "0.0.2+2" | |||||
| shared_preferences_macos: | shared_preferences_macos: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shelf | name: shelf | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.7.7" | |||||
| version: "0.7.9" | |||||
| shelf_web_socket: | shelf_web_socket: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: source_gen | name: source_gen | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.9.4+4" | |||||
| version: "0.9.6" | |||||
| source_span: | source_span: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: stream_transform | name: stream_transform | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.20" | |||||
| version: "1.2.0" | |||||
| string_scanner: | string_scanner: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.1.1+2" | version: "0.1.1+2" | ||||
| tuple: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: tuple | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.0.3" | |||||
| typed_data: | typed_data: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: video_player | name: video_player | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.10.11+2" | |||||
| version: "0.10.12+2" | |||||
| video_player_platform_interface: | video_player_platform_interface: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: video_player_platform_interface | name: video_player_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.1.0" | |||||
| version: "2.1.1" | |||||
| video_player_web: | video_player_web: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: |
| flutter_test: | flutter_test: | ||||
| sdk: flutter | sdk: flutter | ||||
| #flutter packages pub run build_runner build --delete-conflicting-outputs | #flutter packages pub run build_runner build --delete-conflicting-outputs | ||||
| # retrofit_generator: ^1.3.7 | |||||
| retrofit_generator: ^1.3.7 | |||||
| # flutter packages pub run json_model | # flutter packages pub run json_model | ||||
| json_model: ^0.0.2 | |||||
| # json_model: ^0.0.2 | |||||
| build_runner: any | build_runner: any | ||||
| json_serializable: any | json_serializable: any | ||||