aboutsummaryrefslogtreecommitdiff
path: root/lib/pages/Apps.dart
blob: 692ec37d6386ad795fdb987f1033029ff639440c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import 'package:flutter/material.dart';
import 'package:device_apps/device_apps.dart';

import '../components/FixedContainer.dart';
import '../components/SearchableAppList.dart';

import '../data/favorites.dart';

class AppsView extends StatelessWidget {
  void Function(Application) openApp;
  void Function(BuildContext, Application) openOptionsMenu;
  List<Application> appList;
  FocusNode searchFieldFocus;

  AppsView({ this.appList, this.openApp, this.openOptionsMenu, this.searchFieldFocus }): super();

  @override
  Widget build(BuildContext ctx) {
    return FixedContainer(
        padding: const EdgeInsets.symmetric(vertical: 36.0, horizontal: 16.0),
        child: SearchableAppList(
            appList: appList,
            openApp: openApp,
            openOptionsMenu: (app) => openOptionsMenu(ctx, app),
            searchFieldFocus: searchFieldFocus,
        ),
    );
  }
}