flutter_app_dialog 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new56

flutter_app_dialog #

flutter app dialog A Flutter plugin for iOS and Android for simple and easy implement dialogs.

Installation #

Add flutter_app_dialog to your pubspec.yaml dependencies.

Example #

Basic Dialog #

showDialog(
              context: context,
              builder: (BuildContext context) {
                return BaseDialogWidget(
                  child: BasicDialog() ,
                );
              });

Info Dialog #

showDialog(
              context: context,
              builder: (BuildContext context) {
                return BaseDialogWidget(
                  child: InfoDialog() ,
                );
              });

No Internet Connection Dialog #

showDialog(
              context: context,
              builder: (BuildContext context) {
                return BaseDialogWidget(
                  child: NoInternetConnectionDialog() ,
                );
              });

Payment Dialog #

showDialog(
              context: context,
              builder: (BuildContext context) {
                return BaseDialogWidget(
                  child: PaymentDialog() ,
                );
              });

[0.1.0] - 2020-06-22 #

release note: Update basic dialog.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter App Dialog'),
    );
  }
}

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

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          widget.title,
        ),
        backgroundColor: Color.fromRGBO(118, 80, 193, 1),
      ),
      body: _body(),
    );
  }

  ///Tan.nguyen 6/20/20 :build body
  Widget _body() {
    return Container(
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
      alignment: Alignment.center,
      child: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            _baseButton(buttonName: 'Basic Dialog',dialogWidget: BasicDialog()),
            SizedBox(
              height: 20,
            ),
            ///Tan.nguyen 6/21/20 : build info dialog
            _baseButton(buttonName: 'Info Dialog', dialogWidget: InfoDialog()),
            SizedBox(
              height: 20,
            ),

            ///Tan.nguyen 6/21/20 : build no internet connection dialog
            _baseButton(buttonName: 'No Internet Connection', dialogWidget: NoInternetConnectionDialog()),
            SizedBox(
              height: 20,
            ),

            ///Tan.nguyen 6/21/20 : build payment dialog
            _baseButton(buttonName: 'Payment Dialog', dialogWidget: PaymentDialog())
          ],
        ),
      ),
    );
  }

  ///Tan.nguyen 6/20/20 : build base button
  Widget _baseButton({String buttonName, Widget dialogWidget}) {
    return Container(
      width: WidgetUtil.resizeByWidth(context, 100),
      height: WidgetUtil.resizeByWidth(context, 40),
      child: FlatButton(
        color: Color.fromRGBO(118, 80, 193, 1),
        padding: EdgeInsets.zero,
        onPressed: () {
          showDialog(
              context: context,
              builder: (BuildContext context) {
                return BaseDialogWidget(
                  child: dialogWidget ?? InfoDialog(),
                );
              });
        },
        child: Text(
          buttonName ?? '',
          textAlign: TextAlign.center,
          overflow: TextOverflow.clip,
          style: TextStyle(
            fontSize: 16,
            color: Colors.white,
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_app_dialog: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_app_dialog/flutter_app_dialog.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
11
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

We analyzed this package on Jul 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [flutter_app_dialog] that is in a package requiring null.

Health suggestions

Format lib/src/utils/widget_util.dart.

Run flutter format to format lib/src/utils/widget_util.dart.

Format lib/src/widgets/base_dialog_widget.dart.

Run flutter format to format lib/src/widgets/base_dialog_widget.dart.

Format lib/src/widgets/info_dialog_widget.dart.

Run flutter format to format lib/src/widgets/info_dialog_widget.dart.

Format lib/src/widgets/no_internet_connection_widget.dart.

Run flutter format to format lib/src/widgets/no_internet_connection_widget.dart.

Format lib/src/widgets/payment_dialog_widget.dart.

Run flutter format to format lib/src/widgets/payment_dialog_widget.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test