simple_dialogs_flutter 0.0.1 copy "simple_dialogs_flutter: ^0.0.1" to clipboard
simple_dialogs_flutter: ^0.0.1 copied to clipboard

A new simple dialog flutter package which is impelemented easily

example/lib/main.dart

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


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

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


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,

      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Smart Dialog'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        centerTitle: true,

      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget> [

            MaterialButton(
              color: Colors.green,
              height: 50,
              shape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              textColor: Colors.white,
              child:  Text('Show Scuess Dialog',),
              onPressed: () {
                SimpleDialogs.showSuccessDialog(context: context, title: "");
              },
            ),
            SizedBox(height: 20,),
            MaterialButton(
              color: Colors.red,
              height: 50,
              shape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              textColor: Colors.white,
              child:  Text('Show Error Dialog',),
              onPressed: () {
                SimpleDialogs.showerrorDialog(context: context, title: "");
              },
            ),
            SizedBox(height: 20,),
            MaterialButton(
              color: Colors.blue,
              height: 50,
              shape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              textColor: Colors.white,
              child:  Text('Show Info Dialog',),
              onPressed: () {
                SimpleDialogs.showinfoDialog(context: context, title: "");
              },
            )
          ],
        ),



        ),
      );

  }
}
5
likes
110
pub points
0%
popularity

Publisher

unverified uploader

A new simple dialog flutter package which is impelemented easily

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, google_fonts

More

Packages that depend on simple_dialogs_flutter