in ,

Sweetalertv2 for Flutter

sweetalertv2

Sweetalertv2 for flutter.

Messaging systems can be very useful. It allows you to send text messages from one user to one or more other users, delete or cancel or just show the messages. Besides images, attachments are also typically supported. This project will help you very much in getting started with a title or a successful state. Follow the next steps below and check it out. 

Showcases

To begin with sweetalertv2, this is Showcases

sweetalertv2

Getting started

Add dependency

sweetalertv2: any

Usage

Basic usage

1--3-
SweetAlertV2.show(context, title: "Just show a message");

With a subtitle

2--3-
SweetAlertV2.show(context,
	title: "Just show a message",
	subtitle: "Sweet alert is pretty");

With a success state

3--2-
SweetAlertV2.show(context,
	title: "Just show a message",
	subtitle: "Sweet alert is pretty",
	style: SweetAlertV2Style.success);

With a confirm state

4--1-
SweetAlertV2.show(context,
	title: "Just show a message",
	subtitle: "Sweet alert is pretty",
	style: SweetAlertV2Style.confirm,
	showCancelButton: true, onPress: (bool isConfirm) {
		if (isConfirm) {
			SweetAlertV2.show(context,style: SweetAlertV2Style.success,title: "Success");
			// return false to keep dialog
			return false;
        }
	});

Do some job

SweetAlertV2.show(context,
	subtitle: "Do you want to delete this message",
	style: SweetAlertV2Style.confirm,
	showCancelButton: true, onPress: (bool isConfirm) {
		if(isConfirm){
			SweetAlertV2.show(context,subtitle: "Deleting...", style: SweetAlertV2Style.loading);
			new Future.delayed(new Duration(seconds: 2),(){
				SweetAlertV2.show(context,subtitle: "Success!", style: SweetAlertV2Style.success);
			});
		}else{
			SweetAlertV2.show(context,subtitle: "Canceled!", style: SweetAlertV2Style.error);
		}

		// return false to keep dialog
		return false;
	});

Special Thanks

Ultimately, special thanks to best – flutter (Initial project) an important element with us.

  • best-flutter (initial project)

GitHub

https://github.com/brunominervino/sweetalertv2

Written by James

A Dart client for the NATS messaging system

A Flutter Messaging App Light and Dark Theme