Passen Sie den Stil Ihres Dialogs mit NDialog viel einfacher an, animieren Sie den Anzeigetransitionsvorgang oder zeigen Sie den Fortschrittsdialog am einfachsten an.
Aus öffentlichen Paketdaten erstellte Orientierung.
NDialog ist ein Flutter-Paket, das die Erstellung und Anpassung von Dialogen mit erweiterten Gestaltungsoptionen, fließenden Animationsübergängen und integrierter Unterstützung für Fortschrittsdialoge vereinfacht. Es ermöglicht Entwicklern, visuell ansprechende und interaktive Dialogkomponenten auf mehreren Plattformen einfach zu implementieren. Mit minimalem Setup ermöglicht NDialog dynamische Ein-/Ausblendetanimationen und bietet eine saubere API zur Anpassung von Aussehen und Verhalten. Ideal für Apps, die moderne, reaktive UI-Interaktionen erfordern.
Anwendungsfälle
Benutzerdefinierte Dialoggestaltung
Animierte Dialogübergänge
Fortschrittsdialogimplementierung
Plattformübergreifende Dialogkomponenten
Benutzerfeedback-Popups
interaktive Onboarding-Dialoge
Hauptmerkmale
Einfache Dialoganpassung
Glatte Animationseffekte
Eingebauter Fortschrittsdialog
Multiplattform-Unterstützung
Minimale Konfiguration
flexibles Layout-Design
Geeignet für
Flutter-Entwickler, die wiederverwendbare Dialoge suchen
Apps, die animierte Benutzeroberflächenelemente benötigen
Projekte mit häufigen Benutzerinteraktionsaufforderungen
designorientierte Anwendungen
Schnellprototypen
Mobile- und Web-App-Oberflächen
Hinweise
Erfahrung mit dem Widget-System von Flutter erforderlich
Beschränkt auf dialogspezifische Anwendungsfälle
Für komplexe Layouts kann zusätzliche Stilisierung erforderlich sein
Nicht geeignet für nicht-dialogbasierte Benutzeroberflächenkomponenten
Abhängig von plattformspezifischen Renderverhalten
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
NDialog 4.x
Customize your dialog's style much easier with NDialog, animate the show transition, or show the progress dialog most simply.
Anyway, not only helps you display a dialog with a blurred background, NDialog is here to help you do a lot of things. for example, with NDialog you can display ProgressDialog to the user once until it meets the end of Future!
First of all, let's leave the old style with showDialog(...), with NDialog I provide dialog extensions, you can simply call .show(context) at the end of all of your dialog and let the magic work!
There are 2 types of dialogs, they are Dialog (popup dialog) and ProgressDialog
Dialog
In Dialog, there are 3 types, they are NDialog, NAlertDialog, ZoomDialog.
NDialog
Is a raw dialog where you can view them right away without anything else
In ProgressDialog, there are 2 types, they are ProgressDialog and CustomProgressDialog.
ProgressDialog
Will display the ProgressDialog with Android native style.
ProgressDialog progressDialog = ProgressDialog(
context,
blur: 10,
title: Text("Title of ProgressDialog"),
message: Text("Content of ProgressDialog"),
onDismiss: () => print("Do something onDismiss"),
);
progressDialog.show();
//Set loading with red circular progress indicator and change the title and messageawaitFuture.delayed(Duration(seconds: 5));
progressDialog.setLoadingWidget(CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.red)));
progressDialog.setTitle(Text("ProgressDialog Title changed"));
progressDialog.setMessage(Text("It will change again after 5 seconds"));
//Show dialog
progressDialog.show();
//After 5 seconds, change the title, message and loading widget to null (default widget is CircularProgressIndicator)awaitFuture.delayed(Duration(seconds: 5));
progressDialog.setLoadingWidget(null);
progressDialog.setMessage(Text("ProgressDialog will dismiss after 5 seconds"));
progressDialog.setTitle(Text("Last changes"));
//After 5 seconds, dismiss the dialogawaitFuture.delayed(Duration(seconds: 5));
progressDialog.dismiss();
CustomProgressDialog
Will display a progress dialog with customizable widgets
CustomProgressDialog progressDialog = CustomProgressDialog(
context,
blur: 10,
onDismiss: () => print("Do something onDismiss"),
);
//Set loading with red circular progress indicator
progressDialog.setLoadingWidget(CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.red)));
//Show dialog
progressDialog.show();
//After 5 seconds, change the loading widget to null (default widget is CircularProgressIndicator)awaitFuture.delayed(Duration(seconds: 5));
progressDialog.setLoadingWidget(null);
//After 5 seconds, dismiss the dialogawaitFuture.delayed(Duration(seconds: 5));
progressDialog.dismiss();
Show Progress Dialog Once with .future()
This is what I'm talking about, Each Progress Dialog has a .future(context) static function, which will help you display the progress dialog once until Future is completed!
///ProgressDialogProgressDialog.future(
context,
title: Text("ProgressDialog.future()"),
message: Text("This will finis after 5 seconds"),
future: Future.delayed(Duration(seconds: 5), () => "The end of future (5 seconds)"),
onProgressError: (error) => print("Do something onProgressError"),
onProgressFinish: (data) => print("Do something onProgressFinish"),
onDismiss: () => print("Dismissed"),
).then((value) => print(value));
///CustomProgressDialogCustomProgressDialog.future(
context,
future: Future.delayed(Duration(seconds: 5), () => "The end of future (5 seconds)"),
onProgressError: (error) => print("Do something onProgressError"),
onProgressFinish: (data) => print("Do something onProgressFinish"),
onDismiss: () => print("Dismissed"),
).then((value) => print(value));
Future Extensions
Now you can show a dialog on every futures by simply add a single code.
//Make sure you import ndialog to call extensions functionimport'package:ndialog/ndialog.dart';
...
Future.delayed(Duration(seconds: 3)).showProgressDialog(
context,
title: Text("Title of ProgressDialog"),
message: Text("This dialog will be close after 3 seconds"),
);
//orFuture.delayed(Duration(seconds:3)).showCustomProgressDialog(context);
Dialog Extensions!
You can simply call show(context) at the end of Flutter's built-in dialogs.
You can use DialogBackground to create your own custom dialog and display them easily, you can also change the barrierColor / background color and add little bit blur effects there.
Note : BlurDialogBackground is depreceted, use DialogBackground instead!