We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regarding the use of SliverReorderableGrid, can you provide a code demo? I have a problem when I use it, I can’t drag, the code is as follows
import 'package:flutter/material.dart'; import 'package:reorderable_grid/reorderable_grid.dart'; void main() => runApp(const MyApp()); class MyApp extends StatefulWidget { const MyApp({Key? key}) : super(key: key); @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { final items = List<int>.generate(40, (index) => index); void _onReorder(int oldIndex, int newIndex) { setState(() { final item = items.removeAt(oldIndex); items.insert(newIndex, item); }); } @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: CustomScrollView( slivers: [ SliverReorderableGrid( itemCount: items.length, itemBuilder: (context, index) => Card( key: ValueKey(index), child: Center( child: Text(index.toString()), ), ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, childAspectRatio: 3 / 5, mainAxisSpacing: 10.0, crossAxisSpacing: 10.0, ), onReorder: _onReorder) ], )), ); } }
The text was updated successfully, but these errors were encountered:
you'll need to wrap your children in a ReorderableGridDragStartListener. You can find more info in the docs.
Sorry, something went wrong.
No branches or pull requests
Regarding the use of SliverReorderableGrid, can you provide a code demo? I have a problem when I use it, I can’t drag, the code is as follows
The text was updated successfully, but these errors were encountered: