kalertflutter 1.0.0 copy "kalertflutter: ^1.0.0" to clipboard
kalertflutter: ^1.0.0 copied to clipboard

Flutter version of kalert

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("KAlert Demo")),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              child: const Text("Show Alert"),
              onPressed: () {
                KAlert.show(context, "Saved successfully!");
              },
            ),
            ElevatedButton(
              child: const Text("Show Confirm"),
              onPressed: () async {
                bool? result =
                await KAlert.confirm(context, "Delete file?");

                print(result);
              },
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
0
points
243
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter version of kalert

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on kalertflutter