alert_box_plus 0.1.1 copy "alert_box_plus: ^0.1.1" to clipboard
alert_box_plus: ^0.1.1 copied to clipboard

customizable alert dialogs

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
      debugShowCheckedModeBanner: false,
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  TextEditingController textEditingController = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: [
            ElevatedButton(onPressed: (){
              smartAlertDialog3(
                  context, );
            }, child: Text('DialogAction with One Button')
            ),
            ElevatedButton(onPressed: (){
              smartAlertDialog2(
                  context, button1Text: 'yes',
                  button2Text: 'no');
            }, child: Text('DialogActions with Two Buttons')
            ),
            ElevatedButton(onPressed: (){
              smartAlertDialog(
                  context, textEditingController);
            }, child: Text('DialogActions')
            ),
          ],
        ),
      )
    );
  }
}
0
likes
140
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

customizable alert dialogs

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on alert_box_plus