From 8c5b32a35f37bd0190b34ee0beb6be6008c31ec1 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 7 Jun 2023 10:11:09 +0200 Subject: [PATCH] neon_notes: Fix casting error when loading notes --- packages/neon/neon_notes/lib/blocs/notes.dart | 4 ++-- packages/neon/neon_notes/lib/neon_notes.dart | 1 + packages/neon/neon_notes/pubspec.yaml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/neon/neon_notes/lib/blocs/notes.dart b/packages/neon/neon_notes/lib/blocs/notes.dart index a1cffee0..d4a9caa2 100644 --- a/packages/neon/neon_notes/lib/blocs/notes.dart +++ b/packages/neon/neon_notes/lib/blocs/notes.dart @@ -46,12 +46,12 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta @override Future refresh() async { - await requestManager.wrapNextcloud, Iterable>( + await requestManager.wrapNextcloud, BuiltList>( client.id, 'notes-notes', notes, () async => client.notes.getNotes(), - (final response) => response.toList(), + List.from, ); } diff --git a/packages/neon/neon_notes/lib/neon_notes.dart b/packages/neon/neon_notes/lib/neon_notes.dart index c3bf0383..2ca34cfb 100644 --- a/packages/neon/neon_notes/lib/neon_notes.dart +++ b/packages/neon/neon_notes/lib/neon_notes.dart @@ -3,6 +3,7 @@ library notes; import 'dart:async'; import 'dart:convert'; +import 'package:built_collection/built_collection.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; diff --git a/packages/neon/neon_notes/pubspec.yaml b/packages/neon/neon_notes/pubspec.yaml index 9da7ff85..17cf26ee 100644 --- a/packages/neon/neon_notes/pubspec.yaml +++ b/packages/neon/neon_notes/pubspec.yaml @@ -7,6 +7,7 @@ environment: flutter: '>=3.10.0' dependencies: + built_collection: ^5.1.1 crypto: ^3.0.3 flutter: sdk: flutter