handy_dialogs 0.1.0 copy "handy_dialogs: ^0.1.0" to clipboard
handy_dialogs: ^0.1.0 copied to clipboard

Handy dialogs for your apps logic easy & quick integration of frequently used dialogs

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          "Handy Dialogs",
        ),
      ),
      body: const Page(),
    );
  }
}

class Page extends StatelessWidget {
  // const Page({super.key});
  const Page({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Card(
          color: Colors.amber[100],
          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
          child: ListTile(
            trailing: IconButton(
                onPressed: () async {
                  await deleteConfirmation(context);
                },
                icon: const Icon(
                  Icons.delete,
                  color: Colors.red,
                )), //Delete
            leading: IconButton(
              icon: Icon(
                Icons.notifications_active_rounded,
                color: Colors.amber[900],
              ),
              onPressed: () {
                notificationDialog(context, 'Notification dialog', '🦑🦑🦑🦑🦑🦑🦑🦑🦑', path: '/home/client/123',
                    onTap: () {
                  showText(context, 'Hi', '✨✨✨✨✨✨✨✨✨‍', backgroundColor: Colors.teal[800], isNotification: true);
                });
              },
            ), //Notification
            title: TextButton(
              child: const Text('Display showText'),
              onPressed: () {
                showText(context, 'Hi', '✨✨✨✨✨✨✨✨✨‍', backgroundColor: Colors.teal[800]);
              },
            ), //ShowText
            subtitle: TextButton(
              child: const Text('Confirmation Dialog'),
              onPressed: () async {
                if (await confirmationDialog(context, 'Do you agree?', 'Agree', 'Cancel')) {
                  showText(context, 'Nice!', '👍🏾', backgroundColor: Colors.green[400]);
                } else {
                  showText(context, 'Ok, fine!', '👎🏾', backgroundColor: Colors.red[400]);
                }
              },
            ), //Confirmation
          ),
        ),
      ),
    );
  }
}
3
likes
150
points
72
downloads

Publisher

verified publishermisdevelop.app

Weekly Downloads

Handy dialogs for your apps logic easy & quick integration of frequently used dialogs

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flash, flutter, sound_library

More

Packages that depend on handy_dialogs