From c285f8e733d448555209f95fd76eedbeef5d9e24 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 2 Jun 2020 22:17:22 +0530 Subject: Adds application list component in apps view --- lib/pages/Apps.dart | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'lib/pages/Apps.dart') diff --git a/lib/pages/Apps.dart b/lib/pages/Apps.dart index 3322c0b..7252aae 100644 --- a/lib/pages/Apps.dart +++ b/lib/pages/Apps.dart @@ -1,9 +1,33 @@ import 'package:flutter/material.dart'; +import 'package:device_apps/device_apps.dart'; + +import '../components/FixedContainer.dart'; +import '../components/SearchableAppList.dart'; class AppsView extends StatelessWidget { + Future> appListF = DeviceApps.getInstalledApplications( + includeSystemApps: false, + onlyAppsWithLaunchIntent: true, + ); + + void openApp(Application app) { + DeviceApps.openApp(app.packageName); + } + + void openOptionsMenu(Application app) { + debugPrint('Wow'); + } + @override Widget build(BuildContext ctx) { - return Text('Apps'); + return FixedContainer( + padding: const EdgeInsets.symmetric(vertical: 36.0, horizontal: 16.0), + child: SearchableAppList( + appListF: appListF, + openApp: openApp, + openOptionsMenu: openOptionsMenu, + ), + ); } } -- cgit v1.3.1