notification_troubleshoot 0.0.2+2 copy "notification_troubleshoot: ^0.0.2+2" to clipboard
notification_troubleshoot: ^0.0.2+2 copied to clipboard

Troubleshoot android notification. Launch vendor-specific Activity for fix autostart, power-saving and notification settings

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: FutureBuilder<List<NotificationTroubleshootActions>>(

            /// Get available actions on this device
            future: NotificationTroubleshoot.availableActions,
            builder: (context, state) {
              var data = state.data;
              if (data == null) {
                return CircularProgressIndicator();
              }
              if (data.isEmpty) {
                return Text('No action available');
              }
              return Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  Text('Available actions: \n'),
                  for (final action in data)
                    ListTile(
                      title: Text('${action.toString().split('.')[1]}'),

                      /// Launch vendor-specific Activity
                      onTap: () => NotificationTroubleshoot.startIntent(action),
                      trailing: Icon(
                        Icons.arrow_forward,
                      ),
                    )
                ],
              );
            },
          ),
        ),
      ),
    );
  }
}
8
likes
140
pub points
34%
popularity

Publisher

verified publisherevrone.com

Troubleshoot android notification. Launch vendor-specific Activity for fix autostart, power-saving and notification settings

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on notification_troubleshoot