From bcd135a9950086e1196b49e3dfdee7a4bfd52518 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Mon, 9 Feb 2026 02:05:19 +0330 Subject: [PATCH 01/10] Update dependencies and resolve breaking changes --- lib/app/advertise_director.dart | 10 +- lib/app/router/app_router.dart | 1 + lib/common/dtos/app_api_response.dart | 8 +- lib/common/dtos/app_api_response.freezed.dart | 2195 ++++++++--------- lib/common/dtos/app_api_response.g.dart | 81 +- .../core/desktop_platform_handler.dart | 1 + .../application/main_screen_provider.dart | 1 + .../main/presentation/widgets/google_ads.dart | 1 + .../presentation/widgets/logs_widget.dart | 11 +- .../presentation/widgets/tips_widget.dart | 1 + .../settings/providers/settings_provider.dart | 3 +- .../application/speed_test_provider.dart | 1 + .../speed_test/data/api/speed_test_api.g.dart | 30 +- lib/shared/providers/app_screen_provider.dart | 2 +- .../providers/connection_state_provider.dart | 2 +- lib/shared/providers/flow_line_provider.dart | 2 +- lib/shared/providers/group_provider.dart | 2 +- lib/shared/providers/logs_provider.dart | 2 +- pubspec.lock | 444 ++-- pubspec.yaml | 30 +- 20 files changed, 1465 insertions(+), 1363 deletions(-) diff --git a/lib/app/advertise_director.dart b/lib/app/advertise_director.dart index 1022a14..d1c1d03 100644 --- a/lib/app/advertise_director.dart +++ b/lib/app/advertise_director.dart @@ -10,14 +10,14 @@ class AdvertiseDirector { AdvertiseDirector(this.ref); static Future shouldUseInternalAds(WidgetRef ref) async { - final String currentTimeZone = await FlutterTimezone.getLocalTimezone(); + final currentTimeZone = await FlutterTimezone.getLocalTimezone(); final adversies = await ref.read(secureStorageProvider).readMap(apiAvertiseKey); if (adversies['api_advertise'] != null) { final advertiseMap = adversies['api_advertise'] as Map; - return advertiseMap.containsKey(currentTimeZone); + return advertiseMap.containsKey(currentTimeZone.identifier); } return false; @@ -34,15 +34,15 @@ class AdvertiseDirector { } static Future> getRandomCustomAd(WidgetRef ref) async { - final String currentTimeZone = await FlutterTimezone.getLocalTimezone(); + final currentTimeZone = await FlutterTimezone.getLocalTimezone(); final adversies = await ref.read(secureStorageProvider).readMap(apiAvertiseKey); if (adversies['api_advertise'] != null) { final advertiseMap = adversies['api_advertise'] as Map; - if (advertiseMap.containsKey(currentTimeZone)) { - final adsData = advertiseMap[currentTimeZone] as List; + if (advertiseMap.containsKey(currentTimeZone.identifier)) { + final adsData = advertiseMap[currentTimeZone.identifier] as List; if (adsData.isNotEmpty) { final random = Random(); final randomIndex = random.nextInt(adsData.length); diff --git a/lib/app/router/app_router.dart b/lib/app/router/app_router.dart index 077fbd7..d6e6d11 100644 --- a/lib/app/router/app_router.dart +++ b/lib/app/router/app_router.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:go_router/go_router.dart'; import '../../modules/main/presentation/screens/main_screen.dart'; diff --git a/lib/common/dtos/app_api_response.dart b/lib/common/dtos/app_api_response.dart index 89151ae..14e9c06 100644 --- a/lib/common/dtos/app_api_response.dart +++ b/lib/common/dtos/app_api_response.dart @@ -4,7 +4,7 @@ part 'app_api_response.freezed.dart'; part 'app_api_response.g.dart'; @freezed -class AppApiResponse with _$AppApiResponse { +abstract class AppApiResponse with _$AppApiResponse { const factory AppApiResponse({ @JsonKey(name: "version") required Version version, @JsonKey(name: "forceUpdate") required Map forceUpdate, @@ -18,7 +18,7 @@ class AppApiResponse with _$AppApiResponse { } @freezed -class AppApiResponseFlowLine with _$AppApiResponseFlowLine { +abstract class AppApiResponseFlowLine with _$AppApiResponseFlowLine { const factory AppApiResponseFlowLine({ @JsonKey(name: "startLine") required int startLine, @JsonKey(name: "flowLine") required List flowLine, @@ -29,7 +29,7 @@ class AppApiResponseFlowLine with _$AppApiResponseFlowLine { } @freezed -class FlowLineElement with _$FlowLineElement { +abstract class FlowLineElement with _$FlowLineElement { const factory FlowLineElement({ @JsonKey(name: "enabled") required bool enabled, @JsonKey(name: "type") required String type, @@ -50,7 +50,7 @@ class FlowLineElement with _$FlowLineElement { } @freezed -class Version with _$Version { +abstract class Version with _$Version { const factory Version({ @JsonKey(name: "github") required String github, @JsonKey(name: "testFlight") required String testFlight, diff --git a/lib/common/dtos/app_api_response.freezed.dart b/lib/common/dtos/app_api_response.freezed.dart index 120888a..8258602 100644 --- a/lib/common/dtos/app_api_response.freezed.dart +++ b/lib/common/dtos/app_api_response.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1191 +9,1178 @@ part of 'app_api_response.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -AppApiResponse _$AppApiResponseFromJson(Map json) { - return _AppApiResponse.fromJson(json); -} - /// @nodoc mixin _$AppApiResponse { - @JsonKey(name: "version") - Version get version => throw _privateConstructorUsedError; - @JsonKey(name: "forceUpdate") - Map get forceUpdate => throw _privateConstructorUsedError; - @JsonKey(name: "changeLog") - Map> get changeLog => throw _privateConstructorUsedError; - @JsonKey(name: "flowLine") - AppApiResponseFlowLine get flowLine => throw _privateConstructorUsedError; - @JsonKey(name: "testUrls") - List get testUrls => throw _privateConstructorUsedError; + +@JsonKey(name: "version") Version get version;@JsonKey(name: "forceUpdate") Map get forceUpdate;@JsonKey(name: "changeLog") Map> get changeLog;@JsonKey(name: "flowLine") AppApiResponseFlowLine get flowLine;@JsonKey(name: "testUrls") List get testUrls; +/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AppApiResponseCopyWith get copyWith => _$AppApiResponseCopyWithImpl(this as AppApiResponse, _$identity); /// Serializes this AppApiResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AppApiResponseCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AppApiResponse&&(identical(other.version, version) || other.version == version)&&const DeepCollectionEquality().equals(other.forceUpdate, forceUpdate)&&const DeepCollectionEquality().equals(other.changeLog, changeLog)&&(identical(other.flowLine, flowLine) || other.flowLine == flowLine)&&const DeepCollectionEquality().equals(other.testUrls, testUrls)); } -/// @nodoc -abstract class $AppApiResponseCopyWith<$Res> { - factory $AppApiResponseCopyWith( - AppApiResponse value, $Res Function(AppApiResponse) then) = - _$AppApiResponseCopyWithImpl<$Res, AppApiResponse>; - @useResult - $Res call( - {@JsonKey(name: "version") Version version, - @JsonKey(name: "forceUpdate") Map forceUpdate, - @JsonKey(name: "changeLog") Map> changeLog, - @JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine, - @JsonKey(name: "testUrls") List testUrls}); - - $VersionCopyWith<$Res> get version; - $AppApiResponseFlowLineCopyWith<$Res> get flowLine; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,version,const DeepCollectionEquality().hash(forceUpdate),const DeepCollectionEquality().hash(changeLog),flowLine,const DeepCollectionEquality().hash(testUrls)); + +@override +String toString() { + return 'AppApiResponse(version: $version, forceUpdate: $forceUpdate, changeLog: $changeLog, flowLine: $flowLine, testUrls: $testUrls)'; } -/// @nodoc -class _$AppApiResponseCopyWithImpl<$Res, $Val extends AppApiResponse> - implements $AppApiResponseCopyWith<$Res> { - _$AppApiResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? version = null, - Object? forceUpdate = null, - Object? changeLog = null, - Object? flowLine = null, - Object? testUrls = null, - }) { - return _then(_value.copyWith( - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as Version, - forceUpdate: null == forceUpdate - ? _value.forceUpdate - : forceUpdate // ignore: cast_nullable_to_non_nullable - as Map, - changeLog: null == changeLog - ? _value.changeLog - : changeLog // ignore: cast_nullable_to_non_nullable - as Map>, - flowLine: null == flowLine - ? _value.flowLine - : flowLine // ignore: cast_nullable_to_non_nullable - as AppApiResponseFlowLine, - testUrls: null == testUrls - ? _value.testUrls - : testUrls // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); - } - - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VersionCopyWith<$Res> get version { - return $VersionCopyWith<$Res>(_value.version, (value) { - return _then(_value.copyWith(version: value) as $Val); - }); - } - - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AppApiResponseFlowLineCopyWith<$Res> get flowLine { - return $AppApiResponseFlowLineCopyWith<$Res>(_value.flowLine, (value) { - return _then(_value.copyWith(flowLine: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$AppApiResponseImplCopyWith<$Res> +abstract mixin class $AppApiResponseCopyWith<$Res> { + factory $AppApiResponseCopyWith(AppApiResponse value, $Res Function(AppApiResponse) _then) = _$AppApiResponseCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "version") Version version,@JsonKey(name: "forceUpdate") Map forceUpdate,@JsonKey(name: "changeLog") Map> changeLog,@JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine,@JsonKey(name: "testUrls") List testUrls +}); + + +$VersionCopyWith<$Res> get version;$AppApiResponseFlowLineCopyWith<$Res> get flowLine; + +} +/// @nodoc +class _$AppApiResponseCopyWithImpl<$Res> implements $AppApiResponseCopyWith<$Res> { - factory _$$AppApiResponseImplCopyWith(_$AppApiResponseImpl value, - $Res Function(_$AppApiResponseImpl) then) = - __$$AppApiResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "version") Version version, - @JsonKey(name: "forceUpdate") Map forceUpdate, - @JsonKey(name: "changeLog") Map> changeLog, - @JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine, - @JsonKey(name: "testUrls") List testUrls}); - - @override - $VersionCopyWith<$Res> get version; - @override - $AppApiResponseFlowLineCopyWith<$Res> get flowLine; + _$AppApiResponseCopyWithImpl(this._self, this._then); + + final AppApiResponse _self; + final $Res Function(AppApiResponse) _then; + +/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? version = null,Object? forceUpdate = null,Object? changeLog = null,Object? flowLine = null,Object? testUrls = null,}) { + return _then(_self.copyWith( +version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as Version,forceUpdate: null == forceUpdate ? _self.forceUpdate : forceUpdate // ignore: cast_nullable_to_non_nullable +as Map,changeLog: null == changeLog ? _self.changeLog : changeLog // ignore: cast_nullable_to_non_nullable +as Map>,flowLine: null == flowLine ? _self.flowLine : flowLine // ignore: cast_nullable_to_non_nullable +as AppApiResponseFlowLine,testUrls: null == testUrls ? _self.testUrls : testUrls // ignore: cast_nullable_to_non_nullable +as List, + )); +} +/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$VersionCopyWith<$Res> get version { + + return $VersionCopyWith<$Res>(_self.version, (value) { + return _then(_self.copyWith(version: value)); + }); +}/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AppApiResponseFlowLineCopyWith<$Res> get flowLine { + + return $AppApiResponseFlowLineCopyWith<$Res>(_self.flowLine, (value) { + return _then(_self.copyWith(flowLine: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [AppApiResponse]. +extension AppApiResponsePatterns on AppApiResponse { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AppApiResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AppApiResponse() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AppApiResponse value) $default,){ +final _that = this; +switch (_that) { +case _AppApiResponse(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AppApiResponse value)? $default,){ +final _that = this; +switch (_that) { +case _AppApiResponse() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "version") Version version, @JsonKey(name: "forceUpdate") Map forceUpdate, @JsonKey(name: "changeLog") Map> changeLog, @JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine, @JsonKey(name: "testUrls") List testUrls)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AppApiResponse() when $default != null: +return $default(_that.version,_that.forceUpdate,_that.changeLog,_that.flowLine,_that.testUrls);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "version") Version version, @JsonKey(name: "forceUpdate") Map forceUpdate, @JsonKey(name: "changeLog") Map> changeLog, @JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine, @JsonKey(name: "testUrls") List testUrls) $default,) {final _that = this; +switch (_that) { +case _AppApiResponse(): +return $default(_that.version,_that.forceUpdate,_that.changeLog,_that.flowLine,_that.testUrls);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "version") Version version, @JsonKey(name: "forceUpdate") Map forceUpdate, @JsonKey(name: "changeLog") Map> changeLog, @JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine, @JsonKey(name: "testUrls") List testUrls)? $default,) {final _that = this; +switch (_that) { +case _AppApiResponse() when $default != null: +return $default(_that.version,_that.forceUpdate,_that.changeLog,_that.flowLine,_that.testUrls);case _: + return null; + +} } -/// @nodoc -class __$$AppApiResponseImplCopyWithImpl<$Res> - extends _$AppApiResponseCopyWithImpl<$Res, _$AppApiResponseImpl> - implements _$$AppApiResponseImplCopyWith<$Res> { - __$$AppApiResponseImplCopyWithImpl( - _$AppApiResponseImpl _value, $Res Function(_$AppApiResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? version = null, - Object? forceUpdate = null, - Object? changeLog = null, - Object? flowLine = null, - Object? testUrls = null, - }) { - return _then(_$AppApiResponseImpl( - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as Version, - forceUpdate: null == forceUpdate - ? _value._forceUpdate - : forceUpdate // ignore: cast_nullable_to_non_nullable - as Map, - changeLog: null == changeLog - ? _value._changeLog - : changeLog // ignore: cast_nullable_to_non_nullable - as Map>, - flowLine: null == flowLine - ? _value.flowLine - : flowLine // ignore: cast_nullable_to_non_nullable - as AppApiResponseFlowLine, - testUrls: null == testUrls - ? _value._testUrls - : testUrls // ignore: cast_nullable_to_non_nullable - as List, - )); - } } /// @nodoc @JsonSerializable() -class _$AppApiResponseImpl implements _AppApiResponse { - const _$AppApiResponseImpl( - {@JsonKey(name: "version") required this.version, - @JsonKey(name: "forceUpdate") - required final Map forceUpdate, - @JsonKey(name: "changeLog") - required final Map> changeLog, - @JsonKey(name: "flowLine") required this.flowLine, - @JsonKey(name: "testUrls") required final List testUrls}) - : _forceUpdate = forceUpdate, - _changeLog = changeLog, - _testUrls = testUrls; - - factory _$AppApiResponseImpl.fromJson(Map json) => - _$$AppApiResponseImplFromJson(json); - - @override - @JsonKey(name: "version") - final Version version; - final Map _forceUpdate; - @override - @JsonKey(name: "forceUpdate") - Map get forceUpdate { - if (_forceUpdate is EqualUnmodifiableMapView) return _forceUpdate; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_forceUpdate); - } - - final Map> _changeLog; - @override - @JsonKey(name: "changeLog") - Map> get changeLog { - if (_changeLog is EqualUnmodifiableMapView) return _changeLog; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_changeLog); - } - - @override - @JsonKey(name: "flowLine") - final AppApiResponseFlowLine flowLine; - final List _testUrls; - @override - @JsonKey(name: "testUrls") - List get testUrls { - if (_testUrls is EqualUnmodifiableListView) return _testUrls; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_testUrls); - } - - @override - String toString() { - return 'AppApiResponse(version: $version, forceUpdate: $forceUpdate, changeLog: $changeLog, flowLine: $flowLine, testUrls: $testUrls)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AppApiResponseImpl && - (identical(other.version, version) || other.version == version) && - const DeepCollectionEquality() - .equals(other._forceUpdate, _forceUpdate) && - const DeepCollectionEquality() - .equals(other._changeLog, _changeLog) && - (identical(other.flowLine, flowLine) || - other.flowLine == flowLine) && - const DeepCollectionEquality().equals(other._testUrls, _testUrls)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - version, - const DeepCollectionEquality().hash(_forceUpdate), - const DeepCollectionEquality().hash(_changeLog), - flowLine, - const DeepCollectionEquality().hash(_testUrls)); - - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AppApiResponseImplCopyWith<_$AppApiResponseImpl> get copyWith => - __$$AppApiResponseImplCopyWithImpl<_$AppApiResponseImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$AppApiResponseImplToJson( - this, - ); - } -} - -abstract class _AppApiResponse implements AppApiResponse { - const factory _AppApiResponse( - {@JsonKey(name: "version") required final Version version, - @JsonKey(name: "forceUpdate") - required final Map forceUpdate, - @JsonKey(name: "changeLog") - required final Map> changeLog, - @JsonKey(name: "flowLine") required final AppApiResponseFlowLine flowLine, - @JsonKey(name: "testUrls") - required final List testUrls}) = _$AppApiResponseImpl; - - factory _AppApiResponse.fromJson(Map json) = - _$AppApiResponseImpl.fromJson; - - @override - @JsonKey(name: "version") - Version get version; - @override - @JsonKey(name: "forceUpdate") - Map get forceUpdate; - @override - @JsonKey(name: "changeLog") - Map> get changeLog; - @override - @JsonKey(name: "flowLine") - AppApiResponseFlowLine get flowLine; - @override - @JsonKey(name: "testUrls") - List get testUrls; - - /// Create a copy of AppApiResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AppApiResponseImplCopyWith<_$AppApiResponseImpl> get copyWith => - throw _privateConstructorUsedError; -} - -AppApiResponseFlowLine _$AppApiResponseFlowLineFromJson( - Map json) { - return _AppApiResponseFlowLine.fromJson(json); + +class _AppApiResponse implements AppApiResponse { + const _AppApiResponse({@JsonKey(name: "version") required this.version, @JsonKey(name: "forceUpdate") required final Map forceUpdate, @JsonKey(name: "changeLog") required final Map> changeLog, @JsonKey(name: "flowLine") required this.flowLine, @JsonKey(name: "testUrls") required final List testUrls}): _forceUpdate = forceUpdate,_changeLog = changeLog,_testUrls = testUrls; + factory _AppApiResponse.fromJson(Map json) => _$AppApiResponseFromJson(json); + +@override@JsonKey(name: "version") final Version version; + final Map _forceUpdate; +@override@JsonKey(name: "forceUpdate") Map get forceUpdate { + if (_forceUpdate is EqualUnmodifiableMapView) return _forceUpdate; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_forceUpdate); +} + + final Map> _changeLog; +@override@JsonKey(name: "changeLog") Map> get changeLog { + if (_changeLog is EqualUnmodifiableMapView) return _changeLog; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_changeLog); +} + +@override@JsonKey(name: "flowLine") final AppApiResponseFlowLine flowLine; + final List _testUrls; +@override@JsonKey(name: "testUrls") List get testUrls { + if (_testUrls is EqualUnmodifiableListView) return _testUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_testUrls); +} + + +/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AppApiResponseCopyWith<_AppApiResponse> get copyWith => __$AppApiResponseCopyWithImpl<_AppApiResponse>(this, _$identity); + +@override +Map toJson() { + return _$AppApiResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppApiResponse&&(identical(other.version, version) || other.version == version)&&const DeepCollectionEquality().equals(other._forceUpdate, _forceUpdate)&&const DeepCollectionEquality().equals(other._changeLog, _changeLog)&&(identical(other.flowLine, flowLine) || other.flowLine == flowLine)&&const DeepCollectionEquality().equals(other._testUrls, _testUrls)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,version,const DeepCollectionEquality().hash(_forceUpdate),const DeepCollectionEquality().hash(_changeLog),flowLine,const DeepCollectionEquality().hash(_testUrls)); + +@override +String toString() { + return 'AppApiResponse(version: $version, forceUpdate: $forceUpdate, changeLog: $changeLog, flowLine: $flowLine, testUrls: $testUrls)'; +} + + +} + +/// @nodoc +abstract mixin class _$AppApiResponseCopyWith<$Res> implements $AppApiResponseCopyWith<$Res> { + factory _$AppApiResponseCopyWith(_AppApiResponse value, $Res Function(_AppApiResponse) _then) = __$AppApiResponseCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "version") Version version,@JsonKey(name: "forceUpdate") Map forceUpdate,@JsonKey(name: "changeLog") Map> changeLog,@JsonKey(name: "flowLine") AppApiResponseFlowLine flowLine,@JsonKey(name: "testUrls") List testUrls +}); + + +@override $VersionCopyWith<$Res> get version;@override $AppApiResponseFlowLineCopyWith<$Res> get flowLine; + +} +/// @nodoc +class __$AppApiResponseCopyWithImpl<$Res> + implements _$AppApiResponseCopyWith<$Res> { + __$AppApiResponseCopyWithImpl(this._self, this._then); + + final _AppApiResponse _self; + final $Res Function(_AppApiResponse) _then; + +/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? version = null,Object? forceUpdate = null,Object? changeLog = null,Object? flowLine = null,Object? testUrls = null,}) { + return _then(_AppApiResponse( +version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as Version,forceUpdate: null == forceUpdate ? _self._forceUpdate : forceUpdate // ignore: cast_nullable_to_non_nullable +as Map,changeLog: null == changeLog ? _self._changeLog : changeLog // ignore: cast_nullable_to_non_nullable +as Map>,flowLine: null == flowLine ? _self.flowLine : flowLine // ignore: cast_nullable_to_non_nullable +as AppApiResponseFlowLine,testUrls: null == testUrls ? _self._testUrls : testUrls // ignore: cast_nullable_to_non_nullable +as List, + )); } +/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$VersionCopyWith<$Res> get version { + + return $VersionCopyWith<$Res>(_self.version, (value) { + return _then(_self.copyWith(version: value)); + }); +}/// Create a copy of AppApiResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AppApiResponseFlowLineCopyWith<$Res> get flowLine { + + return $AppApiResponseFlowLineCopyWith<$Res>(_self.flowLine, (value) { + return _then(_self.copyWith(flowLine: value)); + }); +} +} + + /// @nodoc mixin _$AppApiResponseFlowLine { - @JsonKey(name: "startLine") - int get startLine => throw _privateConstructorUsedError; - @JsonKey(name: "flowLine") - List get flowLine => throw _privateConstructorUsedError; + +@JsonKey(name: "startLine") int get startLine;@JsonKey(name: "flowLine") List get flowLine; +/// Create a copy of AppApiResponseFlowLine +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AppApiResponseFlowLineCopyWith get copyWith => _$AppApiResponseFlowLineCopyWithImpl(this as AppApiResponseFlowLine, _$identity); /// Serializes this AppApiResponseFlowLine to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of AppApiResponseFlowLine - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AppApiResponseFlowLineCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AppApiResponseFlowLine&&(identical(other.startLine, startLine) || other.startLine == startLine)&&const DeepCollectionEquality().equals(other.flowLine, flowLine)); } -/// @nodoc -abstract class $AppApiResponseFlowLineCopyWith<$Res> { - factory $AppApiResponseFlowLineCopyWith(AppApiResponseFlowLine value, - $Res Function(AppApiResponseFlowLine) then) = - _$AppApiResponseFlowLineCopyWithImpl<$Res, AppApiResponseFlowLine>; - @useResult - $Res call( - {@JsonKey(name: "startLine") int startLine, - @JsonKey(name: "flowLine") List flowLine}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,startLine,const DeepCollectionEquality().hash(flowLine)); + +@override +String toString() { + return 'AppApiResponseFlowLine(startLine: $startLine, flowLine: $flowLine)'; } -/// @nodoc -class _$AppApiResponseFlowLineCopyWithImpl<$Res, - $Val extends AppApiResponseFlowLine> - implements $AppApiResponseFlowLineCopyWith<$Res> { - _$AppApiResponseFlowLineCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AppApiResponseFlowLine - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? startLine = null, - Object? flowLine = null, - }) { - return _then(_value.copyWith( - startLine: null == startLine - ? _value.startLine - : startLine // ignore: cast_nullable_to_non_nullable - as int, - flowLine: null == flowLine - ? _value.flowLine - : flowLine // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); - } + } /// @nodoc -abstract class _$$AppApiResponseFlowLineImplCopyWith<$Res> +abstract mixin class $AppApiResponseFlowLineCopyWith<$Res> { + factory $AppApiResponseFlowLineCopyWith(AppApiResponseFlowLine value, $Res Function(AppApiResponseFlowLine) _then) = _$AppApiResponseFlowLineCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "startLine") int startLine,@JsonKey(name: "flowLine") List flowLine +}); + + + + +} +/// @nodoc +class _$AppApiResponseFlowLineCopyWithImpl<$Res> implements $AppApiResponseFlowLineCopyWith<$Res> { - factory _$$AppApiResponseFlowLineImplCopyWith( - _$AppApiResponseFlowLineImpl value, - $Res Function(_$AppApiResponseFlowLineImpl) then) = - __$$AppApiResponseFlowLineImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "startLine") int startLine, - @JsonKey(name: "flowLine") List flowLine}); + _$AppApiResponseFlowLineCopyWithImpl(this._self, this._then); + + final AppApiResponseFlowLine _self; + final $Res Function(AppApiResponseFlowLine) _then; + +/// Create a copy of AppApiResponseFlowLine +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? startLine = null,Object? flowLine = null,}) { + return _then(_self.copyWith( +startLine: null == startLine ? _self.startLine : startLine // ignore: cast_nullable_to_non_nullable +as int,flowLine: null == flowLine ? _self.flowLine : flowLine // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AppApiResponseFlowLine]. +extension AppApiResponseFlowLinePatterns on AppApiResponseFlowLine { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AppApiResponseFlowLine value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AppApiResponseFlowLine() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AppApiResponseFlowLine value) $default,){ +final _that = this; +switch (_that) { +case _AppApiResponseFlowLine(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AppApiResponseFlowLine value)? $default,){ +final _that = this; +switch (_that) { +case _AppApiResponseFlowLine() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "startLine") int startLine, @JsonKey(name: "flowLine") List flowLine)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AppApiResponseFlowLine() when $default != null: +return $default(_that.startLine,_that.flowLine);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "startLine") int startLine, @JsonKey(name: "flowLine") List flowLine) $default,) {final _that = this; +switch (_that) { +case _AppApiResponseFlowLine(): +return $default(_that.startLine,_that.flowLine);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "startLine") int startLine, @JsonKey(name: "flowLine") List flowLine)? $default,) {final _that = this; +switch (_that) { +case _AppApiResponseFlowLine() when $default != null: +return $default(_that.startLine,_that.flowLine);case _: + return null; + +} } -/// @nodoc -class __$$AppApiResponseFlowLineImplCopyWithImpl<$Res> - extends _$AppApiResponseFlowLineCopyWithImpl<$Res, - _$AppApiResponseFlowLineImpl> - implements _$$AppApiResponseFlowLineImplCopyWith<$Res> { - __$$AppApiResponseFlowLineImplCopyWithImpl( - _$AppApiResponseFlowLineImpl _value, - $Res Function(_$AppApiResponseFlowLineImpl) _then) - : super(_value, _then); - - /// Create a copy of AppApiResponseFlowLine - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? startLine = null, - Object? flowLine = null, - }) { - return _then(_$AppApiResponseFlowLineImpl( - startLine: null == startLine - ? _value.startLine - : startLine // ignore: cast_nullable_to_non_nullable - as int, - flowLine: null == flowLine - ? _value._flowLine - : flowLine // ignore: cast_nullable_to_non_nullable - as List, - )); - } } /// @nodoc @JsonSerializable() -class _$AppApiResponseFlowLineImpl implements _AppApiResponseFlowLine { - const _$AppApiResponseFlowLineImpl( - {@JsonKey(name: "startLine") required this.startLine, - @JsonKey(name: "flowLine") required final List flowLine}) - : _flowLine = flowLine; - - factory _$AppApiResponseFlowLineImpl.fromJson(Map json) => - _$$AppApiResponseFlowLineImplFromJson(json); - - @override - @JsonKey(name: "startLine") - final int startLine; - final List _flowLine; - @override - @JsonKey(name: "flowLine") - List get flowLine { - if (_flowLine is EqualUnmodifiableListView) return _flowLine; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_flowLine); - } - - @override - String toString() { - return 'AppApiResponseFlowLine(startLine: $startLine, flowLine: $flowLine)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AppApiResponseFlowLineImpl && - (identical(other.startLine, startLine) || - other.startLine == startLine) && - const DeepCollectionEquality().equals(other._flowLine, _flowLine)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, startLine, const DeepCollectionEquality().hash(_flowLine)); - - /// Create a copy of AppApiResponseFlowLine - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AppApiResponseFlowLineImplCopyWith<_$AppApiResponseFlowLineImpl> - get copyWith => __$$AppApiResponseFlowLineImplCopyWithImpl< - _$AppApiResponseFlowLineImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AppApiResponseFlowLineImplToJson( - this, - ); - } -} - -abstract class _AppApiResponseFlowLine implements AppApiResponseFlowLine { - const factory _AppApiResponseFlowLine( - {@JsonKey(name: "startLine") required final int startLine, - @JsonKey(name: "flowLine") - required final List flowLine}) = - _$AppApiResponseFlowLineImpl; - - factory _AppApiResponseFlowLine.fromJson(Map json) = - _$AppApiResponseFlowLineImpl.fromJson; - - @override - @JsonKey(name: "startLine") - int get startLine; - @override - @JsonKey(name: "flowLine") - List get flowLine; - - /// Create a copy of AppApiResponseFlowLine - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AppApiResponseFlowLineImplCopyWith<_$AppApiResponseFlowLineImpl> - get copyWith => throw _privateConstructorUsedError; -} - -FlowLineElement _$FlowLineElementFromJson(Map json) { - return _FlowLineElement.fromJson(json); + +class _AppApiResponseFlowLine implements AppApiResponseFlowLine { + const _AppApiResponseFlowLine({@JsonKey(name: "startLine") required this.startLine, @JsonKey(name: "flowLine") required final List flowLine}): _flowLine = flowLine; + factory _AppApiResponseFlowLine.fromJson(Map json) => _$AppApiResponseFlowLineFromJson(json); + +@override@JsonKey(name: "startLine") final int startLine; + final List _flowLine; +@override@JsonKey(name: "flowLine") List get flowLine { + if (_flowLine is EqualUnmodifiableListView) return _flowLine; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_flowLine); +} + + +/// Create a copy of AppApiResponseFlowLine +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AppApiResponseFlowLineCopyWith<_AppApiResponseFlowLine> get copyWith => __$AppApiResponseFlowLineCopyWithImpl<_AppApiResponseFlowLine>(this, _$identity); + +@override +Map toJson() { + return _$AppApiResponseFlowLineToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppApiResponseFlowLine&&(identical(other.startLine, startLine) || other.startLine == startLine)&&const DeepCollectionEquality().equals(other._flowLine, _flowLine)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,startLine,const DeepCollectionEquality().hash(_flowLine)); + +@override +String toString() { + return 'AppApiResponseFlowLine(startLine: $startLine, flowLine: $flowLine)'; +} + + +} + +/// @nodoc +abstract mixin class _$AppApiResponseFlowLineCopyWith<$Res> implements $AppApiResponseFlowLineCopyWith<$Res> { + factory _$AppApiResponseFlowLineCopyWith(_AppApiResponseFlowLine value, $Res Function(_AppApiResponseFlowLine) _then) = __$AppApiResponseFlowLineCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "startLine") int startLine,@JsonKey(name: "flowLine") List flowLine +}); + + + + +} +/// @nodoc +class __$AppApiResponseFlowLineCopyWithImpl<$Res> + implements _$AppApiResponseFlowLineCopyWith<$Res> { + __$AppApiResponseFlowLineCopyWithImpl(this._self, this._then); + + final _AppApiResponseFlowLine _self; + final $Res Function(_AppApiResponseFlowLine) _then; + +/// Create a copy of AppApiResponseFlowLine +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? startLine = null,Object? flowLine = null,}) { + return _then(_AppApiResponseFlowLine( +startLine: null == startLine ? _self.startLine : startLine // ignore: cast_nullable_to_non_nullable +as int,flowLine: null == flowLine ? _self._flowLine : flowLine // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + } + /// @nodoc mixin _$FlowLineElement { - @JsonKey(name: "enabled") - bool get enabled => throw _privateConstructorUsedError; - @JsonKey(name: "type") - String get type => throw _privateConstructorUsedError; - @JsonKey(name: "provider") - String get provider => throw _privateConstructorUsedError; - @JsonKey(name: "endpoint") - String? get endpoint => throw _privateConstructorUsedError; - @JsonKey(name: "dns") - String? get dns => throw _privateConstructorUsedError; - @JsonKey(name: "scanner") - bool? get scanner => throw _privateConstructorUsedError; - @JsonKey(name: "scanner_type") - String? get scannerType => throw _privateConstructorUsedError; - @JsonKey(name: "scanner_timeout") - int? get scannerTimeout => throw _privateConstructorUsedError; - @JsonKey(name: "psiphon") - bool? get psiphon => throw _privateConstructorUsedError; - @JsonKey(name: "psiphon_country") - String? get psiphonCountry => throw _privateConstructorUsedError; - @JsonKey(name: "gool") - bool? get gool => throw _privateConstructorUsedError; - @JsonKey(name: "url") - String? get url => throw _privateConstructorUsedError; + +@JsonKey(name: "enabled") bool get enabled;@JsonKey(name: "type") String get type;@JsonKey(name: "provider") String get provider;@JsonKey(name: "endpoint") String? get endpoint;@JsonKey(name: "dns") String? get dns;@JsonKey(name: "scanner") bool? get scanner;@JsonKey(name: "scanner_type") String? get scannerType;@JsonKey(name: "scanner_timeout") int? get scannerTimeout;@JsonKey(name: "psiphon") bool? get psiphon;@JsonKey(name: "psiphon_country") String? get psiphonCountry;@JsonKey(name: "gool") bool? get gool;@JsonKey(name: "url") String? get url; +/// Create a copy of FlowLineElement +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FlowLineElementCopyWith get copyWith => _$FlowLineElementCopyWithImpl(this as FlowLineElement, _$identity); /// Serializes this FlowLineElement to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of FlowLineElement - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FlowLineElementCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FlowLineElement&&(identical(other.enabled, enabled) || other.enabled == enabled)&&(identical(other.type, type) || other.type == type)&&(identical(other.provider, provider) || other.provider == provider)&&(identical(other.endpoint, endpoint) || other.endpoint == endpoint)&&(identical(other.dns, dns) || other.dns == dns)&&(identical(other.scanner, scanner) || other.scanner == scanner)&&(identical(other.scannerType, scannerType) || other.scannerType == scannerType)&&(identical(other.scannerTimeout, scannerTimeout) || other.scannerTimeout == scannerTimeout)&&(identical(other.psiphon, psiphon) || other.psiphon == psiphon)&&(identical(other.psiphonCountry, psiphonCountry) || other.psiphonCountry == psiphonCountry)&&(identical(other.gool, gool) || other.gool == gool)&&(identical(other.url, url) || other.url == url)); } -/// @nodoc -abstract class $FlowLineElementCopyWith<$Res> { - factory $FlowLineElementCopyWith( - FlowLineElement value, $Res Function(FlowLineElement) then) = - _$FlowLineElementCopyWithImpl<$Res, FlowLineElement>; - @useResult - $Res call( - {@JsonKey(name: "enabled") bool enabled, - @JsonKey(name: "type") String type, - @JsonKey(name: "provider") String provider, - @JsonKey(name: "endpoint") String? endpoint, - @JsonKey(name: "dns") String? dns, - @JsonKey(name: "scanner") bool? scanner, - @JsonKey(name: "scanner_type") String? scannerType, - @JsonKey(name: "scanner_timeout") int? scannerTimeout, - @JsonKey(name: "psiphon") bool? psiphon, - @JsonKey(name: "psiphon_country") String? psiphonCountry, - @JsonKey(name: "gool") bool? gool, - @JsonKey(name: "url") String? url}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,enabled,type,provider,endpoint,dns,scanner,scannerType,scannerTimeout,psiphon,psiphonCountry,gool,url); + +@override +String toString() { + return 'FlowLineElement(enabled: $enabled, type: $type, provider: $provider, endpoint: $endpoint, dns: $dns, scanner: $scanner, scannerType: $scannerType, scannerTimeout: $scannerTimeout, psiphon: $psiphon, psiphonCountry: $psiphonCountry, gool: $gool, url: $url)'; } -/// @nodoc -class _$FlowLineElementCopyWithImpl<$Res, $Val extends FlowLineElement> - implements $FlowLineElementCopyWith<$Res> { - _$FlowLineElementCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FlowLineElement - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? enabled = null, - Object? type = null, - Object? provider = null, - Object? endpoint = freezed, - Object? dns = freezed, - Object? scanner = freezed, - Object? scannerType = freezed, - Object? scannerTimeout = freezed, - Object? psiphon = freezed, - Object? psiphonCountry = freezed, - Object? gool = freezed, - Object? url = freezed, - }) { - return _then(_value.copyWith( - enabled: null == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - provider: null == provider - ? _value.provider - : provider // ignore: cast_nullable_to_non_nullable - as String, - endpoint: freezed == endpoint - ? _value.endpoint - : endpoint // ignore: cast_nullable_to_non_nullable - as String?, - dns: freezed == dns - ? _value.dns - : dns // ignore: cast_nullable_to_non_nullable - as String?, - scanner: freezed == scanner - ? _value.scanner - : scanner // ignore: cast_nullable_to_non_nullable - as bool?, - scannerType: freezed == scannerType - ? _value.scannerType - : scannerType // ignore: cast_nullable_to_non_nullable - as String?, - scannerTimeout: freezed == scannerTimeout - ? _value.scannerTimeout - : scannerTimeout // ignore: cast_nullable_to_non_nullable - as int?, - psiphon: freezed == psiphon - ? _value.psiphon - : psiphon // ignore: cast_nullable_to_non_nullable - as bool?, - psiphonCountry: freezed == psiphonCountry - ? _value.psiphonCountry - : psiphonCountry // ignore: cast_nullable_to_non_nullable - as String?, - gool: freezed == gool - ? _value.gool - : gool // ignore: cast_nullable_to_non_nullable - as bool?, - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$FlowLineElementImplCopyWith<$Res> +abstract mixin class $FlowLineElementCopyWith<$Res> { + factory $FlowLineElementCopyWith(FlowLineElement value, $Res Function(FlowLineElement) _then) = _$FlowLineElementCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "enabled") bool enabled,@JsonKey(name: "type") String type,@JsonKey(name: "provider") String provider,@JsonKey(name: "endpoint") String? endpoint,@JsonKey(name: "dns") String? dns,@JsonKey(name: "scanner") bool? scanner,@JsonKey(name: "scanner_type") String? scannerType,@JsonKey(name: "scanner_timeout") int? scannerTimeout,@JsonKey(name: "psiphon") bool? psiphon,@JsonKey(name: "psiphon_country") String? psiphonCountry,@JsonKey(name: "gool") bool? gool,@JsonKey(name: "url") String? url +}); + + + + +} +/// @nodoc +class _$FlowLineElementCopyWithImpl<$Res> implements $FlowLineElementCopyWith<$Res> { - factory _$$FlowLineElementImplCopyWith(_$FlowLineElementImpl value, - $Res Function(_$FlowLineElementImpl) then) = - __$$FlowLineElementImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "enabled") bool enabled, - @JsonKey(name: "type") String type, - @JsonKey(name: "provider") String provider, - @JsonKey(name: "endpoint") String? endpoint, - @JsonKey(name: "dns") String? dns, - @JsonKey(name: "scanner") bool? scanner, - @JsonKey(name: "scanner_type") String? scannerType, - @JsonKey(name: "scanner_timeout") int? scannerTimeout, - @JsonKey(name: "psiphon") bool? psiphon, - @JsonKey(name: "psiphon_country") String? psiphonCountry, - @JsonKey(name: "gool") bool? gool, - @JsonKey(name: "url") String? url}); + _$FlowLineElementCopyWithImpl(this._self, this._then); + + final FlowLineElement _self; + final $Res Function(FlowLineElement) _then; + +/// Create a copy of FlowLineElement +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? enabled = null,Object? type = null,Object? provider = null,Object? endpoint = freezed,Object? dns = freezed,Object? scanner = freezed,Object? scannerType = freezed,Object? scannerTimeout = freezed,Object? psiphon = freezed,Object? psiphonCountry = freezed,Object? gool = freezed,Object? url = freezed,}) { + return _then(_self.copyWith( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,provider: null == provider ? _self.provider : provider // ignore: cast_nullable_to_non_nullable +as String,endpoint: freezed == endpoint ? _self.endpoint : endpoint // ignore: cast_nullable_to_non_nullable +as String?,dns: freezed == dns ? _self.dns : dns // ignore: cast_nullable_to_non_nullable +as String?,scanner: freezed == scanner ? _self.scanner : scanner // ignore: cast_nullable_to_non_nullable +as bool?,scannerType: freezed == scannerType ? _self.scannerType : scannerType // ignore: cast_nullable_to_non_nullable +as String?,scannerTimeout: freezed == scannerTimeout ? _self.scannerTimeout : scannerTimeout // ignore: cast_nullable_to_non_nullable +as int?,psiphon: freezed == psiphon ? _self.psiphon : psiphon // ignore: cast_nullable_to_non_nullable +as bool?,psiphonCountry: freezed == psiphonCountry ? _self.psiphonCountry : psiphonCountry // ignore: cast_nullable_to_non_nullable +as String?,gool: freezed == gool ? _self.gool : gool // ignore: cast_nullable_to_non_nullable +as bool?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [FlowLineElement]. +extension FlowLineElementPatterns on FlowLineElement { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FlowLineElement value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FlowLineElement() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FlowLineElement value) $default,){ +final _that = this; +switch (_that) { +case _FlowLineElement(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FlowLineElement value)? $default,){ +final _that = this; +switch (_that) { +case _FlowLineElement() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "enabled") bool enabled, @JsonKey(name: "type") String type, @JsonKey(name: "provider") String provider, @JsonKey(name: "endpoint") String? endpoint, @JsonKey(name: "dns") String? dns, @JsonKey(name: "scanner") bool? scanner, @JsonKey(name: "scanner_type") String? scannerType, @JsonKey(name: "scanner_timeout") int? scannerTimeout, @JsonKey(name: "psiphon") bool? psiphon, @JsonKey(name: "psiphon_country") String? psiphonCountry, @JsonKey(name: "gool") bool? gool, @JsonKey(name: "url") String? url)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FlowLineElement() when $default != null: +return $default(_that.enabled,_that.type,_that.provider,_that.endpoint,_that.dns,_that.scanner,_that.scannerType,_that.scannerTimeout,_that.psiphon,_that.psiphonCountry,_that.gool,_that.url);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "enabled") bool enabled, @JsonKey(name: "type") String type, @JsonKey(name: "provider") String provider, @JsonKey(name: "endpoint") String? endpoint, @JsonKey(name: "dns") String? dns, @JsonKey(name: "scanner") bool? scanner, @JsonKey(name: "scanner_type") String? scannerType, @JsonKey(name: "scanner_timeout") int? scannerTimeout, @JsonKey(name: "psiphon") bool? psiphon, @JsonKey(name: "psiphon_country") String? psiphonCountry, @JsonKey(name: "gool") bool? gool, @JsonKey(name: "url") String? url) $default,) {final _that = this; +switch (_that) { +case _FlowLineElement(): +return $default(_that.enabled,_that.type,_that.provider,_that.endpoint,_that.dns,_that.scanner,_that.scannerType,_that.scannerTimeout,_that.psiphon,_that.psiphonCountry,_that.gool,_that.url);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "enabled") bool enabled, @JsonKey(name: "type") String type, @JsonKey(name: "provider") String provider, @JsonKey(name: "endpoint") String? endpoint, @JsonKey(name: "dns") String? dns, @JsonKey(name: "scanner") bool? scanner, @JsonKey(name: "scanner_type") String? scannerType, @JsonKey(name: "scanner_timeout") int? scannerTimeout, @JsonKey(name: "psiphon") bool? psiphon, @JsonKey(name: "psiphon_country") String? psiphonCountry, @JsonKey(name: "gool") bool? gool, @JsonKey(name: "url") String? url)? $default,) {final _that = this; +switch (_that) { +case _FlowLineElement() when $default != null: +return $default(_that.enabled,_that.type,_that.provider,_that.endpoint,_that.dns,_that.scanner,_that.scannerType,_that.scannerTimeout,_that.psiphon,_that.psiphonCountry,_that.gool,_that.url);case _: + return null; + +} } -/// @nodoc -class __$$FlowLineElementImplCopyWithImpl<$Res> - extends _$FlowLineElementCopyWithImpl<$Res, _$FlowLineElementImpl> - implements _$$FlowLineElementImplCopyWith<$Res> { - __$$FlowLineElementImplCopyWithImpl( - _$FlowLineElementImpl _value, $Res Function(_$FlowLineElementImpl) _then) - : super(_value, _then); - - /// Create a copy of FlowLineElement - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? enabled = null, - Object? type = null, - Object? provider = null, - Object? endpoint = freezed, - Object? dns = freezed, - Object? scanner = freezed, - Object? scannerType = freezed, - Object? scannerTimeout = freezed, - Object? psiphon = freezed, - Object? psiphonCountry = freezed, - Object? gool = freezed, - Object? url = freezed, - }) { - return _then(_$FlowLineElementImpl( - enabled: null == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - provider: null == provider - ? _value.provider - : provider // ignore: cast_nullable_to_non_nullable - as String, - endpoint: freezed == endpoint - ? _value.endpoint - : endpoint // ignore: cast_nullable_to_non_nullable - as String?, - dns: freezed == dns - ? _value.dns - : dns // ignore: cast_nullable_to_non_nullable - as String?, - scanner: freezed == scanner - ? _value.scanner - : scanner // ignore: cast_nullable_to_non_nullable - as bool?, - scannerType: freezed == scannerType - ? _value.scannerType - : scannerType // ignore: cast_nullable_to_non_nullable - as String?, - scannerTimeout: freezed == scannerTimeout - ? _value.scannerTimeout - : scannerTimeout // ignore: cast_nullable_to_non_nullable - as int?, - psiphon: freezed == psiphon - ? _value.psiphon - : psiphon // ignore: cast_nullable_to_non_nullable - as bool?, - psiphonCountry: freezed == psiphonCountry - ? _value.psiphonCountry - : psiphonCountry // ignore: cast_nullable_to_non_nullable - as String?, - gool: freezed == gool - ? _value.gool - : gool // ignore: cast_nullable_to_non_nullable - as bool?, - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$FlowLineElementImpl implements _FlowLineElement { - const _$FlowLineElementImpl( - {@JsonKey(name: "enabled") required this.enabled, - @JsonKey(name: "type") required this.type, - @JsonKey(name: "provider") required this.provider, - @JsonKey(name: "endpoint") this.endpoint, - @JsonKey(name: "dns") this.dns, - @JsonKey(name: "scanner") this.scanner, - @JsonKey(name: "scanner_type") this.scannerType, - @JsonKey(name: "scanner_timeout") this.scannerTimeout, - @JsonKey(name: "psiphon") this.psiphon, - @JsonKey(name: "psiphon_country") this.psiphonCountry, - @JsonKey(name: "gool") this.gool, - @JsonKey(name: "url") this.url}); - - factory _$FlowLineElementImpl.fromJson(Map json) => - _$$FlowLineElementImplFromJson(json); - - @override - @JsonKey(name: "enabled") - final bool enabled; - @override - @JsonKey(name: "type") - final String type; - @override - @JsonKey(name: "provider") - final String provider; - @override - @JsonKey(name: "endpoint") - final String? endpoint; - @override - @JsonKey(name: "dns") - final String? dns; - @override - @JsonKey(name: "scanner") - final bool? scanner; - @override - @JsonKey(name: "scanner_type") - final String? scannerType; - @override - @JsonKey(name: "scanner_timeout") - final int? scannerTimeout; - @override - @JsonKey(name: "psiphon") - final bool? psiphon; - @override - @JsonKey(name: "psiphon_country") - final String? psiphonCountry; - @override - @JsonKey(name: "gool") - final bool? gool; - @override - @JsonKey(name: "url") - final String? url; - - @override - String toString() { - return 'FlowLineElement(enabled: $enabled, type: $type, provider: $provider, endpoint: $endpoint, dns: $dns, scanner: $scanner, scannerType: $scannerType, scannerTimeout: $scannerTimeout, psiphon: $psiphon, psiphonCountry: $psiphonCountry, gool: $gool, url: $url)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FlowLineElementImpl && - (identical(other.enabled, enabled) || other.enabled == enabled) && - (identical(other.type, type) || other.type == type) && - (identical(other.provider, provider) || - other.provider == provider) && - (identical(other.endpoint, endpoint) || - other.endpoint == endpoint) && - (identical(other.dns, dns) || other.dns == dns) && - (identical(other.scanner, scanner) || other.scanner == scanner) && - (identical(other.scannerType, scannerType) || - other.scannerType == scannerType) && - (identical(other.scannerTimeout, scannerTimeout) || - other.scannerTimeout == scannerTimeout) && - (identical(other.psiphon, psiphon) || other.psiphon == psiphon) && - (identical(other.psiphonCountry, psiphonCountry) || - other.psiphonCountry == psiphonCountry) && - (identical(other.gool, gool) || other.gool == gool) && - (identical(other.url, url) || other.url == url)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - enabled, - type, - provider, - endpoint, - dns, - scanner, - scannerType, - scannerTimeout, - psiphon, - psiphonCountry, - gool, - url); - - /// Create a copy of FlowLineElement - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FlowLineElementImplCopyWith<_$FlowLineElementImpl> get copyWith => - __$$FlowLineElementImplCopyWithImpl<_$FlowLineElementImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$FlowLineElementImplToJson( - this, - ); - } -} - -abstract class _FlowLineElement implements FlowLineElement { - const factory _FlowLineElement( - {@JsonKey(name: "enabled") required final bool enabled, - @JsonKey(name: "type") required final String type, - @JsonKey(name: "provider") required final String provider, - @JsonKey(name: "endpoint") final String? endpoint, - @JsonKey(name: "dns") final String? dns, - @JsonKey(name: "scanner") final bool? scanner, - @JsonKey(name: "scanner_type") final String? scannerType, - @JsonKey(name: "scanner_timeout") final int? scannerTimeout, - @JsonKey(name: "psiphon") final bool? psiphon, - @JsonKey(name: "psiphon_country") final String? psiphonCountry, - @JsonKey(name: "gool") final bool? gool, - @JsonKey(name: "url") final String? url}) = _$FlowLineElementImpl; - - factory _FlowLineElement.fromJson(Map json) = - _$FlowLineElementImpl.fromJson; - - @override - @JsonKey(name: "enabled") - bool get enabled; - @override - @JsonKey(name: "type") - String get type; - @override - @JsonKey(name: "provider") - String get provider; - @override - @JsonKey(name: "endpoint") - String? get endpoint; - @override - @JsonKey(name: "dns") - String? get dns; - @override - @JsonKey(name: "scanner") - bool? get scanner; - @override - @JsonKey(name: "scanner_type") - String? get scannerType; - @override - @JsonKey(name: "scanner_timeout") - int? get scannerTimeout; - @override - @JsonKey(name: "psiphon") - bool? get psiphon; - @override - @JsonKey(name: "psiphon_country") - String? get psiphonCountry; - @override - @JsonKey(name: "gool") - bool? get gool; - @override - @JsonKey(name: "url") - String? get url; - - /// Create a copy of FlowLineElement - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FlowLineElementImplCopyWith<_$FlowLineElementImpl> get copyWith => - throw _privateConstructorUsedError; -} - -Version _$VersionFromJson(Map json) { - return _Version.fromJson(json); + +class _FlowLineElement implements FlowLineElement { + const _FlowLineElement({@JsonKey(name: "enabled") required this.enabled, @JsonKey(name: "type") required this.type, @JsonKey(name: "provider") required this.provider, @JsonKey(name: "endpoint") this.endpoint, @JsonKey(name: "dns") this.dns, @JsonKey(name: "scanner") this.scanner, @JsonKey(name: "scanner_type") this.scannerType, @JsonKey(name: "scanner_timeout") this.scannerTimeout, @JsonKey(name: "psiphon") this.psiphon, @JsonKey(name: "psiphon_country") this.psiphonCountry, @JsonKey(name: "gool") this.gool, @JsonKey(name: "url") this.url}); + factory _FlowLineElement.fromJson(Map json) => _$FlowLineElementFromJson(json); + +@override@JsonKey(name: "enabled") final bool enabled; +@override@JsonKey(name: "type") final String type; +@override@JsonKey(name: "provider") final String provider; +@override@JsonKey(name: "endpoint") final String? endpoint; +@override@JsonKey(name: "dns") final String? dns; +@override@JsonKey(name: "scanner") final bool? scanner; +@override@JsonKey(name: "scanner_type") final String? scannerType; +@override@JsonKey(name: "scanner_timeout") final int? scannerTimeout; +@override@JsonKey(name: "psiphon") final bool? psiphon; +@override@JsonKey(name: "psiphon_country") final String? psiphonCountry; +@override@JsonKey(name: "gool") final bool? gool; +@override@JsonKey(name: "url") final String? url; + +/// Create a copy of FlowLineElement +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FlowLineElementCopyWith<_FlowLineElement> get copyWith => __$FlowLineElementCopyWithImpl<_FlowLineElement>(this, _$identity); + +@override +Map toJson() { + return _$FlowLineElementToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FlowLineElement&&(identical(other.enabled, enabled) || other.enabled == enabled)&&(identical(other.type, type) || other.type == type)&&(identical(other.provider, provider) || other.provider == provider)&&(identical(other.endpoint, endpoint) || other.endpoint == endpoint)&&(identical(other.dns, dns) || other.dns == dns)&&(identical(other.scanner, scanner) || other.scanner == scanner)&&(identical(other.scannerType, scannerType) || other.scannerType == scannerType)&&(identical(other.scannerTimeout, scannerTimeout) || other.scannerTimeout == scannerTimeout)&&(identical(other.psiphon, psiphon) || other.psiphon == psiphon)&&(identical(other.psiphonCountry, psiphonCountry) || other.psiphonCountry == psiphonCountry)&&(identical(other.gool, gool) || other.gool == gool)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,enabled,type,provider,endpoint,dns,scanner,scannerType,scannerTimeout,psiphon,psiphonCountry,gool,url); + +@override +String toString() { + return 'FlowLineElement(enabled: $enabled, type: $type, provider: $provider, endpoint: $endpoint, dns: $dns, scanner: $scanner, scannerType: $scannerType, scannerTimeout: $scannerTimeout, psiphon: $psiphon, psiphonCountry: $psiphonCountry, gool: $gool, url: $url)'; +} + + +} + +/// @nodoc +abstract mixin class _$FlowLineElementCopyWith<$Res> implements $FlowLineElementCopyWith<$Res> { + factory _$FlowLineElementCopyWith(_FlowLineElement value, $Res Function(_FlowLineElement) _then) = __$FlowLineElementCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "enabled") bool enabled,@JsonKey(name: "type") String type,@JsonKey(name: "provider") String provider,@JsonKey(name: "endpoint") String? endpoint,@JsonKey(name: "dns") String? dns,@JsonKey(name: "scanner") bool? scanner,@JsonKey(name: "scanner_type") String? scannerType,@JsonKey(name: "scanner_timeout") int? scannerTimeout,@JsonKey(name: "psiphon") bool? psiphon,@JsonKey(name: "psiphon_country") String? psiphonCountry,@JsonKey(name: "gool") bool? gool,@JsonKey(name: "url") String? url +}); + + + + +} +/// @nodoc +class __$FlowLineElementCopyWithImpl<$Res> + implements _$FlowLineElementCopyWith<$Res> { + __$FlowLineElementCopyWithImpl(this._self, this._then); + + final _FlowLineElement _self; + final $Res Function(_FlowLineElement) _then; + +/// Create a copy of FlowLineElement +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? enabled = null,Object? type = null,Object? provider = null,Object? endpoint = freezed,Object? dns = freezed,Object? scanner = freezed,Object? scannerType = freezed,Object? scannerTimeout = freezed,Object? psiphon = freezed,Object? psiphonCountry = freezed,Object? gool = freezed,Object? url = freezed,}) { + return _then(_FlowLineElement( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,provider: null == provider ? _self.provider : provider // ignore: cast_nullable_to_non_nullable +as String,endpoint: freezed == endpoint ? _self.endpoint : endpoint // ignore: cast_nullable_to_non_nullable +as String?,dns: freezed == dns ? _self.dns : dns // ignore: cast_nullable_to_non_nullable +as String?,scanner: freezed == scanner ? _self.scanner : scanner // ignore: cast_nullable_to_non_nullable +as bool?,scannerType: freezed == scannerType ? _self.scannerType : scannerType // ignore: cast_nullable_to_non_nullable +as String?,scannerTimeout: freezed == scannerTimeout ? _self.scannerTimeout : scannerTimeout // ignore: cast_nullable_to_non_nullable +as int?,psiphon: freezed == psiphon ? _self.psiphon : psiphon // ignore: cast_nullable_to_non_nullable +as bool?,psiphonCountry: freezed == psiphonCountry ? _self.psiphonCountry : psiphonCountry // ignore: cast_nullable_to_non_nullable +as String?,gool: freezed == gool ? _self.gool : gool // ignore: cast_nullable_to_non_nullable +as bool?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } + /// @nodoc mixin _$Version { - @JsonKey(name: "github") - String get github => throw _privateConstructorUsedError; - @JsonKey(name: "testFlight") - String get testFlight => throw _privateConstructorUsedError; - @JsonKey(name: "appleStore") - String get appleStore => throw _privateConstructorUsedError; - @JsonKey(name: "googlePlay") - String get googlePlay => throw _privateConstructorUsedError; - @JsonKey(name: "microsoftStore") - String get microsoftStore => throw _privateConstructorUsedError; + +@JsonKey(name: "github") String get github;@JsonKey(name: "testFlight") String get testFlight;@JsonKey(name: "appleStore") String get appleStore;@JsonKey(name: "googlePlay") String get googlePlay;@JsonKey(name: "microsoftStore") String get microsoftStore; +/// Create a copy of Version +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$VersionCopyWith get copyWith => _$VersionCopyWithImpl(this as Version, _$identity); /// Serializes this Version to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of Version - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VersionCopyWith get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Version&&(identical(other.github, github) || other.github == github)&&(identical(other.testFlight, testFlight) || other.testFlight == testFlight)&&(identical(other.appleStore, appleStore) || other.appleStore == appleStore)&&(identical(other.googlePlay, googlePlay) || other.googlePlay == googlePlay)&&(identical(other.microsoftStore, microsoftStore) || other.microsoftStore == microsoftStore)); } -/// @nodoc -abstract class $VersionCopyWith<$Res> { - factory $VersionCopyWith(Version value, $Res Function(Version) then) = - _$VersionCopyWithImpl<$Res, Version>; - @useResult - $Res call( - {@JsonKey(name: "github") String github, - @JsonKey(name: "testFlight") String testFlight, - @JsonKey(name: "appleStore") String appleStore, - @JsonKey(name: "googlePlay") String googlePlay, - @JsonKey(name: "microsoftStore") String microsoftStore}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,github,testFlight,appleStore,googlePlay,microsoftStore); + +@override +String toString() { + return 'Version(github: $github, testFlight: $testFlight, appleStore: $appleStore, googlePlay: $googlePlay, microsoftStore: $microsoftStore)'; +} + + } /// @nodoc -class _$VersionCopyWithImpl<$Res, $Val extends Version> +abstract mixin class $VersionCopyWith<$Res> { + factory $VersionCopyWith(Version value, $Res Function(Version) _then) = _$VersionCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "github") String github,@JsonKey(name: "testFlight") String testFlight,@JsonKey(name: "appleStore") String appleStore,@JsonKey(name: "googlePlay") String googlePlay,@JsonKey(name: "microsoftStore") String microsoftStore +}); + + + + +} +/// @nodoc +class _$VersionCopyWithImpl<$Res> implements $VersionCopyWith<$Res> { - _$VersionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Version - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? github = null, - Object? testFlight = null, - Object? appleStore = null, - Object? googlePlay = null, - Object? microsoftStore = null, - }) { - return _then(_value.copyWith( - github: null == github - ? _value.github - : github // ignore: cast_nullable_to_non_nullable - as String, - testFlight: null == testFlight - ? _value.testFlight - : testFlight // ignore: cast_nullable_to_non_nullable - as String, - appleStore: null == appleStore - ? _value.appleStore - : appleStore // ignore: cast_nullable_to_non_nullable - as String, - googlePlay: null == googlePlay - ? _value.googlePlay - : googlePlay // ignore: cast_nullable_to_non_nullable - as String, - microsoftStore: null == microsoftStore - ? _value.microsoftStore - : microsoftStore // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + _$VersionCopyWithImpl(this._self, this._then); + + final Version _self; + final $Res Function(Version) _then; + +/// Create a copy of Version +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? github = null,Object? testFlight = null,Object? appleStore = null,Object? googlePlay = null,Object? microsoftStore = null,}) { + return _then(_self.copyWith( +github: null == github ? _self.github : github // ignore: cast_nullable_to_non_nullable +as String,testFlight: null == testFlight ? _self.testFlight : testFlight // ignore: cast_nullable_to_non_nullable +as String,appleStore: null == appleStore ? _self.appleStore : appleStore // ignore: cast_nullable_to_non_nullable +as String,googlePlay: null == googlePlay ? _self.googlePlay : googlePlay // ignore: cast_nullable_to_non_nullable +as String,microsoftStore: null == microsoftStore ? _self.microsoftStore : microsoftStore // ignore: cast_nullable_to_non_nullable +as String, + )); } -/// @nodoc -abstract class _$$VersionImplCopyWith<$Res> implements $VersionCopyWith<$Res> { - factory _$$VersionImplCopyWith( - _$VersionImpl value, $Res Function(_$VersionImpl) then) = - __$$VersionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "github") String github, - @JsonKey(name: "testFlight") String testFlight, - @JsonKey(name: "appleStore") String appleStore, - @JsonKey(name: "googlePlay") String googlePlay, - @JsonKey(name: "microsoftStore") String microsoftStore}); } -/// @nodoc -class __$$VersionImplCopyWithImpl<$Res> - extends _$VersionCopyWithImpl<$Res, _$VersionImpl> - implements _$$VersionImplCopyWith<$Res> { - __$$VersionImplCopyWithImpl( - _$VersionImpl _value, $Res Function(_$VersionImpl) _then) - : super(_value, _then); - - /// Create a copy of Version - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? github = null, - Object? testFlight = null, - Object? appleStore = null, - Object? googlePlay = null, - Object? microsoftStore = null, - }) { - return _then(_$VersionImpl( - github: null == github - ? _value.github - : github // ignore: cast_nullable_to_non_nullable - as String, - testFlight: null == testFlight - ? _value.testFlight - : testFlight // ignore: cast_nullable_to_non_nullable - as String, - appleStore: null == appleStore - ? _value.appleStore - : appleStore // ignore: cast_nullable_to_non_nullable - as String, - googlePlay: null == googlePlay - ? _value.googlePlay - : googlePlay // ignore: cast_nullable_to_non_nullable - as String, - microsoftStore: null == microsoftStore - ? _value.microsoftStore - : microsoftStore // ignore: cast_nullable_to_non_nullable - as String, - )); - } + +/// Adds pattern-matching-related methods to [Version]. +extension VersionPatterns on Version { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Version value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Version() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Version value) $default,){ +final _that = this; +switch (_that) { +case _Version(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Version value)? $default,){ +final _that = this; +switch (_that) { +case _Version() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "github") String github, @JsonKey(name: "testFlight") String testFlight, @JsonKey(name: "appleStore") String appleStore, @JsonKey(name: "googlePlay") String googlePlay, @JsonKey(name: "microsoftStore") String microsoftStore)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Version() when $default != null: +return $default(_that.github,_that.testFlight,_that.appleStore,_that.googlePlay,_that.microsoftStore);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "github") String github, @JsonKey(name: "testFlight") String testFlight, @JsonKey(name: "appleStore") String appleStore, @JsonKey(name: "googlePlay") String googlePlay, @JsonKey(name: "microsoftStore") String microsoftStore) $default,) {final _that = this; +switch (_that) { +case _Version(): +return $default(_that.github,_that.testFlight,_that.appleStore,_that.googlePlay,_that.microsoftStore);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "github") String github, @JsonKey(name: "testFlight") String testFlight, @JsonKey(name: "appleStore") String appleStore, @JsonKey(name: "googlePlay") String googlePlay, @JsonKey(name: "microsoftStore") String microsoftStore)? $default,) {final _that = this; +switch (_that) { +case _Version() when $default != null: +return $default(_that.github,_that.testFlight,_that.appleStore,_that.googlePlay,_that.microsoftStore);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() -class _$VersionImpl implements _Version { - const _$VersionImpl( - {@JsonKey(name: "github") required this.github, - @JsonKey(name: "testFlight") required this.testFlight, - @JsonKey(name: "appleStore") required this.appleStore, - @JsonKey(name: "googlePlay") required this.googlePlay, - @JsonKey(name: "microsoftStore") required this.microsoftStore}); - - factory _$VersionImpl.fromJson(Map json) => - _$$VersionImplFromJson(json); - - @override - @JsonKey(name: "github") - final String github; - @override - @JsonKey(name: "testFlight") - final String testFlight; - @override - @JsonKey(name: "appleStore") - final String appleStore; - @override - @JsonKey(name: "googlePlay") - final String googlePlay; - @override - @JsonKey(name: "microsoftStore") - final String microsoftStore; - - @override - String toString() { - return 'Version(github: $github, testFlight: $testFlight, appleStore: $appleStore, googlePlay: $googlePlay, microsoftStore: $microsoftStore)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$VersionImpl && - (identical(other.github, github) || other.github == github) && - (identical(other.testFlight, testFlight) || - other.testFlight == testFlight) && - (identical(other.appleStore, appleStore) || - other.appleStore == appleStore) && - (identical(other.googlePlay, googlePlay) || - other.googlePlay == googlePlay) && - (identical(other.microsoftStore, microsoftStore) || - other.microsoftStore == microsoftStore)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, github, testFlight, appleStore, googlePlay, microsoftStore); - - /// Create a copy of Version - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$VersionImplCopyWith<_$VersionImpl> get copyWith => - __$$VersionImplCopyWithImpl<_$VersionImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VersionImplToJson( - this, - ); - } -} - -abstract class _Version implements Version { - const factory _Version( - {@JsonKey(name: "github") required final String github, - @JsonKey(name: "testFlight") required final String testFlight, - @JsonKey(name: "appleStore") required final String appleStore, - @JsonKey(name: "googlePlay") required final String googlePlay, - @JsonKey(name: "microsoftStore") - required final String microsoftStore}) = _$VersionImpl; - - factory _Version.fromJson(Map json) = _$VersionImpl.fromJson; - - @override - @JsonKey(name: "github") - String get github; - @override - @JsonKey(name: "testFlight") - String get testFlight; - @override - @JsonKey(name: "appleStore") - String get appleStore; - @override - @JsonKey(name: "googlePlay") - String get googlePlay; - @override - @JsonKey(name: "microsoftStore") - String get microsoftStore; - - /// Create a copy of Version - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VersionImplCopyWith<_$VersionImpl> get copyWith => - throw _privateConstructorUsedError; + +class _Version implements Version { + const _Version({@JsonKey(name: "github") required this.github, @JsonKey(name: "testFlight") required this.testFlight, @JsonKey(name: "appleStore") required this.appleStore, @JsonKey(name: "googlePlay") required this.googlePlay, @JsonKey(name: "microsoftStore") required this.microsoftStore}); + factory _Version.fromJson(Map json) => _$VersionFromJson(json); + +@override@JsonKey(name: "github") final String github; +@override@JsonKey(name: "testFlight") final String testFlight; +@override@JsonKey(name: "appleStore") final String appleStore; +@override@JsonKey(name: "googlePlay") final String googlePlay; +@override@JsonKey(name: "microsoftStore") final String microsoftStore; + +/// Create a copy of Version +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$VersionCopyWith<_Version> get copyWith => __$VersionCopyWithImpl<_Version>(this, _$identity); + +@override +Map toJson() { + return _$VersionToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Version&&(identical(other.github, github) || other.github == github)&&(identical(other.testFlight, testFlight) || other.testFlight == testFlight)&&(identical(other.appleStore, appleStore) || other.appleStore == appleStore)&&(identical(other.googlePlay, googlePlay) || other.googlePlay == googlePlay)&&(identical(other.microsoftStore, microsoftStore) || other.microsoftStore == microsoftStore)); } + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,github,testFlight,appleStore,googlePlay,microsoftStore); + +@override +String toString() { + return 'Version(github: $github, testFlight: $testFlight, appleStore: $appleStore, googlePlay: $googlePlay, microsoftStore: $microsoftStore)'; +} + + +} + +/// @nodoc +abstract mixin class _$VersionCopyWith<$Res> implements $VersionCopyWith<$Res> { + factory _$VersionCopyWith(_Version value, $Res Function(_Version) _then) = __$VersionCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "github") String github,@JsonKey(name: "testFlight") String testFlight,@JsonKey(name: "appleStore") String appleStore,@JsonKey(name: "googlePlay") String googlePlay,@JsonKey(name: "microsoftStore") String microsoftStore +}); + + + + +} +/// @nodoc +class __$VersionCopyWithImpl<$Res> + implements _$VersionCopyWith<$Res> { + __$VersionCopyWithImpl(this._self, this._then); + + final _Version _self; + final $Res Function(_Version) _then; + +/// Create a copy of Version +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? github = null,Object? testFlight = null,Object? appleStore = null,Object? googlePlay = null,Object? microsoftStore = null,}) { + return _then(_Version( +github: null == github ? _self.github : github // ignore: cast_nullable_to_non_nullable +as String,testFlight: null == testFlight ? _self.testFlight : testFlight // ignore: cast_nullable_to_non_nullable +as String,appleStore: null == appleStore ? _self.appleStore : appleStore // ignore: cast_nullable_to_non_nullable +as String,googlePlay: null == googlePlay ? _self.googlePlay : googlePlay // ignore: cast_nullable_to_non_nullable +as String,microsoftStore: null == microsoftStore ? _self.microsoftStore : microsoftStore // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +// dart format on diff --git a/lib/common/dtos/app_api_response.g.dart b/lib/common/dtos/app_api_response.g.dart index 84bf0dc..c83cd7d 100644 --- a/lib/common/dtos/app_api_response.g.dart +++ b/lib/common/dtos/app_api_response.g.dart @@ -6,8 +6,8 @@ part of 'app_api_response.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AppApiResponseImpl _$$AppApiResponseImplFromJson(Map json) => - _$AppApiResponseImpl( +_AppApiResponse _$AppApiResponseFromJson(Map json) => + _AppApiResponse( version: Version.fromJson(json['version'] as Map), forceUpdate: Map.from(json['forceUpdate'] as Map), changeLog: (json['changeLog'] as Map).map( @@ -15,13 +15,14 @@ _$AppApiResponseImpl _$$AppApiResponseImplFromJson(Map json) => MapEntry(k, (e as List).map((e) => e as String).toList()), ), flowLine: AppApiResponseFlowLine.fromJson( - json['flowLine'] as Map), - testUrls: - (json['testUrls'] as List).map((e) => e as String).toList(), + json['flowLine'] as Map, + ), + testUrls: (json['testUrls'] as List) + .map((e) => e as String) + .toList(), ); -Map _$$AppApiResponseImplToJson( - _$AppApiResponseImpl instance) => +Map _$AppApiResponseToJson(_AppApiResponse instance) => { 'version': instance.version, 'forceUpdate': instance.forceUpdate, @@ -30,25 +31,24 @@ Map _$$AppApiResponseImplToJson( 'testUrls': instance.testUrls, }; -_$AppApiResponseFlowLineImpl _$$AppApiResponseFlowLineImplFromJson( - Map json) => - _$AppApiResponseFlowLineImpl( - startLine: (json['startLine'] as num).toInt(), - flowLine: (json['flowLine'] as List) - .map((e) => FlowLineElement.fromJson(e as Map)) - .toList(), - ); +_AppApiResponseFlowLine _$AppApiResponseFlowLineFromJson( + Map json, +) => _AppApiResponseFlowLine( + startLine: (json['startLine'] as num).toInt(), + flowLine: (json['flowLine'] as List) + .map((e) => FlowLineElement.fromJson(e as Map)) + .toList(), +); -Map _$$AppApiResponseFlowLineImplToJson( - _$AppApiResponseFlowLineImpl instance) => - { - 'startLine': instance.startLine, - 'flowLine': instance.flowLine, - }; +Map _$AppApiResponseFlowLineToJson( + _AppApiResponseFlowLine instance, +) => { + 'startLine': instance.startLine, + 'flowLine': instance.flowLine, +}; -_$FlowLineElementImpl _$$FlowLineElementImplFromJson( - Map json) => - _$FlowLineElementImpl( +_FlowLineElement _$FlowLineElementFromJson(Map json) => + _FlowLineElement( enabled: json['enabled'] as bool, type: json['type'] as String, provider: json['provider'] as String, @@ -63,8 +63,7 @@ _$FlowLineElementImpl _$$FlowLineElementImplFromJson( url: json['url'] as String?, ); -Map _$$FlowLineElementImplToJson( - _$FlowLineElementImpl instance) => +Map _$FlowLineElementToJson(_FlowLineElement instance) => { 'enabled': instance.enabled, 'type': instance.type, @@ -80,20 +79,18 @@ Map _$$FlowLineElementImplToJson( 'url': instance.url, }; -_$VersionImpl _$$VersionImplFromJson(Map json) => - _$VersionImpl( - github: json['github'] as String, - testFlight: json['testFlight'] as String, - appleStore: json['appleStore'] as String, - googlePlay: json['googlePlay'] as String, - microsoftStore: json['microsoftStore'] as String, - ); +_Version _$VersionFromJson(Map json) => _Version( + github: json['github'] as String, + testFlight: json['testFlight'] as String, + appleStore: json['appleStore'] as String, + googlePlay: json['googlePlay'] as String, + microsoftStore: json['microsoftStore'] as String, +); -Map _$$VersionImplToJson(_$VersionImpl instance) => - { - 'github': instance.github, - 'testFlight': instance.testFlight, - 'appleStore': instance.appleStore, - 'googlePlay': instance.googlePlay, - 'microsoftStore': instance.microsoftStore, - }; +Map _$VersionToJson(_Version instance) => { + 'github': instance.github, + 'testFlight': instance.testFlight, + 'appleStore': instance.appleStore, + 'googlePlay': instance.googlePlay, + 'microsoftStore': instance.microsoftStore, +}; diff --git a/lib/modules/core/desktop_platform_handler.dart b/lib/modules/core/desktop_platform_handler.dart index 8a51d86..00da7e1 100644 --- a/lib/modules/core/desktop_platform_handler.dart +++ b/lib/modules/core/desktop_platform_handler.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:go_router/go_router.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:defyx_vpn/app/router/app_router.dart'; diff --git a/lib/modules/main/application/main_screen_provider.dart b/lib/modules/main/application/main_screen_provider.dart index 102b81a..43241da 100644 --- a/lib/modules/main/application/main_screen_provider.dart +++ b/lib/modules/main/application/main_screen_provider.dart @@ -5,6 +5,7 @@ import 'package:defyx_vpn/modules/core/vpn.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:defyx_vpn/modules/core/network.dart'; import 'package:defyx_vpn/shared/providers/connection_state_provider.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:version/version.dart'; diff --git a/lib/modules/main/presentation/widgets/google_ads.dart b/lib/modules/main/presentation/widgets/google_ads.dart index 8f5b65b..2a508c1 100644 --- a/lib/modules/main/presentation/widgets/google_ads.dart +++ b/lib/modules/main/presentation/widgets/google_ads.dart @@ -4,6 +4,7 @@ import 'package:defyx_vpn/app/advertise_director.dart'; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/modules/main/presentation/widgets/logs_widget.dart b/lib/modules/main/presentation/widgets/logs_widget.dart index ce20d24..2ae1c95 100644 --- a/lib/modules/main/presentation/widgets/logs_widget.dart +++ b/lib/modules/main/presentation/widgets/logs_widget.dart @@ -1,8 +1,10 @@ +import 'dart:async'; + import 'package:defyx_vpn/modules/core/log.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter/services.dart'; -import 'dart:async'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; // State class for logs class LogsState { @@ -44,8 +46,9 @@ class LogsNotifier extends StateNotifier { List newLogEntries = newLogs.split('\n'); // Filter out empty lines and already shown logs - List filteredNewLogs = - newLogEntries.where((log) => log.isNotEmpty && !_existingLogs.contains(log)).toList(); + List filteredNewLogs = newLogEntries + .where((log) => log.isNotEmpty && !_existingLogs.contains(log)) + .toList(); if (filteredNewLogs.isNotEmpty) { // Add new logs to the existing logs set to avoid duplicates diff --git a/lib/modules/main/presentation/widgets/tips_widget.dart b/lib/modules/main/presentation/widgets/tips_widget.dart index c861c94..401353a 100644 --- a/lib/modules/main/presentation/widgets/tips_widget.dart +++ b/lib/modules/main/presentation/widgets/tips_widget.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; final tipsCurrentPageProvider = StateProvider((ref) => 0); diff --git a/lib/modules/settings/providers/settings_provider.dart b/lib/modules/settings/providers/settings_provider.dart index ace09fa..6478ee9 100644 --- a/lib/modules/settings/providers/settings_provider.dart +++ b/lib/modules/settings/providers/settings_provider.dart @@ -4,6 +4,7 @@ import 'package:defyx_vpn/core/data/local/secure_storage/secure_storage_const.da import 'package:defyx_vpn/core/data/local/secure_storage/secure_storage_interface.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import '../models/settings_item.dart'; import '../models/settings_group.dart'; import '../constants/settings_constants.dart'; @@ -36,7 +37,7 @@ class SettingsState { } class SettingsNotifier extends StateNotifier { - final Ref ref; + final Ref ref; ISecureStorage? _secureStorage; bool _isInitialized = false; diff --git a/lib/modules/speed_test/application/speed_test_provider.dart b/lib/modules/speed_test/application/speed_test_provider.dart index b7a00a4..9b2078d 100644 --- a/lib/modules/speed_test/application/speed_test_provider.dart +++ b/lib/modules/speed_test/application/speed_test_provider.dart @@ -8,6 +8,7 @@ import 'package:defyx_vpn/shared/providers/connection_state_provider.dart'; import 'package:defyx_vpn/shared/services/alert_service.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'services/cloudflare_logger_service.dart'; import 'services/download_measurement_service.dart'; import 'services/latency_measurement_service.dart'; diff --git a/lib/modules/speed_test/data/api/speed_test_api.g.dart b/lib/modules/speed_test/data/api/speed_test_api.g.dart index 70a48f1..8c00056 100644 --- a/lib/modules/speed_test/data/api/speed_test_api.g.dart +++ b/lib/modules/speed_test/data/api/speed_test_api.g.dart @@ -2,11 +2,13 @@ part of 'speed_test_api.dart'; +// dart format off + // ************************************************************************** // RetrofitGenerator // ************************************************************************** -// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations,unused_element_parameter +// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations,unused_element_parameter,avoid_unused_constructor_parameters,unreachable_from_main class _SpeedTestApi implements SpeedTestApi { _SpeedTestApi(this._dio, {this.baseUrl, this.errorLogger}) { @@ -38,11 +40,11 @@ class _SpeedTestApi implements SpeedTestApi { const Map? _data = null; final _options = _setStreamType>>( Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) .compose( _dio.options, '/__down', @@ -58,7 +60,7 @@ class _SpeedTestApi implements SpeedTestApi { try { _value = _result.data!.cast(); } on Object catch (e, s) { - errorLogger?.logError(e, s, _options); + errorLogger?.logError(e, s, _options, response: _result); rethrow; } final httpResponse = HttpResponse(_value, _result); @@ -89,11 +91,11 @@ class _SpeedTestApi implements SpeedTestApi { final _data = data; final _options = _setStreamType>( Options( - method: 'POST', - headers: _headers, - extra: _extra, - contentType: contentType, - ) + method: 'POST', + headers: _headers, + extra: _extra, + contentType: contentType, + ) .compose( _dio.options, '/__up', @@ -206,7 +208,7 @@ class _SpeedTestApi implements SpeedTestApi { try { _value = _result.data!; } on Object catch (e, s) { - errorLogger?.logError(e, s, _options); + errorLogger?.logError(e, s, _options, response: _result); rethrow; } final httpResponse = HttpResponse(_value, _result); @@ -240,3 +242,5 @@ class _SpeedTestApi implements SpeedTestApi { return Uri.parse(dioBaseUrl).resolveUri(url).toString(); } } + +// dart format on diff --git a/lib/shared/providers/app_screen_provider.dart b/lib/shared/providers/app_screen_provider.dart index a70faa3..06cc0ce 100644 --- a/lib/shared/providers/app_screen_provider.dart +++ b/lib/shared/providers/app_screen_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; enum AppScreen { home, speedTest, share, settings } diff --git a/lib/shared/providers/connection_state_provider.dart b/lib/shared/providers/connection_state_provider.dart index 824d5e3..b366c72 100644 --- a/lib/shared/providers/connection_state_provider.dart +++ b/lib/shared/providers/connection_state_provider.dart @@ -1,5 +1,5 @@ import 'package:flutter/rendering.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter/services.dart'; import 'dart:async'; diff --git a/lib/shared/providers/flow_line_provider.dart b/lib/shared/providers/flow_line_provider.dart index bd10f05..b15a37b 100644 --- a/lib/shared/providers/flow_line_provider.dart +++ b/lib/shared/providers/flow_line_provider.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; import 'package:shared_preferences/shared_preferences.dart'; class FlowLineState { diff --git a/lib/shared/providers/group_provider.dart b/lib/shared/providers/group_provider.dart index fa5af9a..af4b882 100644 --- a/lib/shared/providers/group_provider.dart +++ b/lib/shared/providers/group_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; class GroupState { final String groupName; diff --git a/lib/shared/providers/logs_provider.dart b/lib/shared/providers/logs_provider.dart index 96a7a4e..959b1b6 100644 --- a/lib/shared/providers/logs_provider.dart +++ b/lib/shared/providers/logs_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/legacy.dart'; enum LoggerStatus { loading, connecting, switching_method } diff --git a/pubspec.lock b/pubspec.lock index 5757614..fe0ec10 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,34 +5,34 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d url: "https://pub.dev" source: hosted - version: "85.0.0" + version: "91.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: "8a1f5f3020ef2a74fb93f7ab3ef127a8feea33a7a2276279113660784ee7516a" + sha256: cd83f7d6bd4e4c0b0b4fef802e8796784032e1cc23d7b0e982cf5d05d9bbe182 url: "https://pub.dev" source: hosted - version: "1.3.64" + version: "1.3.66" analyzer: dependency: transitive description: name: analyzer - sha256: f4ad0fea5f102201015c9aae9d93bc02f75dd9491529a8c21f88d17a8523d44c + sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 url: "https://pub.dev" source: hosted - version: "7.6.0" - analyzer_plugin: + version: "8.4.1" + analyzer_buffer: dependency: transitive description: - name: analyzer_plugin - sha256: a5ab7590c27b779f3d4de67f31c4109dbe13dd7339f86461a6f2a8ab2594d8ce + name: analyzer_buffer + sha256: aba2f75e63b3135fd1efaa8b6abefe1aa6e41b6bd9806221620fa48f98156033 url: "https://pub.dev" source: hosted - version: "0.13.4" + version: "0.1.11" ansicolor: dependency: transitive description: @@ -149,18 +149,18 @@ packages: dependency: transitive description: name: build - sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" + sha256: "275bf6bb2a00a9852c28d4e0b410da1d833a734d57d39d44f94bfc895a484ec3" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "4.0.4" build_config: dependency: transitive description: name: build_config - sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.2.0" build_daemon: dependency: transitive description: @@ -169,30 +169,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.1" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 - url: "https://pub.dev" - source: hosted - version: "2.5.4" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" - url: "https://pub.dev" - source: hosted - version: "2.5.4" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" + sha256: ac78098de97893812b7aff1154f29008fa2464cad9e8e7044d39bc905dad4fbc url: "https://pub.dev" source: hosted - version: "9.1.2" + version: "2.11.0" built_collection: dependency: transitive description: @@ -205,10 +189,10 @@ packages: dependency: transitive description: name: built_value - sha256: "426cf75afdb23aa74bd4e471704de3f9393f3c7b04c1e2d9c6f1073ae0b8b139" + sha256: "7931c90b84bc573fef103548e354258ae4c9d28d140e41961df6843c5d60d4d8" url: "https://pub.dev" source: hosted - version: "8.12.1" + version: "8.12.3" characters: dependency: transitive description: @@ -225,6 +209,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.4" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" cli_util: dependency: transitive description: @@ -241,14 +233,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" code_builder: dependency: transitive description: name: code_builder - sha256: "11654819532ba94c34de52ff5feb52bd81cba1de00ef2ed622fd50295f9d4243" + sha256: "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d" url: "https://pub.dev" source: hosted - version: "4.11.0" + version: "4.11.1" collection: dependency: transitive description: @@ -289,6 +289,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" crypto: dependency: transitive description: @@ -313,46 +321,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" - custom_lint_core: - dependency: transitive - description: - name: custom_lint_core - sha256: "31110af3dde9d29fb10828ca33f1dce24d2798477b167675543ce3d208dee8be" - url: "https://pub.dev" - source: hosted - version: "0.7.5" - custom_lint_visitor: - dependency: transitive - description: - name: custom_lint_visitor - sha256: "4a86a0d8415a91fbb8298d6ef03e9034dc8e323a599ddc4120a0e36c433983a2" - url: "https://pub.dev" - source: hosted - version: "1.0.0+7.7.0" dart_style: dependency: transitive description: name: dart_style - sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.3" dbus: dependency: transitive description: name: dbus - sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + sha256: d0c98dcd4f5169878b6cf8f6e0a52403a9dff371a3e2f019697accbf6f44a270 url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.12" device_info_plus: dependency: transitive description: name: device_info_plus - sha256: dd0e8e02186b2196c7848c9d394a5fd6e5b57a43a546082c5820b1ec72317e33 + sha256: "4df8babf73058181227e18b08e6ea3520cf5fc5d796888d33b7cb0f33f984b7c" url: "https://pub.dev" source: hosted - version: "12.2.0" + version: "12.3.0" device_info_plus_platform_interface: dependency: transitive description: @@ -365,10 +357,10 @@ packages: dependency: "direct main" description: name: dio - sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 + sha256: b9d46faecab38fc8cc286f80bc4d61a3bb5d4ac49e51ed877b4d6706efe57b25 url: "https://pub.dev" source: hosted - version: "5.9.0" + version: "5.9.1" dio_http_formatter: dependency: "direct main" description: @@ -389,10 +381,10 @@ packages: dependency: transitive description: name: equatable - sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.8" fake_async: dependency: transitive description: @@ -405,10 +397,10 @@ packages: dependency: transitive description: name: ffi - sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" file: dependency: transitive description: @@ -421,34 +413,34 @@ packages: dependency: "direct main" description: name: firebase_analytics - sha256: bfb80d92eee10a6585ebd5a7e60de5caf0f2c06329e5676c0578130aea1bfe85 + sha256: "91e2739bad690da2826c0cd5b28328fd15fb87adf54634cded703f34fd797a81" url: "https://pub.dev" source: hosted - version: "12.0.4" + version: "12.1.1" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface - sha256: "3b803077907def997044774f6c022d8e9204e9c0f5e205e3572d887c93dafd72" + sha256: "62fd3f27f342c898bd819fb97fa87c0b971e9fbe03357477282c0e14e1a40c3c" url: "https://pub.dev" source: hosted - version: "5.0.4" + version: "5.0.6" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web - sha256: "0dbd96dbe77b51185319000c0078477fdcffb4abb0018c362dd9afb9845c1e06" + sha256: "8fc488bb008439fc3b850cfac892dec1ff4cd438eee44438919a14c5e61b9828" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.6.1+2" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "1f2dfd9f535d81f8b06d7a50ecda6eac1e6922191ed42e09ca2c84bd2288927c" + sha256: "923085c881663ef685269b013e241b428e1fb03cdd0ebde265d9b40ff18abf80" url: "https://pub.dev" source: hosted - version: "4.2.1" + version: "4.4.0" firebase_core_platform_interface: dependency: transitive description: @@ -461,10 +453,10 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: ff18fabb0ad0ed3595d2f2c85007ecc794aadecdff5b3bb1460b7ee47cded398 + sha256: "83e7356c704131ca4d8d8dd57e360d8acecbca38b1a3705c7ae46cc34c708084" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.0" fixnum: dependency: transitive description: @@ -477,10 +469,10 @@ packages: dependency: "direct main" description: name: flame - sha256: "348136b7d928188a8c9a11cd844d9125b02e7afc6c83bb9a52a16aee88ab7e81" + sha256: "6a98c1697bfe4669c604e4459cb01ca96559f464d3523f6af90a8956bf2080ee" url: "https://pub.dev" source: hosted - version: "1.34.0" + version: "1.35.0" flutter: dependency: "direct main" description: flutter @@ -498,10 +490,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" flutter_native_splash: dependency: "direct main" description: @@ -514,10 +506,10 @@ packages: dependency: "direct main" description: name: flutter_riverpod - sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" + sha256: "38ec6c303e2c83ee84512f5fc2a82ae311531021938e63d7137eccc107bf3c02" url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "3.1.0" flutter_screenutil: dependency: "direct main" description: @@ -530,50 +522,50 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40 url: "https://pub.dev" source: hosted - version: "9.2.4" - flutter_secure_storage_linux: + version: "10.0.0" + flutter_secure_storage_darwin: dependency: transitive description: - name: flutter_secure_storage_linux - sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 + name: flutter_secure_storage_darwin + sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3" url: "https://pub.dev" source: hosted - version: "1.2.3" - flutter_secure_storage_macos: + version: "0.2.0" + flutter_secure_storage_linux: dependency: transitive description: - name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + name: flutter_secure_storage_linux + sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.1" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.1.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "4.1.0" flutter_svg: dependency: "direct main" description: @@ -591,10 +583,10 @@ packages: dependency: "direct main" description: name: flutter_timezone - sha256: "13b2109ad75651faced4831bf262e32559e44aa549426eab8a597610d385d934" + sha256: "978192f2f9ea6d019a4de4f0211d76a9af955ca24865828fa98ca4e20cf0cb3c" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "5.0.1" flutter_web_plugins: dependency: transitive description: flutter @@ -604,18 +596,18 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c" + sha256: "13065f10e135263a4f5a4391b79a8efc5fb8106f8dd555a9e49b750b45393d77" url: "https://pub.dev" source: hosted - version: "2.5.8" + version: "3.2.3" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "3.1.0" frontend_server_client: dependency: transitive description: @@ -628,10 +620,10 @@ packages: dependency: transitive description: name: get_it - sha256: ae78de7c3f2304b8d81f2bb6e320833e5e81de942188542328f074978cc0efa9 + sha256: "1d648d2dd2047d7f7450d5727ca24ee435f240385753d90b49650e3cdff32e56" url: "https://pub.dev" source: hosted - version: "8.3.0" + version: "9.2.0" glob: dependency: transitive description: @@ -644,18 +636,18 @@ packages: dependency: "direct main" description: name: go_router - sha256: f02fd7d2a4dc512fec615529824fdd217fecb3a3d3de68360293a551f21634b3 + sha256: "7974313e217a7771557add6ff2238acb63f635317c35fa590d348fb238f00896" url: "https://pub.dev" source: hosted - version: "14.8.1" + version: "17.1.0" google_mobile_ads: dependency: "direct main" description: name: google_mobile_ads - sha256: a4f59019f2c32769fb6c60ed8aa321e9c21a36297e2c4f23452b3e779a3e7a26 + sha256: f35e040875bb54e8a3455bcffed3b4ac9e9263fbf7751b9fd1ae7f30793faee8 url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "7.0.0" graphs: dependency: transitive description: @@ -664,6 +656,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + hooks: + dependency: transitive + description: + name: hooks + sha256: "7a08a0d684cb3b8fb604b78455d5d352f502b68079f7b80b831c62220ab0a4f6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b + url: "https://pub.dev" + source: hosted + version: "4.3.0" html: dependency: transitive description: @@ -708,18 +716,18 @@ packages: dependency: transitive description: name: image - sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + sha256: "492bd52f6c4fbb6ee41f781ff27765ce5f627910e1e0cbecfa3d9add5562604c" url: "https://pub.dev" source: hosted - version: "4.5.4" + version: "4.7.2" intl: dependency: "direct main" description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.20.2" io: dependency: transitive description: @@ -732,10 +740,10 @@ packages: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "0.7.2" json_annotation: dependency: "direct main" description: @@ -748,10 +756,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + sha256: c5b2ee75210a0f263c6c7b9eeea80553dbae96ea1bf57f02484e806a3ffdffa3 url: "https://pub.dev" source: hosted - version: "6.9.5" + version: "6.11.2" leak_tracker: dependency: transitive description: @@ -776,14 +784,22 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + lean_builder: + dependency: transitive + description: + name: lean_builder + sha256: "6af3cfbf34400eb14b89fe20111e5981e7083362f00ea10b9ed2a6e833250d76" + url: "https://pub.dev" + source: hosted + version: "0.1.6" lints: dependency: transitive description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "6.1.0" logger: dependency: transitive description: @@ -828,10 +844,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" mime: dependency: transitive description: @@ -840,14 +856,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" + mockito: + dependency: transitive + description: + name: mockito + sha256: a45d1aa065b796922db7b9e7e7e45f921aed17adf3a8318a1f47097e7e695566 + url: "https://pub.dev" + source: hosted + version: "5.6.3" msix: dependency: "direct main" description: name: msix - sha256: f88033fcb9e0dd8de5b18897cbebbd28ea30596810f4a7c86b12b0c03ace87e5 + sha256: b6b08e7a7b5d1845f2b1d31216d5b1fb558e98251efefe54eb79ed00d27bc2ac + url: "https://pub.dev" + source: hosted + version: "3.16.13" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" url: "https://pub.dev" source: hosted - version: "3.16.12" + version: "0.17.4" nm: dependency: transitive description: @@ -856,6 +888,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52" + url: "https://pub.dev" + source: hosted + version: "9.3.0" ordered_set: dependency: transitive description: @@ -876,10 +924,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968" + sha256: f69da0d3189a4b4ceaeb1a3defb0f329b3b352517f52bed4290f83d4f06bc08d url: "https://pub.dev" source: hosted - version: "8.3.1" + version: "9.0.0" package_info_plus_platform_interface: dependency: transitive description: @@ -932,10 +980,10 @@ packages: dependency: transitive description: name: path_provider_foundation - sha256: "97390a0719146c7c3e71b6866c34f1cde92685933165c1c671984390d2aca776" + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.6.0" path_provider_linux: dependency: transitive description: @@ -1012,10 +1060,10 @@ packages: dependency: transitive description: name: protobuf - sha256: de9c9eb2c33f8e933a42932fe1dc504800ca45ebc3d673e6ed7f39754ee4053e + sha256: "75ec242d22e950bdcc79ee38dd520ce4ee0bc491d7fadc4ea47694604d22bf06" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "6.0.0" pub_semver: dependency: transitive description: @@ -1036,50 +1084,50 @@ packages: dependency: "direct main" description: name: retrofit - sha256: "7d78824afa6eeeaf6ac58220910ee7a97597b39e93360d4bda230b7c6df45089" + sha256: "0f629ed26b2c48c66fe54bd548313c6fdf7955be18bff37e08a46dd3f97f8eaf" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.9.2" retrofit_generator: dependency: "direct dev" description: name: retrofit_generator - sha256: "9abcf21acb95bf7040546eafff87f60cf0aee20b05101d71f99876fc4df1f522" + sha256: fed2c4e4ed6dab084c00d25c739988aa3cec1acd2b168771136188cced8d967d url: "https://pub.dev" source: hosted - version: "9.7.0" + version: "10.2.1" riverpod: dependency: transitive description: name: riverpod - sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" + sha256: "16ff608d21e8ea64364f2b7c049c94a02ab81668f78845862b6e88b71dd4935a" url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "3.1.0" riverpod_analyzer_utils: dependency: transitive description: name: riverpod_analyzer_utils - sha256: "837a6dc33f490706c7f4632c516bcd10804ee4d9ccc8046124ca56388715fdf3" + sha256: "947b05d04c52a546a2ac6b19ef2a54b08520ff6bdf9f23d67957a4c8df1c3bc0" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "1.0.0-dev.8" riverpod_annotation: dependency: transitive description: name: riverpod_annotation - sha256: e14b0bf45b71326654e2705d462f21b958f987087be850afd60578fcd502d1b8 + sha256: cc1474bc2df55ec3c1da1989d139dcef22cd5e2bd78da382e867a69a8eca2e46 url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "4.0.0" riverpod_generator: dependency: "direct dev" description: name: riverpod_generator - sha256: "120d3310f687f43e7011bb213b90a436f1bbc300f0e4b251a72c39bccb017a4f" + sha256: e43b1537229cc8f487f09b0c20d15dba840acbadcf5fc6dad7ad5e8ab75950dc url: "https://pub.dev" source: hosted - version: "2.6.4" + version: "4.0.0+1" sensors_plus: dependency: transitive description: @@ -1108,18 +1156,18 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.5.4" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "46a46fd64659eff15f4638bbe19de43f9483f0e0bf024a9fb6b3582064bacc7b" + sha256: cbc40be9be1c5af4dab4d6e0de4d5d3729e6f3d65b89d21e1815d57705644a6f url: "https://pub.dev" source: hosted - version: "2.4.17" + version: "2.4.20" shared_preferences_foundation: dependency: transitive description: @@ -1168,6 +1216,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" shelf_web_socket: dependency: transitive description: @@ -1193,26 +1257,42 @@ packages: dependency: transitive description: name: source_gen - sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "4.2.0" source_helper: dependency: transitive description: name: source_helper - sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca + sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723" + url: "https://pub.dev" + source: hosted + version: "1.3.8" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" url: "https://pub.dev" source: hosted - version: "1.3.7" + version: "0.10.13" source_span: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" stack_trace: dependency: transitive description: @@ -1269,22 +1349,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.2" + test: + dependency: transitive + description: + name: test + sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" + url: "https://pub.dev" + source: hosted + version: "1.26.3" test_api: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.6" - timing: + version: "0.7.7" + test_core: dependency: transitive description: - name: timing - sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + name: test_core + sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "0.6.12" toastification: dependency: "direct main" description: @@ -1369,10 +1457,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" url_launcher_windows: dependency: transitive description: @@ -1409,10 +1497,10 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc + sha256: "201e876b5d52753626af64b6359cd13ac6011b80728731428fd34bc840f71c9b" url: "https://pub.dev" source: hosted - version: "1.1.19" + version: "1.1.20" vector_math: dependency: transitive description: @@ -1433,10 +1521,10 @@ packages: dependency: "direct main" description: name: vibration - sha256: "1fd51cb0f91c6d512734ca0e282dd87fbc7f389b6da5f03c77709ba2cf8fa901" + sha256: bfb274be6996651d36bf3e3a947d2122767dae255cfb9ce6ce8ee4b38fb56bad url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.5" vibration_platform_interface: dependency: transitive description: @@ -1485,22 +1573,30 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" webview_flutter: dependency: "direct main" description: name: webview_flutter - sha256: c3e4fe614b1c814950ad07186007eff2f2e5dd2935eba7b9a9a1af8e5885f1ba + sha256: a3da219916aba44947d3a5478b1927876a09781174b5a2b67fa5be0555154bf9 url: "https://pub.dev" source: hosted - version: "4.13.0" + version: "4.13.1" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "3fcca88ee2ae568807ebd42deed235bb8dd8e62b3e4d5caff67daa6bce062cca" + sha256: eeeb3fcd5f0ff9f8446c9f4bbc18a99b809e40297528a3395597d03aafb9f510 url: "https://pub.dev" source: hosted - version: "4.10.9" + version: "4.10.11" webview_flutter_platform_interface: dependency: transitive description: @@ -1513,10 +1609,10 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: a57b76a081bed3bf3a71a486bdf83642b00f1a7342043d50367cea68f338b1af + sha256: "0412b657a2828fb301e73509909e6ec02b77cd2b441ae9f77125d482b3ddf0e7" url: "https://pub.dev" source: hosted - version: "3.23.4" + version: "3.23.6" win32: dependency: transitive description: @@ -1549,6 +1645,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.6.1" + xxh3: + dependency: transitive + description: + name: xxh3 + sha256: "399a0438f5d426785723c99da6b16e136f4953fb1e9db0bf270bd41dd4619916" + url: "https://pub.dev" + source: hosted + version: "1.2.0" yaml: dependency: transitive description: @@ -1558,5 +1662,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.9.0 <4.0.0" - flutter: ">=3.35.0" + dart: ">=3.10.3 <4.0.0" + flutter: ">=3.38.4" diff --git a/pubspec.yaml b/pubspec.yaml index 2fdbc2d..28dd8ef 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,33 +4,33 @@ publish_to: "none" version: 3.8.2+234 environment: - sdk: ^3.5.3 + sdk: ^3.8.0 dependencies: flutter: sdk: flutter # Backend Packages - flutter_riverpod: ^2.5.1 - go_router: ^14.3.1 + flutter_riverpod: ^3.1.0 + go_router: ^17.0.1 shared_preferences: ^2.2.2 dio: ^5.7.0 dio_http_formatter: ^3.2.1 shimmer: ^3.0.0 shake: ^3.0.0 vibration: ^3.1.3 - google_mobile_ads: ^6.0.0 + google_mobile_ads: ^7.0.0 url_launcher: ^6.3.1 flame: ^1.29.0 webview_flutter: ^4.13.0 async: ^2.12.0 - flutter_secure_storage: ^9.2.4 - freezed_annotation: ^2.4.4 - retrofit: ^4.9.0 + flutter_secure_storage: ^10.0.0 + freezed_annotation: ^3.1.0 + retrofit: ^4.9.1 json_annotation: ^4.9.0 - package_info_plus: ^8.3.0 + package_info_plus: ^9.0.0 version: ^3.0.2 - flutter_timezone: ^4.1.1 + flutter_timezone: ^5.0.1 connectivity_plus: ^7.0.0 # Frontend Packages @@ -39,7 +39,7 @@ dependencies: lottie: ^3.3.1 toastification: ^3.0.3 path_drawing: ^1.0.1 - intl: ^0.19.0 + intl: ^0.20.2 cupertino_icons: ^1.0.8 flutter_dotenv: ^6.0.0 firebase_core: ^4.2.0 @@ -54,12 +54,12 @@ dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 - build_runner: ^2.4.13 - retrofit_generator: ^9.1.2 + flutter_lints: ^6.0.0 + build_runner: ^2.7.1 + retrofit_generator: ^10.2.0 json_serializable: ^6.8.0 - freezed: ^2.5.7 - riverpod_generator: ^2.4.3 + freezed: ^3.2.3 + riverpod_generator: ^4.0.0+1 flutter: uses-material-design: true From d4a6be893e7e054d685fa8f09365d18976c5a446 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Wed, 11 Feb 2026 18:04:17 +0330 Subject: [PATCH 02/10] Refactor loggerStateProvider, groupStateProvider and currentScreenProvider to use NotifierProvider instead of legacy ones --- lib/shared/layout/navbar/defyx_navbar.dart | 4 ++-- lib/shared/providers/app_screen_provider.dart | 13 +++++++++++-- lib/shared/providers/group_provider.dart | 14 +++++++------- lib/shared/providers/logs_provider.dart | 14 +++++++------- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/lib/shared/layout/navbar/defyx_navbar.dart b/lib/shared/layout/navbar/defyx_navbar.dart index 5dcea4e..b88ead6 100644 --- a/lib/shared/layout/navbar/defyx_navbar.dart +++ b/lib/shared/layout/navbar/defyx_navbar.dart @@ -115,7 +115,7 @@ class DefyxNavBar extends ConsumerWidget { } void _showShareDialog(BuildContext context, WidgetRef ref) { - ref.read(currentScreenProvider.notifier).state = AppScreen.share; + ref.read(currentScreenProvider.notifier).setScreen(AppScreen.share); showGeneralDialog( context: context, barrierDismissible: true, @@ -142,7 +142,7 @@ class DefyxNavBar extends ConsumerWidget { ); }, ).then((_) { - ref.read(currentScreenProvider.notifier).state = AppScreen.home; + ref.read(currentScreenProvider.notifier).setScreen(AppScreen.home); }); } } diff --git a/lib/shared/providers/app_screen_provider.dart b/lib/shared/providers/app_screen_provider.dart index 06cc0ce..895a151 100644 --- a/lib/shared/providers/app_screen_provider.dart +++ b/lib/shared/providers/app_screen_provider.dart @@ -1,5 +1,14 @@ -import 'package:flutter_riverpod/legacy.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; enum AppScreen { home, speedTest, share, settings } -final currentScreenProvider = StateProvider((ref) => AppScreen.home); +class AppScreenNotifier extends Notifier { + @override + AppScreen build() => AppScreen.home; + + void setScreen(AppScreen screen) => state = screen; +} + +final currentScreenProvider = NotifierProvider( + AppScreenNotifier.new, +); diff --git a/lib/shared/providers/group_provider.dart b/lib/shared/providers/group_provider.dart index af4b882..f07aebb 100644 --- a/lib/shared/providers/group_provider.dart +++ b/lib/shared/providers/group_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_riverpod/legacy.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; class GroupState { final String groupName; @@ -10,13 +10,13 @@ class GroupState { } } -final groupStateProvider = - StateNotifierProvider((ref) { - return GroupStateNotifier(); -}); +final groupStateProvider = NotifierProvider( + GroupStateNotifier.new, +); -class GroupStateNotifier extends StateNotifier { - GroupStateNotifier() : super(const GroupState()); +class GroupStateNotifier extends Notifier { + @override + GroupState build() => const GroupState(); void setGroupName(String name) { state = state.copyWith(groupName: name.toUpperCase()); diff --git a/lib/shared/providers/logs_provider.dart b/lib/shared/providers/logs_provider.dart index 959b1b6..e841861 100644 --- a/lib/shared/providers/logs_provider.dart +++ b/lib/shared/providers/logs_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_riverpod/legacy.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; enum LoggerStatus { loading, connecting, switching_method } @@ -12,13 +12,13 @@ class LoggerState { } } -final loggerStateProvider = - StateNotifierProvider((ref) { - return LoggerStateNotifier(); - }); +final loggerStateProvider = NotifierProvider( + LoggerStateNotifier.new, +); -class LoggerStateNotifier extends StateNotifier { - LoggerStateNotifier() : super(const LoggerState()); +class LoggerStateNotifier extends Notifier { + @override + LoggerState build() => const LoggerState(); void setLoading() { state = LoggerState(status: LoggerStatus.loading); From 5a7ff3c905a709c6cbd83bb6d90685c6f40d86e9 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Sun, 15 Feb 2026 01:31:23 +0330 Subject: [PATCH 03/10] Refactor legacy providers to use NotifierProvider --- lib/modules/core/vpn.dart | 2 - .../presentation/screens/settings_screen.dart | 2 +- .../settings/providers/settings_provider.dart | 52 ++++++++----------- lib/shared/layout/navbar/defyx_navbar.dart | 8 +-- .../providers/connection_state_provider.dart | 27 +++++----- lib/shared/providers/flow_line_provider.dart | 24 +++++---- 6 files changed, 53 insertions(+), 62 deletions(-) diff --git a/lib/modules/core/vpn.dart b/lib/modules/core/vpn.dart index 4036b20..7c15d35 100644 --- a/lib/modules/core/vpn.dart +++ b/lib/modules/core/vpn.dart @@ -352,11 +352,9 @@ class VPN { } Future initVPN() async { - _container?.read(settingsLoadingProvider.notifier).state = true; await _container?.read(flowlineServiceProvider).saveFlowline(true); await _vpnBridge.setAsnName(); await _container?.read(flowlineServiceProvider).saveFlowline(false); - _container?.read(settingsLoadingProvider.notifier).state = false; } Future _updatePing() async { diff --git a/lib/modules/settings/presentation/screens/settings_screen.dart b/lib/modules/settings/presentation/screens/settings_screen.dart index 45a1caf..9a70b57 100644 --- a/lib/modules/settings/presentation/screens/settings_screen.dart +++ b/lib/modules/settings/presentation/screens/settings_screen.dart @@ -208,7 +208,7 @@ class _SettingsScreenState extends ConsumerState { Widget _buildSettingsContent(WidgetRef ref, BuildContext context) { final settingsState = ref.watch(settingsProvider); final settingsNotifier = ref.read(settingsProvider.notifier); - final groups = settingsState.groupList; + final groups = settingsState.value?.groupList ?? []; return Column( children: groups diff --git a/lib/modules/settings/providers/settings_provider.dart b/lib/modules/settings/providers/settings_provider.dart index 6478ee9..ee621a2 100644 --- a/lib/modules/settings/providers/settings_provider.dart +++ b/lib/modules/settings/providers/settings_provider.dart @@ -4,7 +4,6 @@ import 'package:defyx_vpn/core/data/local/secure_storage/secure_storage_const.da import 'package:defyx_vpn/core/data/local/secure_storage/secure_storage_interface.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; import '../models/settings_item.dart'; import '../models/settings_group.dart'; import '../constants/settings_constants.dart'; @@ -36,35 +35,35 @@ class SettingsState { SettingsGroup? getGroup(String id) => groups[id]; } -class SettingsNotifier extends StateNotifier { - final Ref ref; +class SettingsNotifier extends AsyncNotifier { ISecureStorage? _secureStorage; - bool _isInitialized = false; - SettingsNotifier(this.ref) : super(const SettingsState(groups: {})) { + @override + Future build() async { _secureStorage = ref.read(secureStorageProvider); - _initializeSettings(); + state = const AsyncValue.loading(); + final groups = await _initializeSettings(); + return SettingsState(groups: groups); } // ============== Initialization ============== - Future _initializeSettings() async { + Future> _initializeSettings() async { await _updateConnectionMethodFromFlowLine(); _ensureStaticGroups(); - _isInitialized = true; debugPrint('Settings initialized'); + return state.value?.groups ?? {}; } // ============== Storage Operations ============== Future _saveSettings() async { - if (!_isInitialized && state.groups.isEmpty) { + final groups = state.value?.groups ?? {}; + if (groups.isEmpty) { debugPrint('Skipping save - not initialized yet'); return; } - - final jsonMap = - state.groups.map((key, group) => MapEntry(key, group.toJson())); + final jsonMap = groups.map((key, group) => MapEntry(key, group.toJson())); final jsonString = jsonEncode(jsonMap); await _secureStorage?.write(SettingsStorageKey.appSettings, jsonString); } @@ -82,21 +81,19 @@ class SettingsNotifier extends StateNotifier { // ============== Group Management ============== void _updateGroup(SettingsGroup group) { - final updatedGroups = Map.from(state.groups); + final updatedGroups = Map.from(state.value?.groups ?? {}); updatedGroups[group.id] = group; - state = state.copyWith(groups: updatedGroups); + state = AsyncValue.data(state.value?.copyWith(groups: updatedGroups) ?? SettingsState(groups: updatedGroups)); } void _ensureStaticGroups() { - final updatedGroups = Map.from(state.groups); - + final updatedGroups = Map.from(state.value?.groups ?? {}); // Only add traffic control if it doesn't exist if (!updatedGroups.containsKey(SettingsGroupId.trafficControl)) { updatedGroups[SettingsGroupId.trafficControl] = _createTrafficControlGroup(); } - - state = state.copyWith(groups: updatedGroups); + state = AsyncValue.data(state.value?.copyWith(groups: updatedGroups) ?? SettingsState(groups: updatedGroups)); // Only save if we have connection_method loaded (not empty state) if (updatedGroups.containsKey(SettingsGroupId.connectionMethod)) { @@ -107,7 +104,7 @@ class SettingsNotifier extends StateNotifier { // ============== Group Creation ============== SettingsGroup _createTrafficControlGroup() { - final savedGroup = state.groups[SettingsGroupId.trafficControl]; + final savedGroup = state.value?.groups[SettingsGroupId.trafficControl]; return SettingsFactory.createTrafficControlGroup( splitTunnelEnabled: SettingsFactory.getSavedItemState( @@ -121,7 +118,7 @@ class SettingsNotifier extends StateNotifier { ); } bool isDeepScanEnabled() { - final savedGroup = state.groups[SettingsGroupId.trafficControl]; + final savedGroup = state.value?.groups[SettingsGroupId.trafficControl]; return SettingsFactory.getSavedItemState( savedGroup?.items, SettingsItemId.deepScan, @@ -229,7 +226,7 @@ class SettingsNotifier extends StateNotifier { // ============== Public Actions ============== void toggleSetting(String groupId, String itemId, [BuildContext? context]) { - final group = state.groups[groupId]; + final group = state.value?.groups[groupId]; if (group == null) return; final updatedItems = group.items.map((item) { @@ -251,7 +248,7 @@ class SettingsNotifier extends StateNotifier { } void reorderItems(String groupId, int oldIndex, int newIndex) { - final group = state.groups[groupId]; + final group = state.value?.groups[groupId]; if (group == null || !group.isDraggable) return; final draggableItems = group.items @@ -281,15 +278,14 @@ class SettingsNotifier extends StateNotifier { .map((entry) => entry.value.copyWith(sortOrder: entry.key)) .toList(); - _updateGroup( - group.copyWith(items: [...updatedDraggableItems, ...navigationItems])); + _updateGroup(group.copyWith(items: [...updatedDraggableItems, ...navigationItems])); _saveSettings(); } // ============== Query Methods ============== String getConnectionMethodPattern() { - final group = state.groups[SettingsGroupId.connectionMethod]; + final group = state.value?.groups[SettingsGroupId.connectionMethod]; if (group == null) return ''; final items = group.items @@ -332,8 +328,4 @@ class SettingsNotifier extends StateNotifier { } } -final settingsProvider = StateNotifierProvider( - (ref) => SettingsNotifier(ref), -); - -final settingsLoadingProvider = StateProvider((ref) => false); +final settingsProvider = AsyncNotifierProvider(SettingsNotifier.new); diff --git a/lib/shared/layout/navbar/defyx_navbar.dart b/lib/shared/layout/navbar/defyx_navbar.dart index b88ead6..cf69c1e 100644 --- a/lib/shared/layout/navbar/defyx_navbar.dart +++ b/lib/shared/layout/navbar/defyx_navbar.dart @@ -1,12 +1,12 @@ import 'package:defyx_vpn/app/router/app_router.dart'; import 'package:defyx_vpn/modules/settings/providers/settings_provider.dart'; -import 'package:defyx_vpn/shared/providers/app_screen_provider.dart'; import 'package:defyx_vpn/shared/layout/navbar/widgets/defyx_nav_item.dart'; import 'package:defyx_vpn/shared/layout/navbar/widgets/quick_menu_dialog.dart'; +import 'package:defyx_vpn/shared/providers/app_screen_provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; class DefyxNavBar extends ConsumerWidget { @@ -16,7 +16,7 @@ class DefyxNavBar extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final location = GoRouterState.of(context).uri.path; final currentScreen = _getCurrentScreenFromLocation(location); - final settingsLoading = ref.watch(settingsLoadingProvider); + final settings = ref.watch(settingsProvider); return SafeArea( child: Padding( @@ -52,7 +52,7 @@ class DefyxNavBar extends ConsumerWidget { DefyxNavItem( screen: AppScreen.settings, icon: "settings", - isLoading: settingsLoading, + isLoading: settings.isLoading, current: currentScreen, onTap: () => _navigateToSettings(context), ), diff --git a/lib/shared/providers/connection_state_provider.dart b/lib/shared/providers/connection_state_provider.dart index b366c72..48675a5 100644 --- a/lib/shared/providers/connection_state_provider.dart +++ b/lib/shared/providers/connection_state_provider.dart @@ -1,8 +1,9 @@ +import 'dart:async'; + import 'package:flutter/rendering.dart'; -import 'package:flutter_riverpod/legacy.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter/services.dart'; -import 'dart:async'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; enum ConnectionStatus { disconnecting, @@ -36,11 +37,11 @@ class ConnectionState { } final connectionStateProvider = - StateNotifierProvider((ref) { - return ConnectionStateNotifier(); - }); + NotifierProvider( + ConnectionStateNotifier.new, + ); -class ConnectionStateNotifier extends StateNotifier { +class ConnectionStateNotifier extends Notifier { static const String _connectionStatusKey = 'connection_status'; // Method channel for receiving events from iOS @@ -50,9 +51,12 @@ class ConnectionStateNotifier extends StateNotifier { StreamSubscription? _eventSubscription; - ConnectionStateNotifier() : super(const ConnectionState()) { + @override + ConnectionState build() { + ref.onDispose(() => _eventSubscription?.cancel()); // Initialize VPN status listener first, then load saved state _initVpnStatusListener(); + return const ConnectionState(); } // Initialize the listener for VPN status events from native side @@ -145,11 +149,4 @@ class ConnectionStateNotifier extends StateNotifier { state = state.copyWith(status: ConnectionStatus.analyzing); _saveState(); } - - @override - void dispose() { - // Cancel the subscription when the notifier is disposed - _eventSubscription?.cancel(); - super.dispose(); - } } diff --git a/lib/shared/providers/flow_line_provider.dart b/lib/shared/providers/flow_line_provider.dart index b15a37b..89f70f6 100644 --- a/lib/shared/providers/flow_line_provider.dart +++ b/lib/shared/providers/flow_line_provider.dart @@ -1,37 +1,41 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter_riverpod/legacy.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; class FlowLineState { final int step; final int totalSteps; - const FlowLineState({this.step = 0,this.totalSteps = 0}); + const FlowLineState({this.step = 0, this.totalSteps = 0}); FlowLineState copyWith({int? step, int? totalSteps}) { - return FlowLineState(step: step ?? this.step, totalSteps: totalSteps ?? this.totalSteps); + return FlowLineState( + step: step ?? this.step, + totalSteps: totalSteps ?? this.totalSteps, + ); } } final flowLineStepProvider = - StateNotifierProvider((ref) { - return FlowLineStepNotifier(); - }); + NotifierProvider( + FlowLineStepNotifier.new, + ); -class FlowLineStepNotifier extends StateNotifier { +class FlowLineStepNotifier extends Notifier { static const String _flowLineStepKey = 'flow_line_step'; - FlowLineStepNotifier() : super(const FlowLineState()) { + @override + FlowLineState build() { _loadSavedStep(); + return const FlowLineState(); } Future _loadSavedStep() async { try { final prefs = await SharedPreferences.getInstance(); final savedStep = prefs.getInt(_flowLineStepKey); - if (savedStep != null) { - state = FlowLineState(step: savedStep); + state = state.copyWith(step: savedStep); } } catch (e) { debugPrint('Error loading saved flow line step: $e'); From 54faa16aeb15045ba99ade927bec409d21d6c6c4 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Sun, 15 Feb 2026 04:26:33 +0330 Subject: [PATCH 04/10] Refactor trayConnectionToggleTriggerProvider to use NotifierProvider --- lib/modules/core/desktop_platform_handler.dart | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/modules/core/desktop_platform_handler.dart b/lib/modules/core/desktop_platform_handler.dart index 00da7e1..0ce7fc1 100644 --- a/lib/modules/core/desktop_platform_handler.dart +++ b/lib/modules/core/desktop_platform_handler.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; import 'package:go_router/go_router.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:defyx_vpn/app/router/app_router.dart'; @@ -10,7 +9,17 @@ import 'package:defyx_vpn/modules/main/presentation/widgets/logs_widget.dart'; import 'package:defyx_vpn/shared/services/alert_service.dart'; import 'package:defyx_vpn/shared/providers/connection_state_provider.dart'; -final trayConnectionToggleTriggerProvider = StateProvider((ref) => 0); +final trayConnectionToggleTriggerProvider = + NotifierProvider( + TrayConnectionToggleTriggerNotifier.new, + ); + +class TrayConnectionToggleTriggerNotifier extends Notifier { + @override + int build() => 0; + + void increment() => state++; +} class DesktopPlatformHandler { static const MethodChannel _channel = MethodChannel('com.defyx.vpn'); @@ -163,7 +172,9 @@ class DesktopPlatformHandler { debugPrint('DesktopPlatformHandler: Triggering VPN toggle'); try { - container.read(trayConnectionToggleTriggerProvider.notifier).state++; + container + .read(trayConnectionToggleTriggerProvider.notifier) + .increment(); } catch (e) { debugPrint('DesktopPlatformHandler: Error triggering toggle - $e'); } From 25ed4844f33a02849db97d770875b8a149d29cc1 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Sun, 15 Feb 2026 04:39:51 +0330 Subject: [PATCH 05/10] Refactor Google Ads providers to use NotifierProvider --- .../main/presentation/widgets/google_ads.dart | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/lib/modules/main/presentation/widgets/google_ads.dart b/lib/modules/main/presentation/widgets/google_ads.dart index 2a508c1..fc23086 100644 --- a/lib/modules/main/presentation/widgets/google_ads.dart +++ b/lib/modules/main/presentation/widgets/google_ads.dart @@ -4,7 +4,6 @@ import 'package:defyx_vpn/app/advertise_director.dart'; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -49,9 +48,13 @@ class GoogleAdsState { } } -class GoogleAdsNotifier extends StateNotifier { - GoogleAdsNotifier() : super(const GoogleAdsState()); +class GoogleAdsNotifier extends Notifier { Timer? _countdownTimer; + @override + GoogleAdsState build() { + ref.onDispose(() => _countdownTimer?.cancel()); + return const GoogleAdsState(); + } void startCountdownTimer() { if (_countdownTimer != null && _countdownTimer!.isActive) { @@ -105,24 +108,32 @@ class GoogleAdsNotifier extends StateNotifier { void resetState() { state = const GoogleAdsState(); } +} +class AdsLoadTriggerNotifier extends Notifier { @override - void dispose() { - _countdownTimer?.cancel(); - super.dispose(); - } + int build() => 0; + void increment() => state++; +} + +class ShouldShowGoogleAdsNotifier extends Notifier { + @override + bool? build() => null; + void set(bool? value) => state = value; } -final googleAdsProvider = - StateNotifierProvider((ref) { - return GoogleAdsNotifier(); -}); +final googleAdsProvider = NotifierProvider(GoogleAdsNotifier.new); -final adsLoadTriggerProvider = StateProvider((ref) => 0); +final adsLoadTriggerProvider = NotifierProvider(AdsLoadTriggerNotifier.new); -final shouldShowGoogleAdsProvider = StateProvider((ref) => null); +final shouldShowGoogleAdsProvider = NotifierProvider(ShouldShowGoogleAdsNotifier.new); -final customAdDataProvider = StateProvider?>((ref) => null); +class CustomAdDataNotifier extends Notifier?> { + @override + Map? build() => null; + void set(Map? value) => state = value; +} +final customAdDataProvider = NotifierProvider?>(CustomAdDataNotifier.new); class GoogleAds extends ConsumerStatefulWidget { final Color backgroundColor; @@ -182,8 +193,8 @@ class _GoogleAdsState extends ConsumerState { if (!(Platform.isAndroid || Platform.isIOS)) { final customAdData = await AdvertiseDirector.getRandomCustomAd(ref); if (!_isDisposed) { - ref.read(shouldShowGoogleAdsProvider.notifier).state = false; - ref.read(customAdDataProvider.notifier).state = customAdData; + ref.read(shouldShowGoogleAdsProvider.notifier).set(false); + ref.read(customAdDataProvider.notifier).set(customAdData); ref.read(googleAdsProvider.notifier).setAdLoaded(true); } return; @@ -193,7 +204,7 @@ class _GoogleAdsState extends ConsumerState { if (_isDisposed) return; - ref.read(shouldShowGoogleAdsProvider.notifier).state = shouldShowGoogle; + ref.read(shouldShowGoogleAdsProvider.notifier).set(shouldShowGoogle); if (shouldShowGoogle) { _loadGoogleAd(); @@ -202,7 +213,7 @@ class _GoogleAdsState extends ConsumerState { final customAdData = await AdvertiseDirector.getRandomCustomAd(ref); if (!_isDisposed) { - ref.read(customAdDataProvider.notifier).state = customAdData; + ref.read(customAdDataProvider.notifier).set(customAdData); ref.read(googleAdsProvider.notifier).setAdLoaded(true); } } catch (e) { @@ -229,8 +240,8 @@ class _GoogleAdsState extends ConsumerState { // No ad unit id available for this platform; fall back to custom ads. final customAdData = await AdvertiseDirector.getRandomCustomAd(ref); if (!_isDisposed) { - ref.read(shouldShowGoogleAdsProvider.notifier).state = false; - ref.read(customAdDataProvider.notifier).state = customAdData; + ref.read(shouldShowGoogleAdsProvider.notifier).set(false); + ref.read(customAdDataProvider.notifier).set(customAdData); ref.read(googleAdsProvider.notifier).setAdLoaded(true); } return; @@ -310,8 +321,8 @@ class _GoogleAdsState extends ConsumerState { void _retryLoadAd() { _hasInitialized = false; ref.read(googleAdsProvider.notifier).resetState(); - ref.read(shouldShowGoogleAdsProvider.notifier).state = null; - ref.read(customAdDataProvider.notifier).state = null; + ref.read(shouldShowGoogleAdsProvider.notifier).set(null); + ref.read(customAdDataProvider.notifier).set(null); _initializeAds(); } From 89c8d4d4ffaf635bdfe8d46dc13d9ecc0ba47294 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Sun, 15 Feb 2026 04:41:44 +0330 Subject: [PATCH 06/10] Refactor tipsCurrentPageProvider to use NotifierProvider --- .../main/presentation/widgets/tips_widget.dart | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/modules/main/presentation/widgets/tips_widget.dart b/lib/modules/main/presentation/widgets/tips_widget.dart index 401353a..e88e1b6 100644 --- a/lib/modules/main/presentation/widgets/tips_widget.dart +++ b/lib/modules/main/presentation/widgets/tips_widget.dart @@ -3,10 +3,16 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -final tipsCurrentPageProvider = StateProvider((ref) => 0); +class TipsCurrentPageNotifier extends Notifier { + @override + int build() => 0; + void setPage(int value) => state = value; +} + +final tipsCurrentPageProvider = + NotifierProvider(TipsCurrentPageNotifier.new); final tipsPageControllerProvider = Provider((ref) { final controller = PageController(); @@ -35,7 +41,7 @@ final tipsTimerProvider = Provider((ref) { if (pageController.hasClients) { final currentPage = ref.read(tipsCurrentPageProvider); final nextPage = (currentPage + 1) % tips.length; - currentPageNotifier.state = nextPage; + currentPageNotifier.setPage(nextPage); pageController.animateToPage( nextPage, duration: const Duration(milliseconds: 500), @@ -178,7 +184,7 @@ class TipsSlider extends ConsumerWidget { controller: pageController, itemCount: tips.length, onPageChanged: (page) { - ref.read(tipsCurrentPageProvider.notifier).state = page; + ref.read(tipsCurrentPageProvider.notifier).setPage(page); }, itemBuilder: (context, index) { return Column( From 479e89e6a37e0bed5dba3e1806a7fc43c7a667d4 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Sun, 15 Feb 2026 17:41:38 +0330 Subject: [PATCH 07/10] Refactor pingProvider and flagProvider to use AsyncNotifier --- lib/modules/core/vpn.dart | 10 ++---- .../application/main_screen_provider.dart | 35 +++++++++++++------ .../widgets/connection_state_widgets.dart | 6 ++-- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/lib/modules/core/vpn.dart b/lib/modules/core/vpn.dart index 7c15d35..cb8744a 100644 --- a/lib/modules/core/vpn.dart +++ b/lib/modules/core/vpn.dart @@ -230,11 +230,8 @@ class VPN { } Future refreshPing() async { - _container?.read(flagLoadingProvider.notifier).state = true; - _container?.read(pingLoadingProvider.notifier).state = true; - _container?.read(pingProvider.notifier).state = - await _networkStatus.getPing(); - _container?.read(pingLoadingProvider.notifier).state = false; + _container?.read(flagProvider.notifier).invalidate(); + _container?.read(pingProvider.notifier).getPing(_networkStatus); } Future _stopVPN(WidgetRef ref) async { @@ -363,7 +360,6 @@ class VPN { return; } - _container?.read(pingProvider.notifier).state = - await _networkStatus.getPing(); + _container?.read(pingProvider.notifier).getPing(_networkStatus); } } diff --git a/lib/modules/main/application/main_screen_provider.dart b/lib/modules/main/application/main_screen_provider.dart index 43241da..3652328 100644 --- a/lib/modules/main/application/main_screen_provider.dart +++ b/lib/modules/main/application/main_screen_provider.dart @@ -5,27 +5,40 @@ import 'package:defyx_vpn/modules/core/vpn.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:defyx_vpn/modules/core/network.dart'; import 'package:defyx_vpn/shared/providers/connection_state_provider.dart'; -import 'package:flutter_riverpod/legacy.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:version/version.dart'; -final pingLoadingProvider = StateProvider((ref) => false); -final flagLoadingProvider = StateProvider((ref) => false); +class PingNotifier extends AsyncNotifier { + @override + String build() => '0'; -final pingProvider = StateProvider((ref) => '0'); + Future getPing(NetworkStatus network) async { + state = const AsyncValue.loading(); + try { + final ping = await network.getPing(); + state = AsyncValue.data(ping); + } catch (e, st) { + state = AsyncValue.error(e, st); + } + } +} +final pingProvider = AsyncNotifierProvider(PingNotifier.new); -final flagProvider = FutureProvider((ref) async { - final isLoading = ref.watch(flagLoadingProvider); - final network = NetworkStatus(); +final flagProvider = AsyncNotifierProvider(FlagAsyncNotifier.new); - if (isLoading) { +class FlagAsyncNotifier extends AsyncNotifier { + @override + Future build() async { + final network = NetworkStatus(); final flag = await network.getFlag(); - ref.read(flagLoadingProvider.notifier).state = false; return flag.toLowerCase(); } - return (await network.getFlag()).toLowerCase(); -}); + + void invalidate() { + ref.invalidateSelf(asReload: true); + } +} class MainScreenLogic { final WidgetRef ref; diff --git a/lib/modules/main/presentation/widgets/connection_state_widgets.dart b/lib/modules/main/presentation/widgets/connection_state_widgets.dart index 3ad2b4f..9bb8a9f 100644 --- a/lib/modules/main/presentation/widgets/connection_state_widgets.dart +++ b/lib/modules/main/presentation/widgets/connection_state_widgets.dart @@ -152,9 +152,7 @@ class PingIndicator extends ConsumerWidget { child: Consumer( builder: (context, ref, child) { final ping = ref.watch(pingProvider); - final pingLoading = ref.watch(pingLoadingProvider); - final isLoading = pingLoading || ping.isEmpty || ping == "0"; - if (isLoading) { + if (ping.isLoading || ping.hasError || ping.value == '0') { return _pingLoading(); } @@ -162,7 +160,7 @@ class PingIndicator extends ConsumerWidget { children: [ SizedBox(width: 10.w), Text( - ping, + ping.requireValue, style: TextStyle( fontSize: 16.sp, fontFamily: 'Lato', From d2d04643132f97bcd006eaa63d69af10ab1c8323 Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Sun, 15 Feb 2026 18:06:49 +0330 Subject: [PATCH 08/10] Refactor providers to use NotifierProvider --- lib/app/router/app_router.dart | 18 +++++-- .../presentation/widgets/logs_widget.dart | 28 +++++----- .../application/speed_test_provider.dart | 54 ++++++++----------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/lib/app/router/app_router.dart b/lib/app/router/app_router.dart index d6e6d11..8af451b 100644 --- a/lib/app/router/app_router.dart +++ b/lib/app/router/app_router.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; import 'package:go_router/go_router.dart'; import '../../modules/main/presentation/screens/main_screen.dart'; @@ -166,9 +165,18 @@ final routerProvider = Provider((ref) { ); }); +class RouteInformationNotifier extends Notifier { + @override + GoRouteInformationProvider build() { + return ref.watch(routerProvider).routeInformationProvider; + } +} + final routeInformationProvider = - ChangeNotifierProvider( - (ref) => ref.watch(routerProvider).routeInformationProvider); +NotifierProvider( + RouteInformationNotifier.new, +); -final currentRouteProvider = - Provider((ref) => ref.watch(routeInformationProvider).value.uri.toString()); +final currentRouteProvider = Provider( + (ref) => ref.watch(routeInformationProvider).value.uri.toString(), +); diff --git a/lib/modules/main/presentation/widgets/logs_widget.dart b/lib/modules/main/presentation/widgets/logs_widget.dart index 2ae1c95..9d362b6 100644 --- a/lib/modules/main/presentation/widgets/logs_widget.dart +++ b/lib/modules/main/presentation/widgets/logs_widget.dart @@ -4,7 +4,6 @@ import 'package:defyx_vpn/modules/core/log.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; // State class for logs class LogsState { @@ -22,8 +21,17 @@ class LogsState { } // Provider for logs state -class LogsNotifier extends StateNotifier { - LogsNotifier() : super(LogsState()); +class LogsNotifier extends Notifier { + @override + LogsState build() { + ref.onDispose(() => stopAutoRefresh()); + return LogsState(); + } + + void setLogs(List newLogs) { + state = state.copyWith(logs: newLogs); + } + Timer? _refreshTimer; bool _isFetching = false; // Track if a fetch operation is in progress final Set _existingLogs = {}; @@ -115,18 +123,10 @@ class LogsNotifier extends StateNotifier { _refreshTimer = null; } } - - @override - void dispose() { - stopAutoRefresh(); - super.dispose(); - } } // Provider for the logs state -final logsProvider = StateNotifierProvider((ref) { - return LogsNotifier(); -}); +final logsProvider = NotifierProvider(LogsNotifier.new); // A utility widget that can be used to add shake-to-show-logs functionality to any screen class ShakeLogDetector extends ConsumerStatefulWidget { @@ -181,7 +181,7 @@ class _LogPopupContentState extends ConsumerState { if (filteredLogs.isNotEmpty) { logsNotifier._existingLogs.clear(); logsNotifier._existingLogs.addAll(filteredLogs); - logsNotifier.state = logsNotifier.state.copyWith(logs: filteredLogs); + logsNotifier.setLogs(filteredLogs); } } @@ -445,7 +445,7 @@ class _LogScreenState extends ConsumerState { logsNotifier._existingLogs.addAll(filteredLogs); // Update the state with all logs - logsNotifier.state = logsNotifier.state.copyWith(logs: filteredLogs); + logsNotifier.setLogs(filteredLogs); } } diff --git a/lib/modules/speed_test/application/speed_test_provider.dart b/lib/modules/speed_test/application/speed_test_provider.dart index 9b2078d..5e95862 100644 --- a/lib/modules/speed_test/application/speed_test_provider.dart +++ b/lib/modules/speed_test/application/speed_test_provider.dart @@ -1,14 +1,12 @@ import 'dart:async'; import 'dart:math'; import 'package:defyx_vpn/core/network/http_client.dart'; -import 'package:defyx_vpn/core/network/http_client_interface.dart'; import 'package:defyx_vpn/modules/speed_test/data/api/speed_test_api.dart'; import 'package:defyx_vpn/modules/speed_test/models/speed_test_result.dart'; import 'package:defyx_vpn/shared/providers/connection_state_provider.dart'; import 'package:defyx_vpn/shared/services/alert_service.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_riverpod/legacy.dart'; import 'services/cloudflare_logger_service.dart'; import 'services/download_measurement_service.dart'; import 'services/latency_measurement_service.dart'; @@ -65,14 +63,29 @@ class SpeedTestState { } } -final speedTestProvider = StateNotifierProvider((ref) { - final httpClient = ref.read(httpClientProvider); - return SpeedTestNotifier(httpClient, ref); -}); +final speedTestProvider = NotifierProvider(SpeedTestNotifier.new); -class SpeedTestNotifier extends StateNotifier { - final IHttpClient _httpClient; - final Ref _ref; +class SpeedTestNotifier extends Notifier { + @override + SpeedTestState build() { + ref.onDispose(() { + _stopTestOnly(); + _stopConnectionMonitoring(); + }); + final httpClient = ref.read(httpClientProvider); + final dio = (httpClient as HttpClient).dio; + + dio.options.connectTimeout = SpeedMeasurementConfig.connectTimeout; + dio.options.receiveTimeout = SpeedMeasurementConfig.receiveTimeout; + dio.options.sendTimeout = SpeedMeasurementConfig.sendTimeout; + dio.options.headers['User-Agent'] = 'Defyx VPN Speed Test'; + + _api = SpeedTestApi(dio); + _logger = CloudflareLoggerService(_api); + _alertService = AlertService(); + _alertService.init(); + return const SpeedTestState(); + } late final SpeedTestApi _api; late final CloudflareLoggerService _logger; late final AlertService _alertService; @@ -87,31 +100,10 @@ class SpeedTestNotifier extends StateNotifier { final List _uploadSpeeds = []; final List _latencies = []; - SpeedTestNotifier(this._httpClient, this._ref) : super(const SpeedTestState()) { - final dio = (_httpClient as HttpClient).dio; - - dio.options.connectTimeout = SpeedMeasurementConfig.connectTimeout; - dio.options.receiveTimeout = SpeedMeasurementConfig.receiveTimeout; - dio.options.sendTimeout = SpeedMeasurementConfig.sendTimeout; - dio.options.headers['User-Agent'] = 'Defyx VPN Speed Test'; - - _api = SpeedTestApi(dio); - _logger = CloudflareLoggerService(_api); - _alertService = AlertService(); - _alertService.init(); - } - String _generateMeasurementId() { return (Random().nextDouble() * 1e16).round().toString(); } - @override - void dispose() { - _stopTestOnly(); - _stopConnectionMonitoring(); - super.dispose(); - } - void stopAndResetTest() { _isTestCanceled = true; _testTimer?.cancel(); @@ -205,7 +197,7 @@ class SpeedTestNotifier extends StateNotifier { void _startConnectionMonitoring() { _connectionSubscription?.close(); - _connectionSubscription = _ref.listen( + _connectionSubscription = ref.listen( connectionStateProvider, (previous, next) { final status = next.status; From c3725738f09d8c37c0f4b48d2784b97269f31d5b Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Wed, 18 Feb 2026 19:38:48 +0330 Subject: [PATCH 09/10] Update Flutter and Dart SDK version requirements in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff6d119..35121eb 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ A modern, relatively smart, secure, and open-source VPN application built with F ### Prerequisites -- Flutter SDK ≥ 3.7.0 -- Dart SDK ≥ 3.0.0 +- Flutter SDK ≥ 3.32.0 +- Dart SDK ≥ 3.8.0 - Xcode for iOS/macOS development ### 🧑‍💻 How to Set Up From 78e5204b33ae18cb390232a02f8f62586907061f Mon Sep 17 00:00:00 2001 From: Freelancer Alpha 1-1 Date: Wed, 18 Feb 2026 19:43:42 +0330 Subject: [PATCH 10/10] Use dart lang feature instead of if null check --- lib/shared/services/firebase_analytics_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shared/services/firebase_analytics_service.dart b/lib/shared/services/firebase_analytics_service.dart index 38c10e5..95b64d5 100644 --- a/lib/shared/services/firebase_analytics_service.dart +++ b/lib/shared/services/firebase_analytics_service.dart @@ -50,7 +50,7 @@ class FirebaseAnalyticsService { parameters: { 'connection_method': connectionMethod, 'connection_duration_seconds': durationSeconds, - if (server != null) 'server': server, + 'server': ?server, }, ); } catch (e) {