chore: update app version to 1.9.0, change Flutter build mode to debug, and add changes field to app info model for update dialogs

This commit is contained in:
2025-12-29 16:23:19 +03:30
parent b290094164
commit 4a96dbe2b8
7 changed files with 68 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
sdk.dir=C:\\Users\\Housh11\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=release
flutter.buildMode=debug
flutter.versionName=1.3.43
flutter.versionCode=39

View File

@@ -19,6 +19,7 @@ abstract class Info with _$Info {
String? minVersion,
String? module,
bool? required,
List<String>? changes,
}) = _Info;
factory Info.fromJson(Map<String, dynamic> json) => _$InfoFromJson(json);

View File

@@ -308,7 +308,7 @@ $InfoCopyWith<$Res>? get info {
/// @nodoc
mixin _$Info {
String? get version; String? get minVersion; String? get module; bool? get required;
String? get version; String? get minVersion; String? get module; bool? get required; List<String>? get changes;
/// 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<Info> get copyWith => _$InfoCopyWithImpl<Info>(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.minVersion, minVersion) || other.minVersion == minVersion)&&(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)&&const DeepCollectionEquality().equals(other.changes, changes));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,version,minVersion,module,required);
int get hashCode => Object.hash(runtimeType,version,minVersion,module,required,const DeepCollectionEquality().hash(changes));
@override
String toString() {
return 'Info(version: $version, minVersion: $minVersion, module: $module, required: $required)';
return 'Info(version: $version, minVersion: $minVersion, module: $module, required: $required, changes: $changes)';
}
@@ -341,7 +341,7 @@ abstract mixin class $InfoCopyWith<$Res> {
factory $InfoCopyWith(Info value, $Res Function(Info) _then) = _$InfoCopyWithImpl;
@useResult
$Res call({
String? version, String? minVersion, String? module, bool? required
String? version, String? minVersion, String? module, bool? required, List<String>? changes
});
@@ -358,13 +358,14 @@ 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? minVersion = 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,Object? changes = 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?,
as bool?,changes: freezed == changes ? _self.changes : changes // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
@@ -449,10 +450,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? version, String? minVersion, String? module, bool? required)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? version, String? minVersion, String? module, bool? required, List<String>? changes)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Info() when $default != null:
return $default(_that.version,_that.minVersion,_that.module,_that.required);case _:
return $default(_that.version,_that.minVersion,_that.module,_that.required,_that.changes);case _:
return orElse();
}
@@ -470,10 +471,10 @@ return $default(_that.version,_that.minVersion,_that.module,_that.required);case
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? version, String? minVersion, String? module, bool? required) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? version, String? minVersion, String? module, bool? required, List<String>? changes) $default,) {final _that = this;
switch (_that) {
case _Info():
return $default(_that.version,_that.minVersion,_that.module,_that.required);case _:
return $default(_that.version,_that.minVersion,_that.module,_that.required,_that.changes);case _:
throw StateError('Unexpected subclass');
}
@@ -490,10 +491,10 @@ return $default(_that.version,_that.minVersion,_that.module,_that.required);case
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? version, String? minVersion, String? module, bool? required)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? version, String? minVersion, String? module, bool? required, List<String>? changes)? $default,) {final _that = this;
switch (_that) {
case _Info() when $default != null:
return $default(_that.version,_that.minVersion,_that.module,_that.required);case _:
return $default(_that.version,_that.minVersion,_that.module,_that.required,_that.changes);case _:
return null;
}
@@ -505,13 +506,22 @@ return $default(_that.version,_that.minVersion,_that.module,_that.required);case
@JsonSerializable()
class _Info implements Info {
const _Info({this.version, this.minVersion, this.module, this.required});
const _Info({this.version, this.minVersion, this.module, this.required, final List<String>? changes}): _changes = changes;
factory _Info.fromJson(Map<String, dynamic> json) => _$InfoFromJson(json);
@override final String? version;
@override final String? minVersion;
@override final String? module;
@override final bool? required;
final List<String>? _changes;
@override List<String>? get changes {
final value = _changes;
if (value == null) return null;
if (_changes is EqualUnmodifiableListView) return _changes;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
/// Create a copy of Info
/// with the given fields replaced by the non-null parameter values.
@@ -526,16 +536,16 @@ Map<String, dynamic> 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.minVersion, minVersion) || other.minVersion == minVersion)&&(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)&&const DeepCollectionEquality().equals(other._changes, _changes));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,version,minVersion,module,required);
int get hashCode => Object.hash(runtimeType,version,minVersion,module,required,const DeepCollectionEquality().hash(_changes));
@override
String toString() {
return 'Info(version: $version, minVersion: $minVersion, module: $module, required: $required)';
return 'Info(version: $version, minVersion: $minVersion, module: $module, required: $required, changes: $changes)';
}
@@ -546,7 +556,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? minVersion, String? module, bool? required
String? version, String? minVersion, String? module, bool? required, List<String>? changes
});
@@ -563,13 +573,14 @@ 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? minVersion = 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,Object? changes = 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?,
as bool?,changes: freezed == changes ? _self._changes : changes // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}

View File

@@ -27,6 +27,9 @@ _Info _$InfoFromJson(Map<String, dynamic> json) => _Info(
minVersion: json['minVersion'] as String?,
module: json['module'] as String?,
required: json['required'] as bool?,
changes: (json['changes'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
);
Map<String, dynamic> _$InfoToJson(_Info instance) => <String, dynamic>{
@@ -34,4 +37,5 @@ Map<String, dynamic> _$InfoToJson(_Info instance) => <String, dynamic>{
'minVersion': instance.minVersion,
'module': instance.module,
'required': instance.required,
'changes': instance.changes,
};

View File

@@ -70,6 +70,7 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin {
onConfirm: () async {
await fileDownload();
},
changes: appInfoModel?.info?.changes,
);
} else if (!data && Get.isDialogOpen == true) {
Get.back();

View File

@@ -1,13 +1,35 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
Future<void> requiredUpdateDialog({required Future<void> Function() onConfirm}) async {
Future<void> requiredUpdateDialog({
required Future<void> Function() onConfirm,
required List<String>? changes,
}) async {
await Get.defaultDialog(
barrierDismissible: false,
onWillPop: () async => false,
title: 'بروزرسانی',
middleText: 'برای استفاده از امکانات برنامه لطفا برنامه را بروز رسانی نمایید.',
content: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8.h,
children:
changes
?.map(
(e) => Text(
e,
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
),
)
.toList() ??
[],
),
),
middleText:
'برای استفاده از امکانات برنامه لطفا برنامه را بروز رسانی نمایید.',
confirm: RElevated(
height: 40.h,
width: 150.w,
@@ -28,12 +50,15 @@ Future<void> requiredUpdateDialog({required Future<void> Function() onConfirm})
);
}
Future<void> optionalUpdateDialog({required Future<void> Function() onConfirm}) async {
Future<void> optionalUpdateDialog({
required Future<void> Function() onConfirm,
}) async {
await Get.defaultDialog(
barrierDismissible: false,
onWillPop: () async => false,
title: 'بروزرسانی',
middleText: 'برای استفاده از امکانات جدید برنامه می توانید آن را بروزرسانی نمایید.',
middleText:
'برای استفاده از امکانات جدید برنامه می توانید آن را بروزرسانی نمایید.',
confirm: RElevated(
height: 40.h,
width: 150.w,

View File

@@ -1394,7 +1394,7 @@ packages:
path: "packages/chicken"
relative: true
source: path
version: "1.8.0"
version: "1.9.0"
rasadyar_core:
dependency: "direct main"
description: