Skip to content

Commit

Permalink
feat: support flutter_svg 2.0.0 (#350)
Browse files Browse the repository at this point in the history
* feat: support flutter_svg 2.0.0

* feat: add lint ignore

* chore: update example pubspec

* chore: build runner exec result

* test: update test resource with svg 2.0.0
  • Loading branch information
lcdsmao authored Feb 4, 2023
1 parent 04e4363 commit 98d8617
Show file tree
Hide file tree
Showing 29 changed files with 147 additions and 136 deletions.
104 changes: 51 additions & 53 deletions examples/example/lib/freezed_sample.freezed.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// 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
// 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

part of 'freezed_sample.dart';

Expand All @@ -25,9 +25,9 @@ mixin _$Union {
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult Function(int value)? $default, {
TResult Function()? loading,
TResult Function(String? message)? error,
TResult? Function(int value)? $default, {
TResult? Function()? loading,
TResult? Function(String? message)? error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
Expand All @@ -47,9 +47,9 @@ mixin _$Union {
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult Function(Data value)? $default, {
TResult Function(Loading value)? loading,
TResult Function(ErrorDetails value)? error,
TResult? Function(Data value)? $default, {
TResult? Function(Loading value)? loading,
TResult? Function(ErrorDetails value)? error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
Expand All @@ -65,40 +65,41 @@ mixin _$Union {
/// @nodoc
abstract class $UnionCopyWith<$Res> {
factory $UnionCopyWith(Union value, $Res Function(Union) then) =
_$UnionCopyWithImpl<$Res>;
_$UnionCopyWithImpl<$Res, Union>;
}

/// @nodoc
class _$UnionCopyWithImpl<$Res> implements $UnionCopyWith<$Res> {
class _$UnionCopyWithImpl<$Res, $Val extends Union>
implements $UnionCopyWith<$Res> {
_$UnionCopyWithImpl(this._value, this._then);

final Union _value;
// ignore: unused_field
final $Res Function(Union) _then;
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
}

/// @nodoc
abstract class _$$DataCopyWith<$Res> {
factory _$$DataCopyWith(_$Data value, $Res Function(_$Data) then) =
__$$DataCopyWithImpl<$Res>;
@useResult
$Res call({int value});
}

/// @nodoc
class __$$DataCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
class __$$DataCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res, _$Data>
implements _$$DataCopyWith<$Res> {
__$$DataCopyWithImpl(_$Data _value, $Res Function(_$Data) _then)
: super(_value, (v) => _then(v as _$Data));

@override
_$Data get _value => super._value as _$Data;
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? value = freezed,
Object? value = null,
}) {
return _then(_$Data(
value == freezed
null == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as int,
Expand All @@ -124,15 +125,15 @@ class _$Data implements Data {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$Data &&
const DeepCollectionEquality().equals(other.value, value));
(identical(other.value, value) || other.value == value));
}

@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(value));
int get hashCode => Object.hash(runtimeType, value);

@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$DataCopyWith<_$Data> get copyWith =>
__$$DataCopyWithImpl<_$Data>(this, _$identity);

Expand All @@ -149,9 +150,9 @@ class _$Data implements Data {
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult Function(int value)? $default, {
TResult Function()? loading,
TResult Function(String? message)? error,
TResult? Function(int value)? $default, {
TResult? Function()? loading,
TResult? Function(String? message)? error,
}) {
return $default?.call(value);
}
Expand Down Expand Up @@ -183,9 +184,9 @@ class _$Data implements Data {
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult Function(Data value)? $default, {
TResult Function(Loading value)? loading,
TResult Function(ErrorDetails value)? error,
TResult? Function(Data value)? $default, {
TResult? Function(Loading value)? loading,
TResult? Function(ErrorDetails value)? error,
}) {
return $default?.call(this);
}
Expand Down Expand Up @@ -220,13 +221,10 @@ abstract class _$$LoadingCopyWith<$Res> {
}

/// @nodoc
class __$$LoadingCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
class __$$LoadingCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res, _$Loading>
implements _$$LoadingCopyWith<$Res> {
__$$LoadingCopyWithImpl(_$Loading _value, $Res Function(_$Loading) _then)
: super(_value, (v) => _then(v as _$Loading));

@override
_$Loading get _value => super._value as _$Loading;
: super(_value, _then);
}

/// @nodoc
Expand Down Expand Up @@ -261,9 +259,9 @@ class _$Loading implements Loading {
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult Function(int value)? $default, {
TResult Function()? loading,
TResult Function(String? message)? error,
TResult? Function(int value)? $default, {
TResult? Function()? loading,
TResult? Function(String? message)? error,
}) {
return loading?.call();
}
Expand Down Expand Up @@ -295,9 +293,9 @@ class _$Loading implements Loading {
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult Function(Data value)? $default, {
TResult Function(Loading value)? loading,
TResult Function(ErrorDetails value)? error,
TResult? Function(Data value)? $default, {
TResult? Function(Loading value)? loading,
TResult? Function(ErrorDetails value)? error,
}) {
return loading?.call(this);
}
Expand Down Expand Up @@ -326,25 +324,25 @@ abstract class _$$ErrorDetailsCopyWith<$Res> {
factory _$$ErrorDetailsCopyWith(
_$ErrorDetails value, $Res Function(_$ErrorDetails) then) =
__$$ErrorDetailsCopyWithImpl<$Res>;
@useResult
$Res call({String? message});
}

/// @nodoc
class __$$ErrorDetailsCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
class __$$ErrorDetailsCopyWithImpl<$Res>
extends _$UnionCopyWithImpl<$Res, _$ErrorDetails>
implements _$$ErrorDetailsCopyWith<$Res> {
__$$ErrorDetailsCopyWithImpl(
_$ErrorDetails _value, $Res Function(_$ErrorDetails) _then)
: super(_value, (v) => _then(v as _$ErrorDetails));

@override
_$ErrorDetails get _value => super._value as _$ErrorDetails;
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? message = freezed,
}) {
return _then(_$ErrorDetails(
message == freezed
freezed == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String?,
Expand All @@ -370,15 +368,15 @@ class _$ErrorDetails implements ErrorDetails {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ErrorDetails &&
const DeepCollectionEquality().equals(other.message, message));
(identical(other.message, message) || other.message == message));
}

@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(message));
int get hashCode => Object.hash(runtimeType, message);

@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$ErrorDetailsCopyWith<_$ErrorDetails> get copyWith =>
__$$ErrorDetailsCopyWithImpl<_$ErrorDetails>(this, _$identity);

Expand All @@ -395,9 +393,9 @@ class _$ErrorDetails implements ErrorDetails {
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult Function(int value)? $default, {
TResult Function()? loading,
TResult Function(String? message)? error,
TResult? Function(int value)? $default, {
TResult? Function()? loading,
TResult? Function(String? message)? error,
}) {
return error?.call(message);
}
Expand Down Expand Up @@ -429,9 +427,9 @@ class _$ErrorDetails implements ErrorDetails {
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult Function(Data value)? $default, {
TResult Function(Loading value)? loading,
TResult Function(ErrorDetails value)? error,
TResult? Function(Data value)? $default, {
TResult? Function(Loading value)? loading,
TResult? Function(ErrorDetails value)? error,
}) {
return error?.call(this);
}
Expand Down
20 changes: 11 additions & 9 deletions examples/example/lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/example/lib/gen/colors.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/example/lib/gen/fonts.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion examples/example/lib/json_serializable_sample.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ part 'json_serializable_sample.g.dart';

@JsonSerializable()
class Person {
final String firstName, lastName;
final String firstName;
final String lastName;
final DateTime? dateOfBirth;

Person({required this.firstName, required this.lastName, this.dateOfBirth});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import FlutterMacOS
import Foundation

import connectivity_plus_macos
import connectivity_plus
import device_info_plus_macos
import flutter_local_notifications
import flutter_secure_storage_macos
Expand Down
18 changes: 9 additions & 9 deletions examples/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ dependencies:
flutter:
sdk: flutter

flutter_svg: 1.0.3
flutter_svg: 2.0.0+1
flare_flutter: 3.0.2
rive: 0.9.1
lottie: 2.0.0

# Dependency check
collection: 1.16.0
collection: 1.17.0
crypto: 3.0.2
glob: 2.0.2

Expand All @@ -43,15 +43,15 @@ dependencies:
flutter_hooks: 0.18.3
hooks_riverpod: 1.0.3
dio: 4.0.6
connectivity_plus: 2.3.0
connectivity_plus: 3.0.2
ua_client_hints: 1.1.0
retrofit: 3.0.1+1
uuid: 3.0.6
http_parser: 4.0.0
protobuf: 2.0.1
json_serializable: 6.2.0
json_annotation: ^4.5.0
freezed_annotation: ^2.1.0
json_serializable: 6.6.1
json_annotation: ^4.8.0
freezed_annotation: ^2.2.0
intl: 0.17.0
fixnum: 1.0.0
shared_preferences: 2.0.13
Expand Down Expand Up @@ -92,10 +92,10 @@ dependencies:
geocoding: 2.0.4
android_intent_plus: 3.1.1
share_plus: 4.0.4
stack_trace: 1.10.0
# stack_trace: 1.10.0
in_app_review: 2.0.4
pull_to_refresh: 2.0.0
xml: 5.4.1
xml: 6.2.2

example_resources:
path: ../example_resources
Expand All @@ -106,7 +106,7 @@ dev_dependencies:
integration_test:
sdk: flutter
build_runner: ^2.1.11
freezed: ^2.1.0+1
freezed: ^2.3.2
flutter_gen_runner: ^5.1.0+1

flutter_lints: ^2.0.1
Expand Down
Loading

0 comments on commit 98d8617

Please sign in to comment.