| @@ -0,0 +1 @@ | |||
| /Users/daivph/fvm/versions/2.5.0 | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "flutterSdkVersion": "2.5.0", | |||
| "flavors": {} | |||
| } | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "dart.flutterSdkPath": "~/fvm/versions/2.5.0" | |||
| } | |||
| @@ -33,6 +33,7 @@ if (keystorePropertiesFile.exists()) { | |||
| android { | |||
| compileSdkVersion 29 | |||
| ndkVersion "21.1.6352462" | |||
| sourceSets { | |||
| main.java.srcDirs += 'src/main/kotlin' | |||
| @@ -9,7 +9,7 @@ part of 'rest_client.dart'; | |||
| class _RestClient implements RestClient { | |||
| _RestClient(this._dio, {this.baseUrl}) { | |||
| ArgumentError.checkNotNull(_dio, '_dio'); | |||
| baseUrl ??= 'https://smartfarm.aztrace.vn'; | |||
| baseUrl ??= 'https://tpf.aztrace.vn'; | |||
| } | |||
| final Dio _dio; | |||
| @@ -23,14 +23,9 @@ class _RestClient implements RestClient { | |||
| final queryParameters = <String, dynamic>{}; | |||
| final _data = <String, dynamic>{}; | |||
| _data.addAll(userRequest?.toJson() ?? <String, dynamic>{}); | |||
| final _result = await _dio.request<Map<String, dynamic>>( | |||
| '/api/authenticate', | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/authenticate', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'POST', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'POST', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| final value = User.fromJson(_result.data); | |||
| return value; | |||
| @@ -43,11 +38,7 @@ class _RestClient implements RestClient { | |||
| final _data = <String, dynamic>{}; | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/account', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| final value = Account.fromJson(_result.data); | |||
| return value; | |||
| @@ -61,11 +52,7 @@ class _RestClient implements RestClient { | |||
| 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), | |||
| options: RequestOptions(method: 'POST', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -79,11 +66,7 @@ class _RestClient implements RestClient { | |||
| _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), | |||
| options: RequestOptions(method: 'POST', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -97,11 +80,7 @@ class _RestClient implements RestClient { | |||
| _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), | |||
| options: RequestOptions(method: 'POST', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -113,14 +92,9 @@ class _RestClient implements RestClient { | |||
| final queryParameters = <String, dynamic>{}; | |||
| final _data = <String, dynamic>{}; | |||
| _data.addAll(account?.toJson() ?? <String, dynamic>{}); | |||
| final _result = await _dio.request<Map<String, dynamic>>( | |||
| '/api/update-my-profile', | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/update-my-profile', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'PUT', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'PUT', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| final value = Account.fromJson(_result.data); | |||
| return value; | |||
| @@ -136,14 +110,9 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/list-supplies-in-warehouses/$type?q=$query', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => Supply.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/list-supplies-in-warehouses/$type?q=$query', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => Supply.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -155,11 +124,7 @@ class _RestClient implements RestClient { | |||
| final _data = token; | |||
| await _dio.request<void>('/api/update-fcmToken', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'PUT', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'PUT', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -172,11 +137,7 @@ class _RestClient implements RestClient { | |||
| final _data = token; | |||
| await _dio.request<void>('/api/delete-fcmToken', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'PUT', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'PUT', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -187,18 +148,11 @@ class _RestClient implements RestClient { | |||
| final queryParameters = <String, dynamic>{}; | |||
| queryParameters.removeWhere((k, v) => v == null); | |||
| final _data = <String, dynamic>{}; | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/_search/tb-crops?page=$page&size=$size&sort=id,asc&query=$query', | |||
| final _result = await _dio.request<List<dynamic>>('/api/_search/tb-crops?page=$page&size=$size&sort=id,asc&query=$query', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => TbCropDTO.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| var value = _result.data.map((dynamic i) => TbCropDTO.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -211,14 +165,9 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/listActivityTypesOther', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => ActionType.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/listActivityTypesOther', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => ActionType.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -232,12 +181,8 @@ class _RestClient implements RestClient { | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>('/api/water-types', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => WaterType.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => WaterType.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -251,12 +196,8 @@ class _RestClient implements RestClient { | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>('/api/tb-harvests', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => Harvest.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => Harvest.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -269,14 +210,9 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/listDeviceForActivity', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => Device.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/listDeviceForActivity', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => Device.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -288,11 +224,7 @@ class _RestClient implements RestClient { | |||
| final _data = status; | |||
| await _dio.request<void>('/api/notifications/update-all', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'PUT', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'PUT', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -306,18 +238,13 @@ class _RestClient implements RestClient { | |||
| _data.addAll(updateNoti?.toJson() ?? <String, dynamic>{}); | |||
| await _dio.request<void>('/api/notifications/update', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'PUT', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'PUT', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @override | |||
| Future<List<LocationUnit>> getCountries( | |||
| {page = 0, size = 400, query = '', options}) async { | |||
| Future<List<LocationUnit>> getCountries({page = 0, size = 400, query = '', options}) async { | |||
| const _extra = <String, dynamic>{}; | |||
| final queryParameters = <String, dynamic>{}; | |||
| queryParameters.removeWhere((k, v) => v == null); | |||
| @@ -325,20 +252,14 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/tb-countries?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/tb-countries?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @override | |||
| Future<List<LocationUnit>> getProvinces(countryId, | |||
| {page = 0, size = 20, query = '', options}) async { | |||
| Future<List<LocationUnit>> getProvinces(countryId, {page = 0, size = 20, query = '', options}) async { | |||
| ArgumentError.checkNotNull(countryId, 'countryId'); | |||
| const _extra = <String, dynamic>{}; | |||
| final queryParameters = <String, dynamic>{}; | |||
| @@ -347,20 +268,14 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/tb-cities-by-country/$countryId?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/tb-cities-by-country/$countryId?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @override | |||
| Future<List<LocationUnit>> getDistricts(provinceId, | |||
| {page = 0, size = 20, query = '', options}) async { | |||
| Future<List<LocationUnit>> getDistricts(provinceId, {page = 0, size = 20, query = '', options}) async { | |||
| ArgumentError.checkNotNull(provinceId, 'provinceId'); | |||
| const _extra = <String, dynamic>{}; | |||
| final queryParameters = <String, dynamic>{}; | |||
| @@ -369,20 +284,14 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/tb-districts-by-city/$provinceId?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/tb-districts-by-city/$provinceId?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @override | |||
| Future<List<LocationUnit>> getWards(districtId, | |||
| {page = 0, size = 20, query = '', options}) async { | |||
| Future<List<LocationUnit>> getWards(districtId, {page = 0, size = 20, query = '', options}) async { | |||
| ArgumentError.checkNotNull(districtId, 'districtId'); | |||
| const _extra = <String, dynamic>{}; | |||
| final queryParameters = <String, dynamic>{}; | |||
| @@ -391,14 +300,9 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/tb-wards-by-district/$districtId?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| final _result = await _dio.request<List<dynamic>>('/api/tb-wards-by-district/$districtId?page=$page&size=$size&query=$query&&sort=name,ASC', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| var value = _result.data.map((dynamic i) => LocationUnit.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -409,14 +313,9 @@ class _RestClient implements RestClient { | |||
| final queryParameters = <String, dynamic>{}; | |||
| queryParameters.removeWhere((k, v) => v == null); | |||
| final _data = <String, dynamic>{}; | |||
| final _result = await _dio.request<Map<String, dynamic>>( | |||
| '/api/tb-crops-detail-for-app/$cropId?page=$page&size=$size&sort=executeDate,DESC', | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/tb-crops-detail-for-app/$cropId?page=$page&size=$size&sort=executeDate,DESC', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| final value = CropPlot.fromJson(_result.data); | |||
| return value; | |||
| @@ -429,14 +328,9 @@ class _RestClient implements RestClient { | |||
| final queryParameters = <String, dynamic>{}; | |||
| queryParameters.removeWhere((k, v) => v == null); | |||
| final _data = <String, dynamic>{}; | |||
| final _result = await _dio.request<Map<String, dynamic>>( | |||
| '/api/tb-crops-scan-qrCode/$cropCode?page=$page&size=$size&sort=executeDate,DESC', | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/tb-crops-scan-qrCode/$cropCode?page=$page&size=$size&sort=executeDate,DESC', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| final value = CropPlot.fromJson(_result.data); | |||
| return value; | |||
| @@ -451,11 +345,7 @@ class _RestClient implements RestClient { | |||
| _data.addAll(crop?.toJson() ?? <String, dynamic>{}); | |||
| await _dio.request<void>('/api/tb-crops', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'PUT', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'PUT', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| return null; | |||
| } | |||
| @@ -466,42 +356,26 @@ class _RestClient implements RestClient { | |||
| final queryParameters = <String, dynamic>{}; | |||
| queryParameters.removeWhere((k, v) => v == null); | |||
| final _data = <String, dynamic>{}; | |||
| final _result = await _dio.request<List<dynamic>>( | |||
| '/api/listDeviceOfUserCustomers?query=$query', | |||
| final _result = await _dio.request<List<dynamic>>('/api/listDeviceOfUserCustomers?query=$query', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => Device.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| var value = _result.data.map((dynamic i) => Device.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @override | |||
| Future<List<EnvironmentParameter>> getEnvironmentParameters(cropId, | |||
| {page = 0, size = 20}) async { | |||
| Future<List<EnvironmentParameter>> getEnvironmentParameters(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 _result = await _dio.request<List<dynamic>>( | |||
| '/api/list-environment-updates-display/$cropId?page=$page&size=$size', | |||
| final _result = await _dio.request<List<dynamic>>('/api/list-environment-updates-display/$cropId?page=$page&size=$size', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| var value = _result.data | |||
| .map((dynamic i) => | |||
| EnvironmentParameter.fromJson(i as Map<String, dynamic>)) | |||
| .toList(); | |||
| var value = _result.data.map((dynamic i) => EnvironmentParameter.fromJson(i as Map<String, dynamic>)).toList(); | |||
| return value; | |||
| } | |||
| @@ -515,32 +389,23 @@ class _RestClient implements RestClient { | |||
| final newOptions = newRequestOptions(options); | |||
| newOptions.extra.addAll(_extra); | |||
| newOptions.headers.addAll(<String, dynamic>{}); | |||
| final _result = await _dio.request<Map<String, dynamic>>( | |||
| '/api/display-object-param-dynamic-form/$idAction', | |||
| queryParameters: queryParameters, | |||
| options: newOptions.merge(method: 'GET', baseUrl: baseUrl), | |||
| data: _data); | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/display-object-param-dynamic-form/$idAction', | |||
| queryParameters: queryParameters, options: newOptions.merge(method: 'GET', baseUrl: baseUrl), data: _data); | |||
| final value = ActionUIForm.fromJson(_result.data); | |||
| return value; | |||
| } | |||
| @override | |||
| Future<RequestActivity> getDetailActivityCommon( | |||
| {actionType, activityId}) async { | |||
| Future<RequestActivity> getDetailActivityCommon({actionType, activityId}) async { | |||
| ArgumentError.checkNotNull(actionType, 'actionType'); | |||
| ArgumentError.checkNotNull(activityId, 'activityId'); | |||
| const _extra = <String, dynamic>{}; | |||
| final queryParameters = <String, dynamic>{}; | |||
| queryParameters.removeWhere((k, v) => v == null); | |||
| final _data = <String, dynamic>{}; | |||
| final _result = await _dio.request<Map<String, dynamic>>( | |||
| '/api/get-detail-common-activity/$actionType/$activityId', | |||
| final _result = await _dio.request<Map<String, dynamic>>('/api/get-detail-common-activity/$actionType/$activityId', | |||
| queryParameters: queryParameters, | |||
| options: RequestOptions( | |||
| method: 'GET', | |||
| headers: <String, dynamic>{}, | |||
| extra: _extra, | |||
| baseUrl: baseUrl), | |||
| options: RequestOptions(method: 'GET', headers: <String, dynamic>{}, extra: _extra, baseUrl: baseUrl), | |||
| data: _data); | |||
| final value = RequestActivity.fromJson(_result.data); | |||
| return value; | |||
| @@ -1,4 +1,3 @@ | |||
| import 'package:barcode_scan/barcode_scan.dart'; | |||
| import 'package:camera/camera.dart'; | |||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart'; | |||
| import 'package:flutter/material.dart'; | |||
| @@ -35,57 +34,48 @@ Future<dynamic> myBackgroundMessageHandler(Map<String, dynamic> message) { | |||
| // Or do other work. | |||
| } | |||
| Future scan(BuildContext context) async { | |||
| var _aspectTolerance = 0.00; | |||
| var _selectedCamera = -1; | |||
| var _useAutoFocus = true; | |||
| var _autoEnableFlash = false; | |||
| var repository = Repository(); | |||
| try { | |||
| var options = ScanOptions( | |||
| strings: { | |||
| "cancel": "Huỷ", | |||
| "flash_on": "Bật flash", | |||
| "flash_off": "Tắt flash", | |||
| }, | |||
| useCamera: _selectedCamera, | |||
| autoEnableFlash: _autoEnableFlash, | |||
| android: AndroidOptions( | |||
| aspectTolerance: _aspectTolerance, | |||
| useAutoFocus: _useAutoFocus, | |||
| ), | |||
| ); | |||
| var result = await BarcodeScanner.scan(options: options); | |||
| print(result.toString()); | |||
| if (result.type == ResultType.Cancelled) { | |||
| print("canncel"); | |||
| } else if (result.type == ResultType.Error) { | |||
| print("error"); | |||
| } else { | |||
| print("show check crop"); | |||
| _showAlertCheckCropCode(context, result.rawContent, repository); | |||
| } | |||
| } on PlatformException catch (e) { | |||
| print("error: ${e.message}"); | |||
| } | |||
| } | |||
| // Future scan(BuildContext context) async { | |||
| // var _aspectTolerance = 0.00; | |||
| // var _selectedCamera = -1; | |||
| // var _useAutoFocus = true; | |||
| // var _autoEnableFlash = false; | |||
| // var repository = Repository(); | |||
| // try { | |||
| // var options = ScanOptions( | |||
| // strings: { | |||
| // "cancel": "Huỷ", | |||
| // "flash_on": "Bật flash", | |||
| // "flash_off": "Tắt flash", | |||
| // }, | |||
| // useCamera: _selectedCamera, | |||
| // autoEnableFlash: _autoEnableFlash, | |||
| // android: AndroidOptions( | |||
| // aspectTolerance: _aspectTolerance, | |||
| // useAutoFocus: _useAutoFocus, | |||
| // ), | |||
| // ); | |||
| // var result = await BarcodeScanner.scan(options: options); | |||
| // print(result.toString()); | |||
| // if (result.type == ResultType.Cancelled) { | |||
| // print("canncel"); | |||
| // } else if (result.type == ResultType.Error) { | |||
| // print("error"); | |||
| // } else { | |||
| // print("show check crop"); | |||
| // _showAlertCheckCropCode(context, result.rawContent, repository); | |||
| // } | |||
| // } on PlatformException catch (e) { | |||
| // print("error: ${e.message}"); | |||
| // } | |||
| // } | |||
| _showAlertCheckCropCode( | |||
| BuildContext context, String cropCode, Repository repository) async { | |||
| Get.defaultDialog( | |||
| title: "Kiểm tra thông tin lô ....", | |||
| middleText: "", | |||
| content: CircularProgressIndicator()); | |||
| _showAlertCheckCropCode(BuildContext context, String cropCode, Repository repository) async { | |||
| Get.defaultDialog(title: "Kiểm tra thông tin lô ....", middleText: "", content: CircularProgressIndicator()); | |||
| try { | |||
| await repository | |||
| .getPlotDetailByCode(cropCode, page: 1, size: 1) | |||
| .then((value) { | |||
| await repository.getPlotDetailByCode(cropCode, page: 1, size: 1).then((value) { | |||
| print("ok"); | |||
| if (Get.isDialogOpen) Get.back(); | |||
| Get.to(PlotDetailScreen( | |||
| cropId: value.tbCropDTO.id, | |||
| cropType: value.tbCropDTO.tbCropTypeId, | |||
| initialIndex: 0)); | |||
| Get.to(PlotDetailScreen(cropId: value.tbCropDTO.id, cropType: value.tbCropDTO.tbCropTypeId, initialIndex: 0)); | |||
| }).catchError((onError) { | |||
| Utils.showDialog( | |||
| title: "Không tìm thấy lô", | |||
| @@ -94,7 +84,7 @@ _showAlertCheckCropCode( | |||
| textCancel: "Huỷ", | |||
| onConfirm: () { | |||
| Get.back(); | |||
| scan(context); | |||
| // scan(context); | |||
| }); | |||
| }); | |||
| } catch (e) { | |||
| @@ -105,7 +95,7 @@ _showAlertCheckCropCode( | |||
| textCancel: "Huỷ", | |||
| onConfirm: () { | |||
| Get.back(); | |||
| scan(context); | |||
| // scan(context); | |||
| }); | |||
| } | |||
| } | |||
| @@ -6,7 +6,6 @@ import 'package:farm_tpf/presentation/custom_widgets/widget_utils.dart'; | |||
| import 'package:file_picker/file_picker.dart'; | |||
| import 'package:flutter/material.dart'; | |||
| import 'package:get/get.dart'; | |||
| import 'package:video_player/video_player.dart'; | |||
| import 'package:path_provider/path_provider.dart'; | |||
| class CameraHelper extends StatefulWidget { | |||
| @@ -27,15 +26,12 @@ IconData getCameraLensIcon(CameraLensDirection direction) { | |||
| throw ArgumentError('Unknown lens direction'); | |||
| } | |||
| void logError(String code, String message) => | |||
| print('Error: $code\nError Message: $message'); | |||
| void logError(String code, String message) => print('Error: $code\nError Message: $message'); | |||
| class _CameraHelperState extends State<CameraHelper> | |||
| with WidgetsBindingObserver { | |||
| class _CameraHelperState extends State<CameraHelper> with WidgetsBindingObserver { | |||
| CameraController controller; | |||
| String imagePath; | |||
| String videoPath; | |||
| VideoPlayerController videoController; | |||
| VoidCallback videoPlayerListener; | |||
| bool enableAudio = true; | |||
| int indexCamera = 0; | |||
| @@ -43,8 +39,7 @@ class _CameraHelperState extends State<CameraHelper> | |||
| @override | |||
| void initState() { | |||
| super.initState(); | |||
| controller = | |||
| CameraController(cameras[indexCamera], ResolutionPreset.medium); | |||
| controller = CameraController(cameras[indexCamera], ResolutionPreset.medium); | |||
| controller.initialize().then((_) { | |||
| if (!mounted) { | |||
| return; | |||
| @@ -97,14 +92,8 @@ class _CameraHelperState extends State<CameraHelper> | |||
| decoration: BoxDecoration( | |||
| color: Colors.black, | |||
| border: Border.all( | |||
| color: | |||
| controller != null && controller.value.isRecordingVideo | |||
| ? Colors.redAccent | |||
| : Colors.grey, | |||
| width: | |||
| controller != null && controller.value.isRecordingVideo | |||
| ? 1.0 | |||
| : 0.0, | |||
| color: controller != null && controller.value.isRecordingVideo ? Colors.redAccent : Colors.grey, | |||
| width: controller != null && controller.value.isRecordingVideo ? 1.0 : 0.0, | |||
| ), | |||
| ), | |||
| ), | |||
| @@ -153,42 +142,24 @@ class _CameraHelperState extends State<CameraHelper> | |||
| size: 30, | |||
| ), | |||
| color: Colors.blue, | |||
| onPressed: controller != null && | |||
| controller.value.isInitialized && | |||
| !controller.value.isRecordingVideo | |||
| ? onTakePictureButtonPressed | |||
| : null, | |||
| onPressed: controller != null && controller.value.isInitialized && !controller.value.isRecordingVideo ? onTakePictureButtonPressed : null, | |||
| ), | |||
| IconButton( | |||
| icon: const Icon(Icons.videocam, size: 35), | |||
| color: Colors.blue, | |||
| onPressed: controller != null && | |||
| controller.value.isInitialized && | |||
| !controller.value.isRecordingVideo | |||
| ? onVideoRecordButtonPressed | |||
| : null, | |||
| onPressed: controller != null && controller.value.isInitialized && !controller.value.isRecordingVideo ? onVideoRecordButtonPressed : null, | |||
| ), | |||
| IconButton( | |||
| icon: controller != null && controller.value.isRecordingPaused | |||
| ? Icon(Icons.play_arrow) | |||
| : Icon(Icons.pause), | |||
| icon: controller != null && controller.value.isRecordingPaused ? Icon(Icons.play_arrow) : Icon(Icons.pause), | |||
| color: Colors.blue, | |||
| onPressed: controller != null && | |||
| controller.value.isInitialized && | |||
| controller.value.isRecordingVideo | |||
| ? (controller != null && controller.value.isRecordingPaused | |||
| ? onResumeButtonPressed | |||
| : onPauseButtonPressed) | |||
| onPressed: controller != null && controller.value.isInitialized && controller.value.isRecordingVideo | |||
| ? (controller != null && controller.value.isRecordingPaused ? onResumeButtonPressed : onPauseButtonPressed) | |||
| : null, | |||
| ), | |||
| IconButton( | |||
| icon: const Icon(Icons.stop), | |||
| color: Colors.red, | |||
| onPressed: controller != null && | |||
| controller.value.isInitialized && | |||
| controller.value.isRecordingVideo | |||
| ? onStopButtonPressed | |||
| : null, | |||
| onPressed: controller != null && controller.value.isInitialized && controller.value.isRecordingVideo ? onStopButtonPressed : null, | |||
| ) | |||
| ], | |||
| ); | |||
| @@ -199,8 +170,7 @@ class _CameraHelperState extends State<CameraHelper> | |||
| if (cameras.isEmpty) { | |||
| return const Text('Không có camera'); | |||
| } else { | |||
| bool disableSwitch = | |||
| controller != null && controller.value.isRecordingVideo; | |||
| bool disableSwitch = controller != null && controller.value.isRecordingVideo; | |||
| if (indexCamera == cameras.length - 1) { | |||
| indexCamera = 0; | |||
| } else { | |||
| @@ -259,8 +229,8 @@ class _CameraHelperState extends State<CameraHelper> | |||
| if (mounted) { | |||
| setState(() { | |||
| imagePath = filePath; | |||
| videoController?.dispose(); | |||
| videoController = null; | |||
| // videoController?.dispose(); | |||
| // videoController = null; | |||
| }); | |||
| if (filePath != null) { | |||
| print('Picture saved to $filePath'); | |||
| @@ -2,82 +2,79 @@ import 'dart:async'; | |||
| import 'dart:io'; | |||
| import 'package:flutter/material.dart'; | |||
| import 'package:video_player/video_player.dart'; | |||
| class VideoWidget extends StatefulWidget { | |||
| final bool play; | |||
| final bool isServerFile; | |||
| final String pathFile; | |||
| const VideoWidget( | |||
| {Key key, | |||
| @required this.pathFile, | |||
| @required this.play, | |||
| @required this.isServerFile}) | |||
| : super(key: key); | |||
| const VideoWidget({Key key, @required this.pathFile, @required this.play, @required this.isServerFile}) : super(key: key); | |||
| @override | |||
| _VideoWidgetState createState() => _VideoWidgetState(); | |||
| } | |||
| class _VideoWidgetState extends State<VideoWidget> { | |||
| VideoPlayerController videoPlayerController; | |||
| Future<void> _initializeVideoPlayerFuture; | |||
| // VideoPlayerController videoPlayerController; | |||
| // Future<void> _initializeVideoPlayerFuture; | |||
| @override | |||
| void initState() { | |||
| super.initState(); | |||
| if (widget.isServerFile) { | |||
| videoPlayerController = VideoPlayerController.network(widget.pathFile); | |||
| } else { | |||
| videoPlayerController = VideoPlayerController.file(File(widget.pathFile)); | |||
| } | |||
| // if (widget.isServerFile) { | |||
| // videoPlayerController = VideoPlayerController.network(widget.pathFile); | |||
| // } else { | |||
| // videoPlayerController = VideoPlayerController.file(File(widget.pathFile)); | |||
| // } | |||
| _initializeVideoPlayerFuture = videoPlayerController.initialize().then((_) { | |||
| // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed. | |||
| videoPlayerController.play(); | |||
| videoPlayerController.setVolume(0.0); | |||
| Timer.periodic(Duration(seconds: 1), (_) { | |||
| videoPlayerController.pause(); | |||
| }); | |||
| setState(() {}); | |||
| }); | |||
| // _initializeVideoPlayerFuture = videoPlayerController.initialize().then((_) { | |||
| // // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed. | |||
| // videoPlayerController.play(); | |||
| // videoPlayerController.setVolume(0.0); | |||
| // Timer.periodic(Duration(seconds: 1), (_) { | |||
| // videoPlayerController.pause(); | |||
| // }); | |||
| // setState(() {}); | |||
| // }); | |||
| } | |||
| @override | |||
| void dispose() { | |||
| videoPlayerController.dispose(); | |||
| // videoPlayerController.dispose(); | |||
| print("dispose video item"); | |||
| super.dispose(); | |||
| } | |||
| @override | |||
| Widget build(BuildContext context) { | |||
| return FutureBuilder( | |||
| future: _initializeVideoPlayerFuture, | |||
| builder: (context, snapshot) { | |||
| if (snapshot.connectionState == ConnectionState.done) { | |||
| return new Container( | |||
| child: Container( | |||
| key: new PageStorageKey(widget.pathFile), | |||
| child: Container( | |||
| padding: EdgeInsets.all(1), | |||
| width: 100, | |||
| height: 100, | |||
| decoration: BoxDecoration( | |||
| color: Colors.white, | |||
| border: Border.all(color: Colors.red), | |||
| borderRadius: BorderRadius.all(Radius.circular(8.0))), | |||
| child: VideoPlayer(videoPlayerController), | |||
| ), | |||
| ), | |||
| ); | |||
| } else { | |||
| return Center( | |||
| child: CircularProgressIndicator(), | |||
| ); | |||
| } | |||
| }, | |||
| return Container( | |||
| child: Text('VideoWidget'), | |||
| ); | |||
| // return FutureBuilder( | |||
| // future: _initializeVideoPlayerFuture, | |||
| // builder: (context, snapshot) { | |||
| // if (snapshot.connectionState == ConnectionState.done) { | |||
| // return new Container( | |||
| // child: Container( | |||
| // key: new PageStorageKey(widget.pathFile), | |||
| // child: Container( | |||
| // padding: EdgeInsets.all(1), | |||
| // width: 100, | |||
| // height: 100, | |||
| // decoration: BoxDecoration( | |||
| // color: Colors.white, | |||
| // border: Border.all(color: Colors.red), | |||
| // borderRadius: BorderRadius.all(Radius.circular(8.0))), | |||
| // child: VideoPlayer(videoPlayerController), | |||
| // ), | |||
| // ), | |||
| // ); | |||
| // } else { | |||
| // return Center( | |||
| // child: CircularProgressIndicator(), | |||
| // ); | |||
| // } | |||
| // }, | |||
| // ); | |||
| } | |||
| } | |||
| @@ -42,17 +42,11 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| var client; | |||
| final changeTabbar = Get.put(TabbarSelected()); | |||
| List<TabbarItem> itemsTabbar = [ | |||
| TabbarItem( | |||
| icon: AppIcons.icPlot, title: 'Lô trồng', index: TabBarIndex.plot), | |||
| TabbarItem( | |||
| icon: AppIcons.icDevice, title: 'Thiết bị', index: TabBarIndex.device), | |||
| TabbarItem(icon: AppIcons.icPlot, title: 'Lô trồng', index: TabBarIndex.plot), | |||
| TabbarItem(icon: AppIcons.icDevice, title: 'Thiết bị', index: TabBarIndex.device), | |||
| TabbarItem(icon: AppIcons.icQr, title: 'Quét QR', index: TabBarIndex.qr), | |||
| TabbarItem( | |||
| icon: AppIcons.icNotification, | |||
| title: 'Thông báo', | |||
| index: TabBarIndex.notification), | |||
| TabbarItem( | |||
| icon: AppIcons.icPerson, title: 'Cá nhân', index: TabBarIndex.account) | |||
| TabbarItem(icon: AppIcons.icNotification, title: 'Thông báo', index: TabBarIndex.notification), | |||
| TabbarItem(icon: AppIcons.icPerson, title: 'Cá nhân', index: TabBarIndex.account) | |||
| ]; | |||
| Future<Null> getSharedPrefs() async { | |||
| @@ -63,8 +57,7 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| options.headers["Authorization"] = "Bearer $token"; | |||
| client = Dio(options); | |||
| if (Platform.isIOS) { | |||
| _firebaseMessaging | |||
| .requestNotificationPermissions(IosNotificationSettings()); | |||
| _firebaseMessaging.requestNotificationPermissions(IosNotificationSettings()); | |||
| } | |||
| _firebaseMessaging.configure( | |||
| onMessage: (Map<String, dynamic> message) async { | |||
| @@ -106,11 +99,8 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| _notificationNavigateOnFCM(message); | |||
| }, | |||
| ); | |||
| _firebaseMessaging.requestNotificationPermissions( | |||
| const IosNotificationSettings( | |||
| sound: true, badge: true, alert: true, provisional: true)); | |||
| _firebaseMessaging.onIosSettingsRegistered | |||
| .listen((IosNotificationSettings settings) { | |||
| _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true, provisional: true)); | |||
| _firebaseMessaging.onIosSettingsRegistered.listen((IosNotificationSettings settings) { | |||
| print("Settings registered: $settings"); | |||
| }); | |||
| if (pushkey?.isEmpty ?? true) { | |||
| @@ -187,8 +177,7 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| builder: (context, AsyncSnapshot<dynamic> snapshot) { | |||
| if (snapshot.hasData) { | |||
| var noti = snapshot.data as NotificationObjectDTO; | |||
| var unreadNoti = | |||
| noti.numberUnreadTotal > 99 ? '99+' : '${noti.numberUnreadTotal}'; | |||
| var unreadNoti = noti.numberUnreadTotal > 99 ? '99+' : '${noti.numberUnreadTotal}'; | |||
| return Text( | |||
| '$unreadNoti', | |||
| softWrap: true, | |||
| @@ -236,10 +225,7 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| bottomNavigationBar: Container( | |||
| padding: EdgeInsets.all(4), | |||
| height: 70, | |||
| decoration: BoxDecoration( | |||
| color: Colors.white, | |||
| border: Border( | |||
| top: BorderSide(color: Colors.grey, width: 0.35))), | |||
| decoration: BoxDecoration(color: Colors.white, border: Border(top: BorderSide(color: Colors.grey, width: 0.35))), | |||
| child: GetBuilder<TabbarSelected>(builder: (tabbarSelected) { | |||
| return Center( | |||
| child: ListView.builder( | |||
| @@ -261,36 +247,25 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| badgeContent: textCountNoti(), | |||
| shape: BadgeShape.circle, | |||
| badgeColor: Colors.red, | |||
| position: BadgePosition( | |||
| top: -15, start: 10), | |||
| position: BadgePosition(top: -15, start: 10), | |||
| child: SvgPicture.asset( | |||
| itemsTabbar[index].icon, | |||
| width: 24, | |||
| height: 24, | |||
| color: (tabbarSelected.index == | |||
| itemsTabbar[index] | |||
| .index) | |||
| ? AppColors.YELLOW | |||
| : AppColors.GRAY1, | |||
| color: (tabbarSelected.index == itemsTabbar[index].index) ? AppColors.YELLOW : AppColors.GRAY1, | |||
| ), | |||
| ) | |||
| : SvgPicture.asset( | |||
| itemsTabbar[index].icon, | |||
| width: 24, | |||
| height: 24, | |||
| color: (tabbarSelected.index == | |||
| itemsTabbar[index].index) | |||
| ? AppColors.YELLOW | |||
| : AppColors.GRAY1, | |||
| color: (tabbarSelected.index == itemsTabbar[index].index) ? AppColors.YELLOW : AppColors.GRAY1, | |||
| ), | |||
| Flexible( | |||
| child: Text( | |||
| itemsTabbar[index].title, | |||
| style: TextStyle( | |||
| color: (tabbarSelected.index == | |||
| itemsTabbar[index].index) | |||
| ? AppColors.DEFAULT | |||
| : Colors.grey, | |||
| color: (tabbarSelected.index == itemsTabbar[index].index) ? AppColors.DEFAULT : Colors.grey, | |||
| fontSize: 9), | |||
| ), | |||
| ) | |||
| @@ -300,10 +275,9 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| //Open scan qr code when tap icon in tabbar | |||
| if (index == 2) { | |||
| changeTabbar.changeIndex(changeTabbar.index); | |||
| scan(context); | |||
| // scan(context); | |||
| } else { | |||
| changeTabbar | |||
| .changeIndex(itemsTabbar[index].index); | |||
| changeTabbar.changeIndex(itemsTabbar[index].index); | |||
| } | |||
| }, | |||
| ); | |||
| @@ -2,8 +2,8 @@ class ConstCommon { | |||
| static int kExpiredTime = 518400000; //6* 24 * 60 * 60 * 1000; 6days | |||
| static int kFileSize = 1000000; //1M = 1000.000 bytes | |||
| static int kMaxAgeCache = 7; // 7days | |||
| static const String baseUrl = "https://smartfarm.aztrace.vn"; | |||
| static const String baseImageUrl = "https://smartfarm.aztrace.vn/upload/"; | |||
| static const String baseUrl = "https://tpf.aztrace.vn"; | |||
| static const String baseImageUrl = "https://tpf.aztrace.vn/upload/"; | |||
| static RegExp regExpDecimal = RegExp("[0-9.]"); | |||
| static const String supplyTypeSeed = "GIONG"; | |||
| @@ -28,7 +28,7 @@ packages: | |||
| name: async | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "2.5.0-nullsafety.1" | |||
| version: "2.8.1" | |||
| auto_size_text: | |||
| dependency: "direct main" | |||
| description: | |||
| @@ -43,13 +43,6 @@ packages: | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.1.6" | |||
| barcode_scan: | |||
| dependency: "direct main" | |||
| description: | |||
| name: barcode_scan | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "3.0.1" | |||
| bloc: | |||
| dependency: transitive | |||
| description: | |||
| @@ -63,7 +56,7 @@ packages: | |||
| name: boolean_selector | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "2.1.0-nullsafety.1" | |||
| version: "2.1.0" | |||
| build: | |||
| dependency: transitive | |||
| description: | |||
| @@ -147,14 +140,14 @@ packages: | |||
| name: characters | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.1.0-nullsafety.3" | |||
| version: "1.1.0" | |||
| charcode: | |||
| dependency: transitive | |||
| description: | |||
| name: charcode | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.2.0-nullsafety.1" | |||
| version: "1.3.1" | |||
| checked_yaml: | |||
| dependency: transitive | |||
| description: | |||
| @@ -175,7 +168,7 @@ packages: | |||
| name: clock | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.1.0-nullsafety.1" | |||
| version: "1.1.0" | |||
| code_builder: | |||
| dependency: transitive | |||
| description: | |||
| @@ -189,7 +182,7 @@ packages: | |||
| name: collection | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.15.0-nullsafety.3" | |||
| version: "1.15.0" | |||
| convert: | |||
| dependency: transitive | |||
| description: | |||
| @@ -245,14 +238,14 @@ packages: | |||
| name: fake_async | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.2.0-nullsafety.1" | |||
| version: "1.2.0" | |||
| ffi: | |||
| dependency: transitive | |||
| dependency: "direct main" | |||
| description: | |||
| name: ffi | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.1.3" | |||
| version: "1.2.1" | |||
| file: | |||
| dependency: transitive | |||
| description: | |||
| @@ -355,7 +348,7 @@ packages: | |||
| name: flutter_svg | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.19.1" | |||
| version: "0.20.0-nullsafety.3" | |||
| flutter_test: | |||
| dependency: "direct dev" | |||
| description: flutter | |||
| @@ -456,7 +449,7 @@ packages: | |||
| name: js | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.6.2" | |||
| version: "0.6.3" | |||
| json_annotation: | |||
| dependency: transitive | |||
| description: | |||
| @@ -491,14 +484,14 @@ packages: | |||
| name: matcher | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.12.10-nullsafety.1" | |||
| version: "0.12.10" | |||
| meta: | |||
| dependency: "direct main" | |||
| description: | |||
| name: meta | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.3.0-nullsafety.3" | |||
| version: "1.7.0" | |||
| mime: | |||
| dependency: "direct main" | |||
| description: | |||
| @@ -554,21 +547,21 @@ packages: | |||
| name: path | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.8.0-nullsafety.1" | |||
| version: "1.8.0" | |||
| path_drawing: | |||
| dependency: transitive | |||
| description: | |||
| name: path_drawing | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.4.1+1" | |||
| version: "0.5.1+1" | |||
| path_parsing: | |||
| dependency: transitive | |||
| description: | |||
| name: path_parsing | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.1.4" | |||
| version: "0.2.1" | |||
| path_provider: | |||
| dependency: "direct main" | |||
| description: | |||
| @@ -603,7 +596,7 @@ packages: | |||
| name: path_provider_windows | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.0.4+3" | |||
| version: "0.0.5" | |||
| pattern_formatter: | |||
| dependency: "direct main" | |||
| description: | |||
| @@ -624,7 +617,7 @@ packages: | |||
| name: petitparser | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "3.1.0" | |||
| version: "4.4.0" | |||
| platform: | |||
| dependency: transitive | |||
| description: | |||
| @@ -653,13 +646,6 @@ packages: | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "3.0.13" | |||
| protobuf: | |||
| dependency: transitive | |||
| description: | |||
| name: protobuf | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.1.0" | |||
| provider: | |||
| dependency: transitive | |||
| description: | |||
| @@ -757,7 +743,7 @@ packages: | |||
| name: shared_preferences_windows | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.0.2+2" | |||
| version: "0.0.2+3" | |||
| shelf: | |||
| dependency: transitive | |||
| description: | |||
| @@ -797,7 +783,7 @@ packages: | |||
| name: source_span | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.8.0-nullsafety.2" | |||
| version: "1.8.1" | |||
| sqflite: | |||
| dependency: transitive | |||
| description: | |||
| @@ -818,14 +804,14 @@ packages: | |||
| name: stack_trace | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.10.0-nullsafety.1" | |||
| version: "1.10.0" | |||
| stream_channel: | |||
| dependency: transitive | |||
| description: | |||
| name: stream_channel | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "2.1.0-nullsafety.1" | |||
| version: "2.1.0" | |||
| stream_transform: | |||
| dependency: transitive | |||
| description: | |||
| @@ -839,7 +825,7 @@ packages: | |||
| name: string_scanner | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.1.0-nullsafety.1" | |||
| version: "1.1.0" | |||
| synchronized: | |||
| dependency: transitive | |||
| description: | |||
| @@ -853,14 +839,14 @@ packages: | |||
| name: term_glyph | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.2.0-nullsafety.1" | |||
| version: "1.2.0" | |||
| test_api: | |||
| dependency: transitive | |||
| description: | |||
| name: test_api | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.2.19-nullsafety.2" | |||
| version: "0.4.2" | |||
| timing: | |||
| dependency: transitive | |||
| description: | |||
| @@ -881,7 +867,7 @@ packages: | |||
| name: typed_data | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.3.0-nullsafety.3" | |||
| version: "1.3.0" | |||
| uuid: | |||
| dependency: transitive | |||
| description: | |||
| @@ -895,28 +881,7 @@ packages: | |||
| name: vector_math | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "2.1.0-nullsafety.3" | |||
| video_player: | |||
| dependency: "direct main" | |||
| description: | |||
| name: video_player | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.10.12+5" | |||
| video_player_platform_interface: | |||
| dependency: transitive | |||
| description: | |||
| name: video_player_platform_interface | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "2.2.0" | |||
| video_player_web: | |||
| dependency: transitive | |||
| description: | |||
| name: video_player_web | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "0.1.4+1" | |||
| version: "2.1.0" | |||
| watcher: | |||
| dependency: transitive | |||
| description: | |||
| @@ -937,7 +902,7 @@ packages: | |||
| name: win32 | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "1.7.4" | |||
| version: "2.3.6" | |||
| xdg_directories: | |||
| dependency: transitive | |||
| description: | |||
| @@ -951,7 +916,7 @@ packages: | |||
| name: xml | |||
| url: "https://pub.dartlang.org" | |||
| source: hosted | |||
| version: "4.5.1" | |||
| version: "5.3.1" | |||
| yaml: | |||
| dependency: transitive | |||
| description: | |||
| @@ -960,5 +925,5 @@ packages: | |||
| source: hosted | |||
| version: "2.2.1" | |||
| sdks: | |||
| dart: ">=2.10.2 <2.11.0" | |||
| flutter: ">=1.22.2 <2.0.0" | |||
| dart: ">=2.14.0 <3.0.0" | |||
| flutter: ">=1.24.0-7.0" | |||
| @@ -25,8 +25,8 @@ dependencies: | |||
| keyboard_dismisser: ^1.0.2 | |||
| pattern_formatter: ^1.0.2 | |||
| rxdart: ^0.23.0 | |||
| barcode_scan: ^3.0.1 | |||
| video_player: ^0.10.11+2 | |||
| # barcode_scan: ^3.0.1 | |||
| # video_player: ^0.10.11+2 | |||
| shimmer: ^1.1.1 | |||
| font_awesome_flutter: ^8.8.1 | |||
| package_info: ^0.4.3 | |||
| @@ -51,8 +51,10 @@ dependencies: | |||
| mime: ^0.9.7 | |||
| flutter_image_compress: ^0.7.0 | |||
| flutter_svg: ^0.19.1 | |||
| flutter_svg: ^0.20.0-nullsafety.3 | |||
| google_fonts: ^1.1.1 | |||
| ffi: ^1.0.0 | |||
| # qr_code_scanner: ^1.0.1 | |||
| dev_dependencies: | |||