From d256477cb81d34cd623ea2f38d035a003f91c8c4 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Wed, 3 Dec 2025 08:06:06 +0330 Subject: [PATCH] chore: update app version to 1.3.34+31, change build mode to release, and add permission for package installation; refactor AppInfoModel and Info models to include file and minVersion attributes --- android/app/src/main/AndroidManifest.xml | 1 + android/local.properties | 6 +- lib/data/model/app_info_model.dart | 13 ++- lib/data/model/app_info_model.freezed.dart | 81 ++++++++++--------- lib/data/model/app_info_model.g.dart | 6 +- lib/presentation/pages/splash/logic.dart | 4 +- .../pages/inspection_map/logic.dart | 1 - .../lib/data/common/checkk_di_middleware.dart | 2 - .../lib/presentation/page/root/logic.dart | 1 - pubspec.yaml | 2 +- 10 files changed, 63 insertions(+), 54 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index aed2f1e..fbb47e0 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -13,6 +13,7 @@ + diff --git a/android/local.properties b/android/local.properties index 8cd06f6..018d846 100644 --- a/android/local.properties +++ b/android/local.properties @@ -1,5 +1,5 @@ sdk.dir=C:\\Users\\Housh11\\AppData\\Local\\Android\\sdk flutter.sdk=C:\\src\\flutter -flutter.buildMode=debug -flutter.versionName=1.3.33 -flutter.versionCode=30 \ No newline at end of file +flutter.buildMode=release +flutter.versionName=1.3.34 +flutter.versionCode=31 \ No newline at end of file diff --git a/lib/data/model/app_info_model.dart b/lib/data/model/app_info_model.dart index e6eb9f9..e7b6d15 100644 --- a/lib/data/model/app_info_model.dart +++ b/lib/data/model/app_info_model.dart @@ -5,14 +5,21 @@ part 'app_info_model.g.dart'; @freezed abstract class AppInfoModel with _$AppInfoModel { - const factory AppInfoModel({String? key, String? download_link, Info? info}) = _AppInfoModel; + const factory AppInfoModel({String? key, String? file, Info? info}) = + _AppInfoModel; - factory AppInfoModel.fromJson(Map json) => _$AppInfoModelFromJson(json); + factory AppInfoModel.fromJson(Map json) => + _$AppInfoModelFromJson(json); } @freezed abstract class Info with _$Info { - const factory Info({String? version, String? module, bool? required}) = _Info; + const factory Info({ + String? version, + String? minVersion, + String? module, + bool? required, + }) = _Info; factory Info.fromJson(Map json) => _$InfoFromJson(json); } diff --git a/lib/data/model/app_info_model.freezed.dart b/lib/data/model/app_info_model.freezed.dart index dc05818..05bf09d 100644 --- a/lib/data/model/app_info_model.freezed.dart +++ b/lib/data/model/app_info_model.freezed.dart @@ -15,7 +15,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$AppInfoModel { - String? get key; String? get download_link; Info? get info; + String? get key; String? get file; Info? get info; /// Create a copy of AppInfoModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -28,16 +28,16 @@ $AppInfoModelCopyWith get copyWith => _$AppInfoModelCopyWithImpl Object.hash(runtimeType,key,download_link,info); +int get hashCode => Object.hash(runtimeType,key,file,info); @override String toString() { - return 'AppInfoModel(key: $key, download_link: $download_link, info: $info)'; + return 'AppInfoModel(key: $key, file: $file, info: $info)'; } @@ -48,7 +48,7 @@ abstract mixin class $AppInfoModelCopyWith<$Res> { factory $AppInfoModelCopyWith(AppInfoModel value, $Res Function(AppInfoModel) _then) = _$AppInfoModelCopyWithImpl; @useResult $Res call({ - String? key, String? download_link, Info? info + String? key, String? file, Info? info }); @@ -65,10 +65,10 @@ class _$AppInfoModelCopyWithImpl<$Res> /// Create a copy of AppInfoModel /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? download_link = freezed,Object? info = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? file = freezed,Object? info = freezed,}) { return _then(_self.copyWith( key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable -as String?,download_link: freezed == download_link ? _self.download_link : download_link // ignore: cast_nullable_to_non_nullable +as String?,file: freezed == file ? _self.file : file // ignore: cast_nullable_to_non_nullable as String?,info: freezed == info ? _self.info : info // ignore: cast_nullable_to_non_nullable as Info?, )); @@ -167,10 +167,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? download_link, Info? info)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? file, Info? info)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _AppInfoModel() when $default != null: -return $default(_that.key,_that.download_link,_that.info);case _: +return $default(_that.key,_that.file,_that.info);case _: return orElse(); } @@ -188,10 +188,10 @@ return $default(_that.key,_that.download_link,_that.info);case _: /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String? key, String? download_link, Info? info) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String? key, String? file, Info? info) $default,) {final _that = this; switch (_that) { case _AppInfoModel(): -return $default(_that.key,_that.download_link,_that.info);case _: +return $default(_that.key,_that.file,_that.info);case _: throw StateError('Unexpected subclass'); } @@ -208,10 +208,10 @@ return $default(_that.key,_that.download_link,_that.info);case _: /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? download_link, Info? info)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? file, Info? info)? $default,) {final _that = this; switch (_that) { case _AppInfoModel() when $default != null: -return $default(_that.key,_that.download_link,_that.info);case _: +return $default(_that.key,_that.file,_that.info);case _: return null; } @@ -223,11 +223,11 @@ return $default(_that.key,_that.download_link,_that.info);case _: @JsonSerializable() class _AppInfoModel implements AppInfoModel { - const _AppInfoModel({this.key, this.download_link, this.info}); + const _AppInfoModel({this.key, this.file, this.info}); factory _AppInfoModel.fromJson(Map json) => _$AppInfoModelFromJson(json); @override final String? key; -@override final String? download_link; +@override final String? file; @override final Info? info; /// Create a copy of AppInfoModel @@ -243,16 +243,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppInfoModel&&(identical(other.key, key) || other.key == key)&&(identical(other.download_link, download_link) || other.download_link == download_link)&&(identical(other.info, info) || other.info == info)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppInfoModel&&(identical(other.key, key) || other.key == key)&&(identical(other.file, file) || other.file == file)&&(identical(other.info, info) || other.info == info)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,key,download_link,info); +int get hashCode => Object.hash(runtimeType,key,file,info); @override String toString() { - return 'AppInfoModel(key: $key, download_link: $download_link, info: $info)'; + return 'AppInfoModel(key: $key, file: $file, info: $info)'; } @@ -263,7 +263,7 @@ abstract mixin class _$AppInfoModelCopyWith<$Res> implements $AppInfoModelCopyWi factory _$AppInfoModelCopyWith(_AppInfoModel value, $Res Function(_AppInfoModel) _then) = __$AppInfoModelCopyWithImpl; @override @useResult $Res call({ - String? key, String? download_link, Info? info + String? key, String? file, Info? info }); @@ -280,10 +280,10 @@ class __$AppInfoModelCopyWithImpl<$Res> /// Create a copy of AppInfoModel /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? download_link = freezed,Object? info = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? file = freezed,Object? info = freezed,}) { return _then(_AppInfoModel( key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable -as String?,download_link: freezed == download_link ? _self.download_link : download_link // ignore: cast_nullable_to_non_nullable +as String?,file: freezed == file ? _self.file : file // ignore: cast_nullable_to_non_nullable as String?,info: freezed == info ? _self.info : info // ignore: cast_nullable_to_non_nullable as Info?, )); @@ -308,7 +308,7 @@ $InfoCopyWith<$Res>? get info { /// @nodoc mixin _$Info { - String? get version; String? get module; bool? get required; + String? get version; String? get minVersion; String? get module; bool? get required; /// Create a copy of Info /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -321,16 +321,16 @@ $InfoCopyWith get copyWith => _$InfoCopyWithImpl(this as Info, _$ide @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is Info&&(identical(other.version, version) || other.version == version)&&(identical(other.module, module) || other.module == module)&&(identical(other.required, required) || other.required == required)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is Info&&(identical(other.version, version) || other.version == version)&&(identical(other.minVersion, minVersion) || other.minVersion == minVersion)&&(identical(other.module, module) || other.module == module)&&(identical(other.required, required) || other.required == required)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,version,module,required); +int get hashCode => Object.hash(runtimeType,version,minVersion,module,required); @override String toString() { - return 'Info(version: $version, module: $module, required: $required)'; + return 'Info(version: $version, minVersion: $minVersion, module: $module, required: $required)'; } @@ -341,7 +341,7 @@ abstract mixin class $InfoCopyWith<$Res> { factory $InfoCopyWith(Info value, $Res Function(Info) _then) = _$InfoCopyWithImpl; @useResult $Res call({ - String? version, String? module, bool? required + String? version, String? minVersion, String? module, bool? required }); @@ -358,9 +358,10 @@ class _$InfoCopyWithImpl<$Res> /// Create a copy of Info /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? version = freezed,Object? module = freezed,Object? required = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? version = freezed,Object? minVersion = freezed,Object? module = freezed,Object? required = freezed,}) { return _then(_self.copyWith( version: freezed == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as String?,minVersion: freezed == minVersion ? _self.minVersion : minVersion // ignore: cast_nullable_to_non_nullable as String?,module: freezed == module ? _self.module : module // ignore: cast_nullable_to_non_nullable as String?,required: freezed == required ? _self.required : required // ignore: cast_nullable_to_non_nullable as bool?, @@ -448,10 +449,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String? version, String? module, bool? required)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String? version, String? minVersion, String? module, bool? required)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _Info() when $default != null: -return $default(_that.version,_that.module,_that.required);case _: +return $default(_that.version,_that.minVersion,_that.module,_that.required);case _: return orElse(); } @@ -469,10 +470,10 @@ return $default(_that.version,_that.module,_that.required);case _: /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String? version, String? module, bool? required) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String? version, String? minVersion, String? module, bool? required) $default,) {final _that = this; switch (_that) { case _Info(): -return $default(_that.version,_that.module,_that.required);case _: +return $default(_that.version,_that.minVersion,_that.module,_that.required);case _: throw StateError('Unexpected subclass'); } @@ -489,10 +490,10 @@ return $default(_that.version,_that.module,_that.required);case _: /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? version, String? module, bool? required)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? version, String? minVersion, String? module, bool? required)? $default,) {final _that = this; switch (_that) { case _Info() when $default != null: -return $default(_that.version,_that.module,_that.required);case _: +return $default(_that.version,_that.minVersion,_that.module,_that.required);case _: return null; } @@ -504,10 +505,11 @@ return $default(_that.version,_that.module,_that.required);case _: @JsonSerializable() class _Info implements Info { - const _Info({this.version, this.module, this.required}); + const _Info({this.version, this.minVersion, this.module, this.required}); factory _Info.fromJson(Map json) => _$InfoFromJson(json); @override final String? version; +@override final String? minVersion; @override final String? module; @override final bool? required; @@ -524,16 +526,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _Info&&(identical(other.version, version) || other.version == version)&&(identical(other.module, module) || other.module == module)&&(identical(other.required, required) || other.required == required)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Info&&(identical(other.version, version) || other.version == version)&&(identical(other.minVersion, minVersion) || other.minVersion == minVersion)&&(identical(other.module, module) || other.module == module)&&(identical(other.required, required) || other.required == required)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,version,module,required); +int get hashCode => Object.hash(runtimeType,version,minVersion,module,required); @override String toString() { - return 'Info(version: $version, module: $module, required: $required)'; + return 'Info(version: $version, minVersion: $minVersion, module: $module, required: $required)'; } @@ -544,7 +546,7 @@ abstract mixin class _$InfoCopyWith<$Res> implements $InfoCopyWith<$Res> { factory _$InfoCopyWith(_Info value, $Res Function(_Info) _then) = __$InfoCopyWithImpl; @override @useResult $Res call({ - String? version, String? module, bool? required + String? version, String? minVersion, String? module, bool? required }); @@ -561,9 +563,10 @@ class __$InfoCopyWithImpl<$Res> /// Create a copy of Info /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? version = freezed,Object? module = freezed,Object? required = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? version = freezed,Object? minVersion = freezed,Object? module = freezed,Object? required = freezed,}) { return _then(_Info( version: freezed == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as String?,minVersion: freezed == minVersion ? _self.minVersion : minVersion // ignore: cast_nullable_to_non_nullable as String?,module: freezed == module ? _self.module : module // ignore: cast_nullable_to_non_nullable as String?,required: freezed == required ? _self.required : required // ignore: cast_nullable_to_non_nullable as bool?, diff --git a/lib/data/model/app_info_model.g.dart b/lib/data/model/app_info_model.g.dart index 90cd6a5..3619ebe 100644 --- a/lib/data/model/app_info_model.g.dart +++ b/lib/data/model/app_info_model.g.dart @@ -9,7 +9,7 @@ part of 'app_info_model.dart'; _AppInfoModel _$AppInfoModelFromJson(Map json) => _AppInfoModel( key: json['key'] as String?, - download_link: json['download_link'] as String?, + file: json['file'] as String?, info: json['info'] == null ? null : Info.fromJson(json['info'] as Map), @@ -18,18 +18,20 @@ _AppInfoModel _$AppInfoModelFromJson(Map json) => Map _$AppInfoModelToJson(_AppInfoModel instance) => { 'key': instance.key, - 'download_link': instance.download_link, + 'file': instance.file, 'info': instance.info, }; _Info _$InfoFromJson(Map json) => _Info( version: json['version'] as String?, + minVersion: json['minVersion'] as String?, module: json['module'] as String?, required: json['required'] as bool?, ); Map _$InfoToJson(_Info instance) => { 'version': instance.version, + 'minVersion': instance.minVersion, 'module': instance.module, 'required': instance.required, }; diff --git a/lib/presentation/pages/splash/logic.dart b/lib/presentation/pages/splash/logic.dart index d6fc2db..d088dfc 100644 --- a/lib/presentation/pages/splash/logic.dart +++ b/lib/presentation/pages/splash/logic.dart @@ -185,7 +185,7 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin { try { final info = await PackageInfo.fromPlatform(); int version = info.version.versionNumber; - var res = await _dio.get("https://rsibackend.rasadyaar.ir/app/apk-info/"); + var res = await _dio.get("https://rsibackend.rasadyar.com/app/rasadyar-app-info/"); appInfoModel = AppInfoModel.fromJson(res.data); @@ -214,7 +214,7 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin { while (attempts < retryCount && !success) { try { await _dio.download( - appInfoModel?.download_link ?? '', + appInfoModel?.file ?? '', filePath, onReceiveProgress: (count, total) { if (total != -1 && total > 0) { diff --git a/packages/inspection/lib/presentation/pages/inspection_map/logic.dart b/packages/inspection/lib/presentation/pages/inspection_map/logic.dart index 7875532..f5bbcc6 100644 --- a/packages/inspection/lib/presentation/pages/inspection_map/logic.dart +++ b/packages/inspection/lib/presentation/pages/inspection_map/logic.dart @@ -4,7 +4,6 @@ import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository_imp.dart'; import 'package:rasadyar_inspection/injection/inspection_di.dart'; -import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart' hide BaseLogic; import 'widget/map/logic.dart'; diff --git a/packages/livestock/lib/data/common/checkk_di_middleware.dart b/packages/livestock/lib/data/common/checkk_di_middleware.dart index 7ca3e64..2ced215 100644 --- a/packages/livestock/lib/data/common/checkk_di_middleware.dart +++ b/packages/livestock/lib/data/common/checkk_di_middleware.dart @@ -1,6 +1,4 @@ -import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_livestock/injection/live_stock_di.dart'; class CheckDiMiddleWare extends GetMiddleware { diff --git a/packages/livestock/lib/presentation/page/root/logic.dart b/packages/livestock/lib/presentation/page/root/logic.dart index 3b3a76f..2e265ec 100644 --- a/packages/livestock/lib/presentation/page/root/logic.dart +++ b/packages/livestock/lib/presentation/page/root/logic.dart @@ -1,4 +1,3 @@ -import 'dart:math'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index f2adbe2..6f1aed0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: rasadyar_app description: "A new Flutter project." publish_to: 'none' -version: 1.3.33+30 +version: 1.3.34+31 environment: sdk: ^3.9.2