last day (15 days later) » 

13:23
0
Q: FutureBuilder not showing News list tile

Fred_WolfeI am trying to show the Fetch Items via the News List tile in my app project, but it seems no data is showing. it is still stuck on 'Streams still loading' and I don't know what is going on. so I will present all the relevant classes. This is the stories bloc and Stories Provider class. import 'p...

what do you see if you add print(snapshot); before line if (!snapshot.hasData) { ?
I have edited my question to add the print statement at the end.
as you can see: AsyncSnapshot<Map<int, Future<ItemModel?>>>(ConnectionState.active, null, type 'Future<ItemModel?>' is not a subtype of type 'Future<ItemModel>' of 'value', #0 _LinkedHashMapMixin.[]= (dart:collection-patch/compact_hash.dart:513:30) you have an error in your stream - it is stored in snapshot.error, also in the log you posted you can see the exact code location where it occurred (also available with snapshot.stackTrace)
I still don't get it
StoriesBloc._itemsTransformer.<anonymous closure> (package:new_flutter/src/blocs/stories_bloc.dart:32:14) - the error occurred in file blocs/stories_bloc.dart, line 32 column 14
13:23
are you willing to help me out or stress me more? cause I am really looking for a solution here and you pointing out more errors. I have reviewed that line of code and corrected, it gets worse.so if you really know what I need, why don't you solve it and show it to me
how can i say anything if i even dont know what is the line number 32 in blocs/stories_bloc.dart?
did you read my entire question and the codes that followed?, I pasted stories bloc class over there and that line is the function _itemsTransformer
done that... still giving me these insane errors: Instance of 'Future<ItemModel?>', 42098471: Instance of 'Future<ItemModel?>', 42137527: Instance of 'Future<ItemModel?>', 42106368: Instance of 'Future<ItemModel?>', 42089611: Instance of 'Future<ItemModel?>', 42141587: Instance of 'Future<
and this one : E/flutter (17949): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DatabaseException(UNIQUE constraint failed: Items.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)) sql 'INSERT INTO Items (id, type, "by", time, text, parent, url, score, title, descendants, dead, deleted, kids) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' args [0, , , 0, , 0, , 0, , 0, 0, 0, []] E/flutter (17949): #0 wrapDatabaseException (package:sqflite_platform_interface/src/platform_exception.d‌​art:12:7) E/flutter (17949): <asynchronous suspension>
forget bout .pipe() it has nothing to do with the error. it only takes the stream subscription and points it to a target destination. I have done something but I have now moved from one progress to another with errors.
what does Repository.fetchItems() return?
which class are you referring to
Repository.fetchItems what type does it return?
13:23
I have added that entire class so you look at it. but it fetches the items from the item model class
write a small test code like this: pastebin.com/1AzKZAjg and call it StoriesBloc().foo() - here if bar returns Future<ItemModel> it crashes the same way your code does, but if you change the return type to Future<ItemModel?> it works fine - in your case replace bar with your Repository.fetchitems and use your ItemModel of course
dude you and chatgpt are given me a migraine at this point
no offense, but I am tired
13:51
sure, no problem

last day (15 days later) »