diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-02 22:17:22 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-02 22:17:22 +0530 |
| commit | c285f8e733d448555209f95fd76eedbeef5d9e24 (patch) | |
| tree | e28137a9fa79ba4c8e721df9877d0ee4671f4973 /lib/components/AppList.dart | |
| parent | c60b58a16662fb33121e94b05cc1c868d8f3f16d (diff) | |
| download | daft-launcher-c285f8e733d448555209f95fd76eedbeef5d9e24.tar.gz daft-launcher-c285f8e733d448555209f95fd76eedbeef5d9e24.zip | |
Adds application list component in apps view
Diffstat (limited to 'lib/components/AppList.dart')
| -rw-r--r-- | lib/components/AppList.dart | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/components/AppList.dart b/lib/components/AppList.dart index e69de29..5b54b04 100644 --- a/lib/components/AppList.dart +++ b/lib/components/AppList.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; +import 'package:device_apps/device_apps.dart'; + +class AppList extends StatelessWidget { + List<Application> appList; + void Function(Application) openApp; + void Function(Application) openOptionsMenu; + + AppList({ this.appList, this.openApp, this.openOptionsMenu }): super(); + + @override + Widget build(BuildContext ctx) { + return ListView.builder( + itemCount: appList.length, + itemBuilder: (ctx, index) { + Application app = appList[index]; + return Column( + children: [ + ListTile( + contentPadding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0), + dense: true, + title: Text('${app.appName}', style: const TextStyle(fontSize: 16)), + onTap: () => openApp(app), + onLongPress: () => openOptionsMenu(app), + ), + Divider(height: 1.0), + ], + ); + }, + ); + } +} + |
