Skip to content

Commit

Permalink
thoda sa tweak :P
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKetan2 committed Jun 6, 2020
1 parent 664b03e commit f38c057
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
Binary file added assets/My Video.mp4
Binary file not shown.
44 changes: 29 additions & 15 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import 'package:device_apps/device_apps.dart';
import 'package:uninstall_apps/uninstall_apps.dart';
import "./apps.dart";

/*
015409614768
1434001500032311
1
013719924617
23/05/86
*/

void main() {
runApp(MyApp());
}
Expand Down Expand Up @@ -45,14 +56,14 @@ class _MyHomePageState extends State<MyHomePage> {
});
}

_unInstallApp(String pkg) async {
_unInstallApp(String pkg, int index) async {
await UninstallApps.uninstall(pkg);
await Future.delayed(Duration(seconds: 2));

if (deviceApps.length == 0) {
setState(() {
_isAwesome = true;
});
}
setState(() {
deviceApps.removeAt(index);
_isAwesome = deviceApps.length == 0;
});
}

_scanForApps() async {
Expand All @@ -65,7 +76,7 @@ class _MyHomePageState extends State<MyHomePage> {
_isLoading = true;
});

await Future.delayed(Duration(seconds: 2));
await Future.delayed(Duration(seconds: 1));

print(apps.length);

Expand All @@ -78,15 +89,16 @@ class _MyHomePageState extends State<MyHomePage> {
}
}

if (tempApps.length == 0) {
setState(() {
_isAwesome = true;
});
}
// if (tempApps.length == 0) {
// setState(() {
// _isAwesome = true;
// });
// }
setState(() {
deviceApps = tempApps;
_isLoading = false;
_isSearched = true;
_isAwesome = deviceApps.length == 0;
});

// print(deviceApps[0].appName);
Expand Down Expand Up @@ -144,7 +156,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
)
: !_isSearched
: !_isSearched && !_isAwesome
? Center(
child: Container(
child: Text(
Expand Down Expand Up @@ -178,8 +190,10 @@ class _MyHomePageState extends State<MyHomePage> {
),
onPressed: () {
_unInstallApp(
deviceApps[index].packageName);
_removeApp(index);
deviceApps[index].packageName,
index,
);
// _removeApp(index);
},
),
);
Expand Down

0 comments on commit f38c057

Please sign in to comment.