Status Alert for Flutter

Overview

Status Alert for Flutter

Pub Version

Installing:

In your pubspec.yaml

dependencies:
  status_alert: ^1.0.0
import 'package:status_alert/status_alert.dart';

Basic Usage:

    StatusAlert.show(
      context,
      duration: Duration(seconds: 2),
      title: 'Title',
      subtitle: 'Subtitle',
      configuration: IconConfiguration(icon: Icons.done),
    )


Apple Podcasts vs Status Alert:


License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details

Comments
  • type 'Color' is not a subtype of type 'bool'

    type 'Color' is not a subtype of type 'bool'

    I had to fix this by putting brackets around the ternary operator - not sure but it looks like the ternary operator has higher precedence than the ?? operator causing this error

    widget.subtitleOptions.style.color ?? Theme.of(context).brightness == Brightness.light ? lightAccent : darkAccent
    

    Should read

    widget.subtitleOptions.style.color ?? (Theme.of(context).brightness == Brightness.light ? lightAccent : darkAccent)
    

    Notice the brackets added to the ternary operator to fix the issue

    opened by Paul-Todd 3
  • Type 'Color' is not a subtype of type 'bool' (Color Icon)

    Type 'Color' is not a subtype of type 'bool' (Color Icon)

    Background color fix in version 0.13.

    My question : configuration : IconConfiguration( Icon : icons.done, (success) (Add) color: Colors.white (error colors not type bool) ) How to change color icon? Thanks

    opened by faridistiqlal 2
  • Error: Cannot run with sound null safety, because the following dependencies

    Error: Cannot run with sound null safety, because the following dependencies

    Error: Cannot run with sound null safety, because the following dependencies don't support null safety:

    • package:status_alert
    • package:flare_flutter
    • package:flare_dart

    For solutions, see https://dart.dev/go/unsound-null-safety

    FAILURE: Build failed with an exception.

    • Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005

    • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

    Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 1m 47s Exception: Gradle task assembleDebug failed with exit code 1

    opened by anushkapubudu 1
  • Dismiss popup on touch

    Dismiss popup on touch

    How do we make the popup dismiss itself on touch registered anywhere on the screen and at the same time make the rest of the screen inactive while the popup is alive?

    opened by fardeen9983 1
  • How to run StatusAlert.show() in background

    How to run StatusAlert.show() in background

    I want to display a alert notification using StatusAlert.show(.........) in Flutter.The problem is I can run it foreground(it can be shown only over the current build context) but I want to run the StatusAlert's notification in background.The Alert is actually called when a countdown timer reaches zero.Can anyone suggest me how.

    import 'package:android_alarm_manager/android_alarm_manager.dart'; import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:intl/intl.dart'; import 'package:flushbar/flushbar.dart'; import 'package:status_alert/status_alert.dart'; import 'CommonPicker.dart'; import 'fileUtils.dart'; import 'package:firebase_messaging/firebase_messaging.dart';

    Future myBackgroundMessageHandler(Map<String, dynamic> message) { if (message.containsKey('data')) { // Handle data message final dynamic data = message['data']; }

    if (message.containsKey('notification')) { // Handle notification message final dynamic notification = message['notification']; }

    // Or do other work. }

    void status_bar() {

    StatusAlert.show( context, blurPower: 0.1, duration: Duration(seconds: 5), title: 'Hey', subtitle: 'Message:XXXXXXXXXXXXXXXXXXXXXXXXXX ', configuration: IconConfiguration(icon: Icons.warning), ); } // //FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); // //initializeNotification()async { // var initializeAndroid = AndroidInitializationSettings( // 'ic_launcher'); // var initializeIOS = IOSInitializationSettings(); // var initSettings = InitializationSettings(initializeAndroid, initializeIOS); // await flutterLocalNotificationsPlugin.initialize(initSettings); //} // //Future singleNotification(DateTime dateTime,String message,String subtext,int hashcode,{String sound}) async { // var androidChannel = AndroidNotificationDetails( // 'channel-id', 'channel-name', 'channel-description', // importance: Importance.Max, priority: Priority.Max,enableVibration: true,visibility:NotificationVisibility.Public ); // var iosChannel = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails(androidChannel, iosChannel); // await flutterLocalNotificationsPlugin.show(0, message, subtext, platformChannelSpecifics,); //}

    Future callback() async { print("I am in the isolate");

    // DateTime now=DateTime.now().toLocal();

    status_bar();

    // await singleNotification(now, "notification" , "This is the message", 98123871); print("last line of Isolate"); }

    class AlertTime2 extends StatefulWidget { static const routeName = '/alertTime2';

    @override _AlertTime2State createState() => _AlertTime2State(); }

    class _AlertTime2State extends State { String mm = "00"; String ss = "00"; var mmValue; var ssValue; var totalTimeInSec; Flushbar flush; String _selectedTime;

    final FirebaseMessaging _messaging = FirebaseMessaging();

    @override void initState() { super.initState();

    //initializeNotification();
    
    _messaging.getToken().then((token) {
      print("token is :" + token);
    });
    
    FileUtils().readFromFile().then((String value) {
      setState(() {
        _selectedTime = value;
      });
    });
    

    }

    // ignore: non_constant_identifier_names void display_flush_bar() { Future.delayed(Duration(seconds: totalTimeInSec), () { setState(() { flush = Flushbar( title: "Hey", message: "XXXXXXXXXXXXXXXXXXXXxx", duration: Duration(seconds: 5), isDismissible: true, icon: Icon( Icons.warning, color: Colors.red, ), dismissDirection: FlushbarDismissDirection.HORIZONTAL, mainButton: FlatButton( onPressed: () { flush.dismiss(true); }, child: Text( "CANCEL", style: TextStyle(color: Colors.amber), ), ), )..show(context); }); }); }

    void alarm_managing_function(int t) async { await AndroidAlarmManager.initialize(); await AndroidAlarmManager.periodic(Duration(seconds: t), 0, callback); }

    @override Widget build(BuildContext context) { return Scaffold( body: Column( children: [ Padding( padding: const EdgeInsets.fromLTRB(30, 70, 0, 0), child: Text( "Timer for Notification", style: TextStyle( fontSize: 50, ), ), ), Padding( padding: const EdgeInsets.fromLTRB(0, 150, 0, 0), child: Text( "MM-SS", style: TextStyle( fontSize: 30, fontWeight: FontWeight.bold, ), ), ), Padding( padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), child: Text( "${_selectedTime ?? 'Selected Time'}", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38), ), ), RaisedButton( onPressed: () { DatePicker.showPicker(context, showTitleActions: true, pickerModel: CustomPicker(currentTime: DateTime.tryParse(_selectedTime)), onConfirm: (time) { setState(() { print(time); _selectedTime = DateFormat("mm-ss").format(time); FileUtils().saveToFile(_selectedTime);

                mm = _selectedTime.substring(0, 2);
                ss = _selectedTime.substring(3, 5);
                print(mm);
                print(ss);
                mmValue = int.parse(mm);
                ssValue = int.parse(ss);
                totalTimeInSec = mmValue * 60 + ssValue;
                print(totalTimeInSec);
    
                display_flush_bar();
                alarm_managing_function(totalTimeInSec);
              });
            }, locale: LocaleType.en);
          },
          child: Text("Show Time picker"),
        ),
      ],
    ));
    

    } }

    opened by Chethansmash7 1
Owner
Yako
Great mobile apps with Flutter
Yako
Status Stepper: Use this package for showing status changing

status_stepper Use this package for showing status changing. For now available o

Progressive Mobile 0 Jan 11, 2022
A wrapper on top of alert dialog provided by flutter.

material_dialog A wrapper on top of alert dialog provided by flutter. Demo Use this package as a library 1. Depend on it Add this to your package's pu

Zubair Rehman 28 Aug 8, 2022
Flutter Dropdown Alert help to notify to user when success, warning or error like push notification

flutter_dropdown_alert A dropdown alert package for flutter Dropdown alert will help to notify to user when you call api success, error or something l

Tuan Van Le 12 Dec 17, 2022
Animated dialog box - A pure dart package for showing animated alert box.

animated_dialog_box A pure dart package for showing animated alert box. Getting Started https://github.com/Shubham-Narkhede/animated_dialog_box/blob/m

Shubham-Narkhede 10 Jul 24, 2022
Adaptive dialog - Show alert dialog or modal action sheet adaptively according to platform.

adaptive_dialog Show alert dialog or modal action sheet adaptively according to platform. showOkAlertDialog Convenient wrapper of showAlertDialog. iOS

Masayuki Ono (mono) 244 Dec 17, 2022
This example uses a ScrollView, JSON Rest API, Navigation, Alert Pop Up, Progress Indicator, Globals, Images in a shared asset folder, and 100% Shared Code

This example uses a ScrollView, JSON Rest API, Navigation, Alert Pop Up, Progress Indicator, Globals, Images in a shared asset folder, and 100% Shared Code. Now with the ability to login with FaceID, TouchID, and Fingerprint Reader on Android.

Rody Davis 672 Jan 6, 2023
A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app

A most easily usable Flutter widget about application version check! 1. About 1.

Kato Shinya 1 Dec 16, 2021
Cloud storage status

cloud_storage_status Get me a coffee: Bitcoin Address: 1DiFn7B9APaQJKfYAKqesnGM2eVM1MW6U Ethereum Address: 0xAdc43dadbE2b64DC9ba1c8766764F7cD4a2Fa915

Cybdom 38 Jul 23, 2021
null 1 Jan 20, 2022
Connection Notifier - A simple way to notify your user about the connection status.

Connection Notifier A simple way to notify your user about the connection status. Basic Usage: ConnectionNotifier class MyApp extends StatelessWidget

haptome 0 Apr 30, 2022
šŸ†™šŸš€ Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in

???? Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in (with notice bar progress), supports full upgrade, hot update and incremental upgrade

PengHui Li 344 Dec 30, 2022
ABC of Flutter widgets. Intended for super beginners at Flutter. Play with 35+ examples in DartPad directly and get familiar with various basic widgets in Flutter

Basic Widgets Examples This is aimed for complete beginners in Flutter, to get them acquainted with the various basic widgets in Flutter. Run this pro

Pooja Bhaumik 815 Jan 3, 2023
Minha primeira aplicaĆ§Ć£o android utilizando Flutter feito no curso de Flutter da Cod3r Cursos Online. O foco dessa aplicaĆ§Ć£o foi um contato inicial com o Flutter.

expenses Expenses Ć© uma aplicaĆ§Ć£o android simples feita em Flutter para controlar despesas pessoais. A aplicaĆ§Ć£o consiste em: Listar transaƧƵes feitas

Guilherme Teixeira Ais 2 Apr 19, 2022
Flutter Github Following Application, Using Flutter Provider and Flutter HTTP to get data from Github API.

Flutter Github Following Application Watch it on Youtube Previous Designs Checkout my Youtube channel Installation Please remember, after cloning this

Mohammad Rahmani 110 Dec 23, 2022
Flutter RSS feed parsing - A demo application of flutter which parse RSS XML contents to the flutter application

Flutter RSS feed parsing demo This is demo application of flutter which shows ho

Nyakuri Levite 3 Nov 15, 2022
Boris Gautier 1 Jan 31, 2022
Code for Flutter Talk from Flutter Vikings 2022: Custom User Interactions in Flutter

Custom User Interactions - Flutter Vikings 2022 A companion app for the Flutter Vikings 2022 talk - Custom User Interactions with Shortcuts, Intents,

Justin McCandless 9 Sep 16, 2022
Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI 1/2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Fl

Johannes Milke 46 Dec 6, 2022
Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flutter app.

Flutter Tutorial - User Profile Page UI #2 Create a Flutter User Profile Page UI where you can access and edit your user's information within your Flu

Johannes Milke 45 Dec 15, 2022