zenity 1.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 47

zenity

Desktop UI library to show simple dialog boxes and forms. Uses Zenity under-the-hood.

The following dialogs are supported:

  • Message
    • Info
    • Error
    • Question
    • Warning
  • Form with following fields
    • Text
    • Int
    • Double
    • Num
    • Password
    • DateTime
  • File selection
  • Password
  • Username:Password

Examples

Forms

main() async {
  final FormResult result =
  await new Form(title: 'Form example', name: 'User info', fields: [
    new TextField('First name:'),
    new TextField('Last name:'),
    new PasswordField('Password'),
    new CalendarField('DoB')
  ]).read;
  print(result);
}

Returns the form values are result:

{First name:: Teja, Last name:: Gudapati, Password: 1234as, DoB: 2017-12-11 00:00:00.000}

Form dialog

Message

Info

main() async {
  await Zenity.showInfoMessage(
      title: 'Information',
      text: 'Dialogs for Dart!');
}

Info message dialog

Question

main() async {
  final bool reply = await Zenity.showQuestionMessage(
      title: 'Question', text: 'Dialogs for Dart!');
  print(reply);
}

Question message dialog

Warning

main() async {
  await Zenity.showWarningMessage(title: 'Warning', text: 'Dialogs for Dart!');
}

Error

main() async {
  await Zenity.showErrorMessage(title: 'Error', text: 'Dialogs for Dart!');
}

Progress

import 'dart:async';
import 'package:zenity/zenity.dart';

Stream<int> get progress async* {
  for (int i = 0; i < 5; i++) {
    await new Future.delayed(new Duration(seconds: 2));
    yield await (i + 1) * (100 ~/ 5);
  }
}

main() async {
  await Zenity.showProgress(
      title: 'Progress', text: 'Loading...', progress: progress);
}

Progress dialog

Password

import 'package:zenity/zenity.dart';

main() async {
  print(await Zenity.readPassword());
}

Password dialog

Select file

import 'package:zenity/zenity.dart';

main() async {
  final List<String> files = await Zenity.selectFiles();
  print(files);
}

Select file dialog

Changelog

0.0.1

Support for

  • Message
    • Info
    • Error
    • Question
    • Warning
  • Form with following fields
    • Text
    • Int
    • Double
    • Num
    • Password
    • DateTime
  • File selection
  • Password
  • Username:Password

Use this package as a library

1. Depend on it

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


dependencies:
  zenity: "^1.0.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:zenity/zenity.dart';
  
Version Uploaded Documentation Archive
1.0.1 Dec 10, 2017 Go to the documentation of zenity 1.0.1 Download zenity 1.0.1 archive
1.0.0 Dec 10, 2017 Go to the documentation of zenity 1.0.0 Download zenity 1.0.0 archive

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
10 / 100
Health:
Code health derived from static analysis. [more]
74 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
98 / 100
Overall score:
Weighted score of the above. [more]
47
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:zenity/zenity.dart with components: io.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 errors.

    Strong-mode analysis of lib/src/forms.dart failed with the following error:

    line: 155 col: 8
    Undefined name 'required' used as an annotation.

    Strong-mode analysis of lib/src/zenity_base.dart failed with the following error:

    line: 3 col: 8
    Target of URI doesn't exist: 'package:meta/meta.dart'.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use zenity.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
Dev dependencies
test ^0.12.0