pop_alert 0.0.30 copy "pop_alert: ^0.0.30" to clipboard
pop_alert: ^0.0.30 copied to clipboard

Pop alert is a responsive and animated alert / dialog for flutter, A beautiful replacement for Flutter "alert / dialog".

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Pop Alert',
      home: 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(
      body: ListView(
        children: [
          const SizedBox(height: 20),
          Center(
            child: GestureDetector(
              onTap: () => PopAlert.simpleAlert(
                context: context,
                title: 'Title goes here!',
                text: '...and text goes here!',
                button: 'OK',
              ),
              child: Container(
                height: 100,
                width: 100,
                color: Colors.blue,
                child: Center(
                  child: RichText(
                    text: const TextSpan(
                      text: 'Simple Alert',
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    textAlign: TextAlign.center,
                  ),
                ),
              ),
            ),
          ),
          const SizedBox(height: 20),
          Center(
            child: GestureDetector(
              onTap: () => PopAlert.iconAlert(
                context: context,
                icon: PopAlertIcon.success,
                title: 'Good job!',
                text: 'You clicked the button!',
                button: 'OK',
              ),
              child: Container(
                height: 100,
                width: 100,
                color: Colors.blue,
                child: Center(
                  child: RichText(
                    text: const TextSpan(
                      text: 'Icon Alert',
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    textAlign: TextAlign.center,
                  ),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
3
likes
120
pub points
55%
popularity

Publisher

unverified uploader

Pop alert is a responsive and animated alert / dialog for flutter, A beautiful replacement for Flutter "alert / dialog".

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, lottie

More

Packages that depend on pop_alert