smart_popup 1.0.3 copy "smart_popup: ^1.0.3" to clipboard
smart_popup: ^1.0.3 copied to clipboard

A versatile Flutter alert dialog with videos, images, animations, countdown timer, and Loading state for buttons etc.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Custom Alert Popup Demo',
      theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
          useMaterial3: true),
      home: const CustomAlertPopupExample(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            showDialog(
              context: context,
              builder: (context) => const SmartPopup(
                title: "Hello",
                subTitle: "This is a custom alert dialog box",
                firstButtonText: "Ok",
                secondButtonText: "Cancel",
                // Do not pass image and video simultaneously; pass one at a time.
                // imagePath: "assets/images/demo_image.png",
                videoPath: "assets/videos/demo_video.mp4",
                videoVolume: 100,
                videoPlayBackSpeed: 2.5,
              ),
            );
          },
          child: const Text("Custom Alert Box"),
        ),
      ),
    );
  }
}
17
likes
0
points
186
downloads

Publisher

verified publisherfazilkp.in

Weekly Downloads

A versatile Flutter alert dialog with videos, images, animations, countdown timer, and Loading state for buttons etc.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_animate, flutter_hooks, flutter_timer_countdown, video_player, video_player_win

More

Packages that depend on smart_popup