Skip to content

Show alert dialog or modal action sheet adaptively according to platform.

License

Notifications You must be signed in to change notification settings

Hesham-Dev-LY/adaptive_dialog

 
 

Repository files navigation

adaptive_dialog

Show alert dialog or modal action sheet adaptively according to platform.


Convenient wrapper of showAlertDialog.

iOS Android
n1 n2

Convenient wrapper of showAlertDialog.

iOS Android
n3 n4
n5 n6

Show Confirmation Dialog. For Cupertino, fallback to ActionSheet.

iOS Android
n3 n5
iOS Android
n7 n8
n9 n10
n11 n12
iOS Android
n1 n2
n3 n4

Show text input dialog until answer is correct or cancelled. This is useful for preventing very destructive action is executed mistakenly.

iOS Android
n5 n6

FAQ

The getter modalBarrierDismissLabel was called on null

adaptive_dialog uses Cupertino-style widgets internally on iOS, so GlobalCupertinoLocalizations.delegate is required under certain conditions.

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

class App extends StatelessWidget {
  const App({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      //...
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate, // This is required
      ],
    );
  }
}

The input text color same with backgound when use CupertinoTextInputDialog

This fixes the problem.

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart' hide Router;

class App extends StatelessWidget {
  const App({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      darkTheme: ThemeData(
        cupertinoOverrideTheme: const CupertinoThemeData(
          textTheme: CupertinoTextThemeData(), // This is required
        ),
      ),
    );
  }
}

About

Show alert dialog or modal action sheet adaptively according to platform.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 91.1%
  • Ruby 5.4%
  • Swift 1.7%
  • HTML 1.5%
  • Other 0.3%