Skip to content

Commit 982d3e6

Browse files
Merge pull request #11 from Bablo-AD/home-launcher
Home launcher
2 parents 0f3e59e + 353ddfa commit 982d3e6

File tree

12 files changed

+549
-73
lines changed

12 files changed

+549
-73
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
33
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
44
<uses-permission android:name="android.permission.INTERNET"/>
5+
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
56
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions" />
67
<application
78
android:label="Bablo"
@@ -25,6 +26,8 @@
2526
/>
2627
<intent-filter>
2728
<action android:name="android.intent.action.MAIN"/>
29+
<category android:name="android.intent.category.HOME" />
30+
<category android:name="android.intent.category.DEFAULT" />
2831
<category android:name="android.intent.category.LAUNCHER"/>
2932
</intent-filter>
3033
</activity>

lib/home/apps_page.dart

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:device_apps/device_apps.dart';
3+
4+
Future<List<Application>> loadApps() async {
5+
List<Application> loaded_apps = await DeviceApps.getInstalledApplications(
6+
includeSystemApps: true,
7+
onlyAppsWithLaunchIntent: true,
8+
);
9+
return loaded_apps;
10+
}
11+
12+
class AppsPage extends StatefulWidget {
13+
const AppsPage({super.key, required this.apps});
14+
final List<Application> apps;
15+
@override
16+
State<AppsPage> createState() => _AppsPageState();
17+
}
18+
19+
class _AppsPageState extends State<AppsPage> {
20+
@override
21+
Widget build(BuildContext context) {
22+
return Scaffold(
23+
appBar: AppBar(
24+
title: const Text('Mentor/Apps',
25+
style: TextStyle(color: Color.fromARGB(255, 50, 204, 102))),
26+
backgroundColor: Colors.black,
27+
),
28+
backgroundColor: Colors.black,
29+
body: Column(children: [
30+
Expanded(
31+
child: ListView.builder(
32+
itemCount: widget.apps.length,
33+
itemBuilder: (context, index) {
34+
final Application app = widget.apps[index];
35+
return Column(children: [
36+
ListTile(
37+
tileColor: Color.fromARGB(255, 19, 19, 19),
38+
onTap: () async {
39+
bool isInstalled =
40+
await DeviceApps.isAppInstalled(app.packageName);
41+
if (isInstalled) {
42+
DeviceApps.openApp(app.packageName);
43+
}
44+
},
45+
title: Text(
46+
app.appName,
47+
style: TextStyle(
48+
fontWeight: FontWeight.bold,
49+
color: Color.fromARGB(255, 50, 204, 102),
50+
),
51+
),
52+
),
53+
SizedBox(
54+
height: 5,
55+
)
56+
]);
57+
}))
58+
]));
59+
}
60+
}

lib/home/chat_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class _ChatPageState extends State<ChatPage> {
108108
title: Text(
109109
message.content,
110110
style: TextStyle(
111-
fontWeight: FontWeight.bold,
112111
color: Color.fromARGB(255, 50, 204, 102),
113112
),
114113
),
@@ -131,6 +130,8 @@ class _ChatPageState extends State<ChatPage> {
131130
color: Color.fromARGB(255, 50, 204, 102),
132131
),
133132
decoration: const InputDecoration(
133+
filled: true,
134+
fillColor: Color.fromARGB(255, 19, 19, 19),
134135
hintStyle: TextStyle(
135136
color: Color.fromARGB(255, 50, 204, 102),
136137
),

0 commit comments

Comments
 (0)