flutter_doki 1.0.0+3 copy "flutter_doki: ^1.0.0+3" to clipboard
flutter_doki: ^1.0.0+3 copied to clipboard

PlatformAndroid

Retrive information about the device background killing apps, and show help to the user.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_doki/flutter_doki.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatefulWidget {
  const MainApp({super.key});

  @override
  State<MainApp> createState() => _MainAppState();
}

class _MainAppState extends State<MainApp> {
  DokiResponse? dokiResponse;
  Exception? error;
  void getDokiResponse() async {
    unawaited(Doki().fetch().then((value) {
      setState(() {
        dokiResponse = value;
      });
    }).catchError((e) {
      setState(() {
        error = e;
      });
    }));
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Doki Example'),
        ),
        body: ListView(
          children: [
            TextButton(
                onPressed: () {
                  Doki().open(appName: 'com.example.app');
                },
                child: Text('Open in Webbrowser')),
            TextButton(
                onPressed: getDokiResponse, child: Text('Get Doki Response')),
            SizedBox(
              height: 100,
              child: Center(
                child: DokiBadgeWidget(
                  type: BadgeType.square,
                ),
              ),
            ),
            SizedBox(height: 16),
            SizedBox(
              height: 100,
              child: Center(
                child: DokiBadgeWidget(
                  type: BadgeType.rectangle,
                ),
              ),
            ),
            SizedBox(height: 16),
          ],
        ),
      ),
    );
  }
}
2
likes
160
points
121
downloads
screenshot

Publisher

verified publisherzoocityboy.space

Weekly Downloads

Retrive information about the device background killing apps, and show help to the user.

Homepage
Repository (GitHub)
View/report issues

Topics

#android #dontkillmyapp #doki

Documentation

API reference

License

MIT (license)

Dependencies

device_info_plus, flutter, http, url_launcher

More

Packages that depend on flutter_doki