Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Future<List<List<Widget>>> getDetailList(
  2. List<int> list, String column) async {
  3.  
  4. List<Widget> list1 = List();
  5. List<Widget> list2 = List();
  6. List<Widget> list3 = List();
  7.  
  8. List<List<Widget>> listFromDB = [list1, list2, list3];
  9. var databasesPath = await getDatabasesPath();
  10. String path = join(databasesPath, 'books.db');
  11. Database database = await openDatabase(path, version: 1);
  12. for (int i = 0; i < list.length; i++) {
  13.  
  14. var result = await database.rawQuery(
  15. 'SELECT DISTINCT $column FROM planner WHERE id = ${list[i]}');
  16.  
  17. list1.add(_item(result[0][column].toString()));
  18. }
  19. }
  20.  
  21. import 'package:queries/collections.dart';
  22.  
  23. void main() {
  24. List<String> list = ["a", "a", "b", "c", "b", "d"];
  25. var result = new Collection(list).distinct();
  26. print(result.toList());
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement