Last updated:
0 purchases
get apps
get_apps #
Flutter Plugin to get all installed apps.
Usage #
To use this plugin, add get_apps as a dependency in your pubspec.yaml file.
Example #
import 'package:flutter/material.dart';
import 'package:get_apps/app_info.dart';
import 'package:get_apps/get_apps.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('All Apps'),
),
body: FutureBuilder<List<AppInfo>>(
future: GetApps().getUserApps(),
builder: (context, snapshot) {
if (snapshot.hasData) {
final data = snapshot.requireData;
return ListView(
children: data
.map((e) => ListTile(
onTap: () => GetApps().runExternalApp(e.appPackage),
leading:
Image.memory(e.appIcon), // App Icon Uint8List
title: Text(e.appName), // App Name
subtitle: Text(e.appPackage), //App Package Name
))
.toList(),
);
}
if (snapshot.hasError) {
return Center(
child: Text(snapshot.error.toString()),
);
}
return const Center(
child: CircularProgressIndicator(),
);
},
),
),
);
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.