Skip to content

Shouldn't BuiltMap<String, BuiltSet<int>> work out of the box? #263

Open
@larssn

Description

@larssn

So this throws a DeserializationError.

@nullable
BuiltMap<String, BuiltSet<int>> get entries;

Using this raw data: [wv8P7YM21ryHwcvtCoGR, [688, 689, 690, 691, 692, 693, 694, 695, 696, 697]]

Thought it was supported.
Also tried making a custom builder factory for it, like the error message suggests - same error.

Any hints?

EDIT:
This is auto-generated in serializers.g.dart:

..addBuilderFactory(
          const FullType(BuiltMap, const [
            const FullType(String),
            const FullType(BuiltSet, const [const FullType(int)])
          ]),
          () => new MapBuilder<String, BuiltSet<int>>())

Looks correct? Doesn't work

The exception message:

══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════
I/flutter (17084): The following DeserializationError was thrown:
I/flutter (17084): 'Turnover' failed due to: Deserializing '[wv8P7YM21ryHwcvtCoGR, [688, 689, 690, 691, 692, 693, 694,
I/flutter (17084): 695, 696, 697]]' to 'BuiltMap<String, BuiltSet<int>>' failed due to: Deserializing '[688, 689, 690,
I/flutter (17084): 691, 692, 693, 694, 695, 696, 697]' to 'BuiltSet<int>' failed due to: Bad state: No builder factory
I/flutter (17084): for BuiltSet<int>. Fix by adding one, see SerializersBuilder.addBuilderFactory.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions