dialogx 1.0.0 copy "dialogx: ^1.0.0" to clipboard
dialogx: ^1.0.0 copied to clipboard

Dialogs is a Flutter package that provides an easy way to display dialogs and toasts in your Flutter app. With Dialogs, you can save time and effort by avoiding boilerplate code.

example/lib/main.dart

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

void main() {
  runApp(const MyWidget());
}

class MyWidget extends StatelessWidget {
  const MyWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Builder(
        builder: (context) {
          return Scaffold(
            body: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  ElevatedButton(
                    onPressed: () {
                      context.showModalDialog(
                        builder: (context) => AlertDialog(
                          title: const Text('Alert!'),
                          content: const Text('Something happened!'),
                          actions: [
                            TextButton(
                              onPressed: () {
                                Navigator.pop(context);
                              },
                              child: const Text('OK'),
                            ),
                          ],
                        ),
                      );
                    },
                    child: const Text('Show Alert'),
                  ),
                  ElevatedButton(
                    onPressed: () {
                      context.showToast('Hello World!');
                    },
                    child: const Text('Show Toast'),
                  ),
                ],
              ),
            ),
          );
        },
      ),
    );
  }
}
2
likes
160
points
41
downloads

Publisher

unverified uploader

Weekly Downloads

Dialogs is a Flutter package that provides an easy way to display dialogs and toasts in your Flutter app. With Dialogs, you can save time and effort by avoiding boilerplate code.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dialogx