sh_alert 0.0.5 copy "sh_alert: ^0.0.5" to clipboard
sh_alert: ^0.0.5 copied to clipboard

Custom Alert

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sh_alert/sh_alert.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: 'SHAlert Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("HomePage"),
      ),
      body: SafeArea(
        child: Center(
          child: Container(
            child: OutlinedButton(
                onPressed: () {
                  showShDialog(
                      context: context,
                      title: "Success",
                      description:
                          "In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available.",
                      textColor: Colors.black,
                      buttonColor: Colors.blue,
                      lottieType: LottieType.asset,
                      lottieFile: "assets/files/success.json");
                },
                child: Text("Show Alert")),
          ),
        ),
      ),
    );
  }
}
7
likes
120
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

Custom Alert

Documentation

API reference

License

MIT (license)

Dependencies

flutter, lottie

More

Packages that depend on sh_alert

Packages that implement sh_alert