dart_widget:

A Dart package help you to add command functions like the Widget in Flutter, for example, you can add a widget to the CircleLoading, TextField, and more.


# 👨‍💻 Developed by:

profile

Nasr Al-Rahbi @abom_me

👨🏻‍💻 Find me in :

Twitter Instagram LinkedIn Stack Overflow



  • Text Field

    • Password Field
    • One Line Field
    • Multi Line Field
  • Circle Loading

Setup

Pubspec changes:

      dependencies:
        dart_widget: <last_version>

Sample example:

import 'package:dart_widget/dart_widget.dart';
Future<void> main() async {
  String? name = TextField(
      prompt: "Enter Your Name",
      hint: "ex: abom.me",
      validator: (String value) {
        if (value.length < 3) {
          throw ValidationErrors("Name must be at least 3 characters long");
        }
        return true;
      }).oneline();
    print(name);
}

TextField Password Field


import 'package:dart_widget/dart_widget.dart';
Future<void> main() async {
  String? password = TextField(
      prompt: "Enter Your Password",
      hint: "ex: 123456",
      validator: (String value) {
        if (value.length < 6) {
          throw ValidationErrors("Password must be at least 6 characters long");
        }
        return true;
      }).password();
    print(password);
}

TextField Multi Line Field


import 'package:dart_widget/dart_widget.dart';
Future<void> main() async {
  String? desc = TextField(prompt: "Enter your Description").multiline();
    print(desc);
}

Circle Loading

import 'package:dart_widget/dart_widget.dart';
Future<void> main() async {

  final circle = CircleLoading(
    loadingText: "Please wait",
    onDoneText: "Thank you for waiting",
  );
  circle.start();
  await Future.delayed(Duration(seconds: 5), () {
    circle.stop();
  });
}

Libraries

dart_widget