Comments (4)
I have never used freezed
, so I would need someone to help me fix this. A PR is welcomed.
from fast_immutable_collections.
I use freezed together with FIC and I don't see thing behavior. I tried your snippet and this is my generated code:
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(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#custom-getters-and-methods');
/// @nodoc
mixin _$MyClass {
IList<int> get numbers => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$MyClassCopyWith<MyClass> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MyClassCopyWith<$Res> {
factory $MyClassCopyWith(MyClass value, $Res Function(MyClass) then) =
_$MyClassCopyWithImpl<$Res, MyClass>;
@useResult
$Res call({IList<int> numbers});
}
/// @nodoc
class _$MyClassCopyWithImpl<$Res, $Val extends MyClass>
implements $MyClassCopyWith<$Res> {
_$MyClassCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@pragma('vm:prefer-inline')
@override
$Res call({
Object? numbers = null,
}) {
return _then(_value.copyWith(
numbers: null == numbers
? _value.numbers
: numbers // ignore: cast_nullable_to_non_nullable
as IList<int>,
) as $Val);
}
}
/// @nodoc
abstract class _$$_MyClassCopyWith<$Res> implements $MyClassCopyWith<$Res> {
factory _$$_MyClassCopyWith(
_$_MyClass value, $Res Function(_$_MyClass) then) =
__$$_MyClassCopyWithImpl<$Res>;
@override
@useResult
$Res call({IList<int> numbers});
}
/// @nodoc
class __$$_MyClassCopyWithImpl<$Res>
extends _$MyClassCopyWithImpl<$Res, _$_MyClass>
implements _$$_MyClassCopyWith<$Res> {
__$$_MyClassCopyWithImpl(_$_MyClass _value, $Res Function(_$_MyClass) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? numbers = null,
}) {
return _then(_$_MyClass(
numbers: null == numbers
? _value.numbers
: numbers // ignore: cast_nullable_to_non_nullable
as IList<int>,
));
}
}
/// @nodoc
class _$_MyClass implements _MyClass {
const _$_MyClass({this.numbers = const IListConst([])});
@override
@JsonKey()
final IList<int> numbers;
@override
String toString() {
return 'MyClass(numbers: $numbers)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$_MyClass &&
const DeepCollectionEquality().equals(other.numbers, numbers));
}
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(numbers));
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$_MyClassCopyWith<_$_MyClass> get copyWith =>
__$$_MyClassCopyWithImpl<_$_MyClass>(this, _$identity);
}
abstract class _MyClass implements MyClass {
const factory _MyClass({final IList<int> numbers}) = _$_MyClass;
@override
IList<int> get numbers;
@override
@JsonKey(ignore: true)
_$$_MyClassCopyWith<_$_MyClass> get copyWith =>
throw _privateConstructorUsedError;
}
Are you on the latest versions of freezed/FIC?
from fast_immutable_collections.
@shtse8 Could you please try the current version 9.1.5 ?
from fast_immutable_collections.
@shtse8 Could you please try the current version 9.1.5 ?
I am confirmed it is working fine on the latest version.
from fast_immutable_collections.
Related Issues (20)
- `averageBy`'s documentation code is that of `sumBy` HOT 1
- Dart Error: error: illegal recursive type 'IMap<C1X0, C1X1>' HOT 2
- IList.update HOT 1
- Resolve warnings pointed out by dart analyzer HOT 9
- Use unsafe immutable collections for JSON parsing HOT 4
- Const constructors? HOT 1
- Add `firstWhereOrNull` method HOT 1
- Incompatible with json_serializable toJson/fromJson: issue _safeKeyFromJson HOT 2
- Can Tuple2 be removed with Dart 3.0 now having Records? HOT 5
- IListConst when empty has not type HOT 3
- Suggestion: Use `@useResult` instead of `@useCopy` (or use both) HOT 1
- IHashMap Implementation HOT 3
- What is the most straightforward way to replace an item on an ISet? HOT 1
- IList `replaceFirstWhere` unnecessary nullable HOT 4
- Best Practices for Mutating Collections Multiple Times HOT 1
- Sliding
- ISet.difference does not always return the correct result HOT 1
- IMap update throw "Null check operator used on a null value" HOT 1
- operations on IList.empty() (and others) do not work when modified HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast_immutable_collections.