android_autostart 0.0.3 android_autostart: ^0.0.3 copied to clipboard
You can request to enable AutoStart with Android AutoStart. Many Developers need to access AutoStart Setting Flutter including me, but there's no good plugin yet for autostart.So I decided to make Aut [...]
import 'package:flutter/material.dart';
import 'package:android_autostart/android_autostart.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState 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('Enable AutoStart Example App'),
),
body: Center(
child: Column(
children: [
ElevatedButton(
onPressed: () async =>
await AndroidAutostart.navigateAutoStartSetting,
child: Text("Navigate AutoStart Setting"),
),
ElevatedButton(
onPressed: () async =>
await AndroidAutostart.customSetComponent(
manufacturer: "xiaomi",
pkg: "com.miui.securitycenter",
cls:
"com.miui.permcenter.autostart.AutoStartManagementActivity",
),
child: Text("Custom Set Component"),
),
],
),
),
),
);
}
}