auto_start_flutter 0.0.1 copy "auto_start_flutter: ^0.0.1" to clipboard
auto_start_flutter: ^0.0.1 copied to clipboard

outdated

A flutter plugin for enabling auto-start for background services in samsung, honor, huawei, xiaomi, oppo, asus , nokia etc. phones. The plugin redirects the user to auto-start permission screen to all [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:auto_start_flutter/auto_start_flutter.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initAutoStart();
  }

  Future<void> initAutoStart() async {
    try {
      var test = await AutoStartFlutter.isAutoStartAvailable;
      print(test);
      if (test) await AutoStartFlutter.getAutoStartPermission();
    } on PlatformException catch (e) {
      print(e);
    }
    if (!mounted) return;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Auto Start Flutter Example'),
        ),
        body: Center(
          child: Text("Auto Start initialize..."),
        ),
      ),
    );
  }
}
57
likes
0
pub points
90%
popularity

Publisher

verified publishertechflow.ir

A flutter plugin for enabling auto-start for background services in samsung, honor, huawei, xiaomi, oppo, asus , nokia etc. phones. The plugin redirects the user to auto-start permission screen to allow auto-start and fix background problems in some phones.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on auto_start_flutter