amplify-flutter icon indicating copy to clipboard operation
amplify-flutter copied to clipboard

Pagination with Datastore

Open gauravdangi opened this issue 5 years ago • 3 comments

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.

gauravdangi avatar Apr 07 '21 06:04 gauravdangi

Adding this line manually solved it for me: import 'package:amplify_datastore_plugin_interface/amplify_datastore_plugin_interface.dart';

anthonymoretti avatar Apr 18 '21 16:04 anthonymoretti

@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

mo-malaka avatar Jun 22 '21 22:06 mo-malaka

@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.

Jordan-Nelson avatar Jun 24 '21 12:06 Jordan-Nelson