vdialog 0.2.1+2 copy "vdialog: ^0.2.1+2" to clipboard
vdialog: ^0.2.1+2 copied to clipboard

outdated

Flutter package to show beautiful dialogs with animations as simply as possible.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:vdialog/vdialog.dart';

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

class MyApp extends StatefulWidget {
  // This widget is the root of your application.
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        body: SafeArea(
          child: RaisedButton(
            child: Text("show dialog"),
            onPressed: showVDialog,
          ),
        ),
      ),
    );
  }

  void showVDialog() {
    showDialog(
      barrierDismissible: false,
      context: context,
      builder: (BuildContext ctx) => CustomDialog(
        title: "Error",
        buttonOne: this._buttonOne,
        buttonTwo: this._buttonTwo,
        buttonOneText: "retry",
        buttonTwoText: "close",
        content: "server not found!!",
        showButtonOne: true,
        showButtonTwo: true,
      ),
    );
  }

  void loadData() {
    //this is data function!
  }

  void _buttonOne() {
    loadData();
  }

  void _buttonTwo() {
    //this will close app
    SystemNavigator.pop();
  }
}
5
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Flutter package to show beautiful dialogs with animations as simply as possible.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on vdialog