패키지, 저장소 및 앱 카테고리 검색

ndialog 표지
패키지 상세v4.5.1

ndialog

NDialog를 사용하면 대화 상자의 스타일을 훨씬 쉽게 맞춤 설정할 수 있으며, 표시 전환을 애니메이션화하거나 진행률 대화 상자를 가장 간단하게 표시할 수 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.7천
좋아요
226
Pub 점수
150

패키지 설치

flutter pub add ndialog

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

NDialog는 고급 스타일 옵션, 부드러운 애니메이션 전환 및 내장된 진행률 대화 상자 지원을 통해 다이얼로그 생성 및 사용자 지정을 간소화하는 Flutter 패키지입니다. 개발자는 여러 플랫폼에서 시각적으로 매력적이고 인터랙티브한 다이얼로그 컴포넌트를 쉽게 구현할 수 있습니다. 최소한의 설정으로 동적 표시/숨기기 애니메이션을 가능하게 하며, 외관과 동작을 사용자 지정하기 위한 깔끔한 API를 제공합니다. 현대적이고 반응형 UI 상호작용을 필요로 하는 앱에 적합합니다.

사용 사례

  • 사용자 지정 대화 상자 스타일
  • 애니메이션 대화 전환
  • 진행률 대화 상자 구현
  • 크로스 플랫폼 다이얼로그 컴포넌트
  • 사용자 피드백 팝업
  • 인터랙티브 온보딩 대화상자

주요 기능

  • 간편한 대화 상자 사용자 지정
  • 부드러운 애니메이션 효과
  • 내장된 진행률 대화상자
  • 다중 플랫폼 지원
  • 최소 구성
  • 유연한 레이아웃 설계

적합한 대상

  • 재사용 가능한 대화 상자를 찾는 Flutter 개발자
  • 애니메이션된 UI 요소가 필요한 앱
  • 자주 사용자 상호작용 프롬프트가 있는 프로젝트
  • 디자인 중심 애플리케이션
  • 빠른 프로토타이핑
  • 모바일 및 웹 앱 인터페이스

고려 사항

  • Flutter 위젯 시스템에 대한 이해가 필요합니다
  • 다이얼로그 전용 사용 사례에 한정
  • 복잡한 레이아웃의 경우 추가 스타일링이 필요할 수 있습니다
  • 대화 상자 외의 UI 컴포넌트에는 적합하지 않습니다
  • 플랫폼 전용 렌더링 동작에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

NDialog 4.x

Fork  Star  Watches

Get the library  Example  Demo  Demo

Customize your dialog's style much easier with NDialog, animate the show transition, or show the progress dialog most simply.

Wonders how the result looks like? Click here for web demo or here for Android APKs demo

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

  NDialog(
    dialogStyle: DialogStyle(titleDivider: true),
    title: Text("NDialog"),
    content: Text("This is NDialog's content"),
    actions: <Widget>[
      TextButton(child: Text("Okay"), onPressed: () => Navigator.pop(context)),
      TextButton(child: Text("Close"), onPressed: () => Navigator.pop(context)),
    ],
  ).show(context);
NAlertDialog

Is a dialog where you can directly set the background attributes without be wrapped by DialogBackground and you can simply display them.

  NAlertDialog(
    dialogStyle: DialogStyle(titleDivider: true),
    title: Text("NAlertDialog"),
    content: Text("This is NAlertDialog's content"),
    actions: <Widget>[
      TextButton(child: Text("Okay"), onPressed: () => Navigator.pop(context)),
      TextButton(child: Text("Close"), onPressed: () => Navigator.pop(context)),
    ],
  ).show(context);
ZoomDialog

Is a dialog that you can zoom on it, you can zoom all type of widget on this dialog, simplye write this code and boom, there you go!

  ZoomDialog(
    zoomScale: 5,
    child: Container(
      child: Text("Zoom me!"),
      color: Colors.white,
      padding: EdgeInsets.all(20),
    ),
  ).show(context);

Progress Dialog

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 message
  await Future.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)
  await Future.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 dialog
  await Future.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)
  await Future.delayed(Duration(seconds: 5));
  progressDialog.setLoadingWidget(null);

  //After 5 seconds, dismiss the dialog
  await Future.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!

  ///ProgressDialog
  ProgressDialog.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));

  ///CustomProgressDialog
  CustomProgressDialog.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 function
  import '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"),
  );
  //or
  Future.delayed(Duration(seconds:3)).showCustomProgressDialog(context);

Dialog Extensions!

You can simply call show(context) at the end of Flutter's built-in dialogs.

  //Make sure you import ndialog to call extensions function
  import 'package:ndialog/ndialog.dart';

  ...

  AlertDialog( ... ).show(context);
  SimpleDialog( ... ).show(context);
  Dialog( ... ).show(context);
  CupertinoAlertDialog( ... ).show(context);

DialogBackground

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!

  DialogBackground(
    blur: 5,
    dialog: AlertDialog(
      title: Text("NAlert Dialog"),
      content: Text("NAlertDialog with Blur background"),
      actions: <Widget>[
        TextButton(child: Text("Okay"), onPressed: () => Navigator.pop(context)),
        TextButton(child: Text("Close"), onPressed: () => Navigator.pop(context)),
      ],
    ),
  ).show(context);

Dialog Transition

Now you can show Dialog(Flutter native dialog included) with animated transition, by simply write

yourDialog.show(context, transitionType: DialogTransitionType.Bubble);

Choose your customized transition and show them right away!

Screenshot

Example

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트