Pagination with Datastore
Describe the bug As given in the documentation, the following statement should be used for performing pagination.
List<Post> posts = await Amplify.DataStore.query(Post.classType,
pagination: new QueryPagination(page:0, limit:100));
But I'm getting The name 'QueryPagination' isn't a class. Try correcting the name to match an existing class. error. I can't find any suggested import too. How can we implement pagination with Datastore?
Expected behavior Should be able to implement pagination.
Adding this line manually solved it for me:
import 'package:amplify_datastore_plugin_interface/amplify_datastore_plugin_interface.dart';
@gauravdangi Thanks for reporting this.
As per @anthonymoretti you need to add
import 'package:amplify_datastore_plugin_interface/amplify_datastore_plugin_interface.dart';
We will update the doc for this
@offlineprogrammer I think we should consider exporting this from amplify_datastore so that consumers of the package don't have to import from a package that they do not directly depend on. I would consider importing from the interface package a workaround but not a permanent solution.