Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Future<List<List<Widget>>> getDetailList(
- List<int> list, String column) async {
- List<Widget> list1 = List();
- List<Widget> list2 = List();
- List<Widget> list3 = List();
- List<List<Widget>> listFromDB = [list1, list2, list3];
- var databasesPath = await getDatabasesPath();
- String path = join(databasesPath, 'books.db');
- Database database = await openDatabase(path, version: 1);
- for (int i = 0; i < list.length; i++) {
- var result = await database.rawQuery(
- 'SELECT DISTINCT $column FROM planner WHERE id = ${list[i]}');
- list1.add(_item(result[0][column].toString()));
- }
- }
- import 'package:queries/collections.dart';
- void main() {
- List<String> list = ["a", "a", "b", "c", "b", "d"];
- var result = new Collection(list).distinct();
- print(result.toList());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement