smooth_dialog 0.0.2 copy "smooth_dialog: ^0.0.2" to clipboard
smooth_dialog: ^0.0.2 copied to clipboard

outdated

A smooth dialog is the customized dialog that provides the simple configuration of dialog and it has two UI experiences like dialog of android iOS desktop and web.

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

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

class _MyHomePageState extends State<MyHomePage> {
  late SmoothDialog smoothDialog;

  @override
  void initState() {
    super.initState();
    smoothDialog = SmoothDialog(context);
  }

  void _showDialog() {
    smoothDialog
        .setTitleHeader("this is the header dialog")
        .setDescription("This is description")
        .setTitlePositive("Confirm")
        .setTitleNegative("Cancel")
        .addButtonNegativeListener(() {})
        .addButtonPositiveListener(() {})
        .addDismissListener(() {})
        .showDialog();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Flutter Demo Home Page"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextButton(
              onPressed: () {
                _showDialog();
              },
              child: const Text(
                "Show",
                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
0
pub points
41%
popularity

Publisher

unverified uploader

A smooth dialog is the customized dialog that provides the simple configuration of dialog and it has two UI experiences like dialog of android iOS desktop and web.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on smooth_dialog