h_alert_dialog 0.0.1 copy "h_alert_dialog: ^0.0.1" to clipboard
h_alert_dialog: ^0.0.1 copied to clipboard

outdated

flutter alert dialog package to show custom alert dialog box easly and fast

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'flutter example screen',
      home: ExampleScreen(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            MaterialButton(
              onPressed: () {
                HAlertDialog.showCustomAlertBox(
                  context: context,
                  backgroundColor: Colors.green,
                  title: 'Success',
                  description:
                      'This is the message that will appear in case of success',
                  icon: Icons.done,
                  iconSize: 32,
                  iconColor: Colors.green,
                  titleFontFamily: 'Raleway',
                  titleFontSize: 22,
                  titleFontColor: Colors.black54,
                  descriptionFontFamily: 'Raleway',
                  descriptionFontColor: Colors.black45,
                  descriptionFontSize: 18,
                  timerInSeconds: 2,
                );
              },
              child: const Text('Show Success Message'),
            ),
            MaterialButton(
              onPressed: () {
                HAlertDialog.showCustomAlertBox(
                  context: context,
                  backgroundColor: Colors.red,
                  title: 'Error',
                  description:
                      'This is the message that will appear in case of Error',
                  icon: Icons.error_outline,
                  iconSize: 32,
                  iconColor: Colors.red,
                  titleFontFamily: 'Raleway',
                  titleFontSize: 22,
                  titleFontColor: Colors.black54,
                  descriptionFontFamily: 'Raleway',
                  descriptionFontColor: Colors.black45,
                  descriptionFontSize: 18,
                  timerInSeconds: 2,
                );
              },
              child: const Text('Show Error Message'),
            ),
            MaterialButton(
              onPressed: () {
                HAlertDialog.showCustomAlertBox(
                  context: context,
                  backgroundColor: Colors.blue,
                  title: 'Info',
                  description:
                      'This is the message that will appear in case of Info',
                  icon: Icons.info_outline,
                  iconSize: 32,
                  iconColor: Colors.blue,
                  titleFontFamily: 'Raleway',
                  titleFontSize: 22,
                  titleFontColor: Colors.black54,
                  descriptionFontFamily: 'Raleway',
                  descriptionFontColor: Colors.black45,
                  descriptionFontSize: 18,
                  timerInSeconds: 2,
                );
              },
              child: const Text('Show Info Message'),
            ),
            MaterialButton(
              onPressed: () {
                HAlertDialog.showCustomAlertBox(
                  context: context,
                  backgroundColor: Colors.yellow,
                  title: 'Warning',
                  description:
                      'This is the message that will appear in case of Warning',
                  icon: Icons.warning_amber_rounded,
                  iconSize: 32,
                  iconColor: Colors.yellow,
                  titleFontFamily: 'Raleway',
                  titleFontSize: 22,
                  titleFontColor: Colors.black54,
                  descriptionFontFamily: 'Raleway',
                  descriptionFontColor: Colors.black45,
                  descriptionFontSize: 18,
                  timerInSeconds: 2,
                );
              },
              child: const Text('Show Warning Message'),
            ),
          ],
        ),
      ),
    );
  }
}
6
likes
0
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

flutter alert dialog package to show custom alert dialog box easly and fast

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on h_alert_dialog