new apps load
This commit is contained in:
parent
1c52e249ba
commit
7a1395220c
1 changed files with 4 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -83,12 +84,14 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
List<AppInfo> apps = [];
|
||||
List<AppInfo> filteredApps = [];
|
||||
bool isLoading = true;
|
||||
StreamSubscription<ApplicationEvent>? _appsChangeSub;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_loadInstalledApps();
|
||||
_appsChangeSub = DeviceApps.listenToAppsChanges().listen((_) => _loadInstalledApps());
|
||||
searchController.addListener(_filterApps);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (context.read<AppSettings>().autoFocus) {
|
||||
|
|
@ -100,6 +103,7 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_appsChangeSub?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue