quickie 1.0.2+3 icon indicating copy to clipboard operation
quickie: ^1.0.2+3 copied to clipboard

A package for doing it quickly

quickie #

A package for doing it quickly. Requesting user input.

Hecho en 🇵🇷 por Radamés J. Valentín Reyes

Import #

import 'package:quickie/quickie.dart';

Quickly get a String #

String? result = await quickString(
	title: const Text("Write something"),
	context: context,
	inputFieldPadding: const EdgeInsets.all(10),
);
print("The result is $result");

Quickly get a int #

int? result = await quickInt(
	title: const Text("enter an int"),
	context: context,
	inputFieldPadding: const EdgeInsets.all(10),
);
print("The result is $result");

Quickly get a double #

double? result = await quickDouble(
	title: const Text("enter an double"),
	context: context,
	inputFieldPadding: const EdgeInsets.all(10),
);
print("The result is $result");

Quick Alert #

Quickly display an alert message

await quickAlert(
  context: context, 
  language: Languages.english,
  alertMessage: TranslatableText(
    options: [
      TranslateOption(language: Languages.english, text: "Something happened: error code 45539"),
      TranslateOption(language: Languages.spanish, text: "Algo sucedió: código de error 45539"),
    ],
    displayLanguage: Languages.english,
  ),
  overlayColor: Colors.green,
);

Quick Confirm #

Quickly confirm action

TextButton(
  onPressed: ()async{
    bool userChoice = await quickConfirm(
      context: context, 
      content: const Text("Would you like to delete a file"),
      language: Languages.english,
      overlayColor: Colors.green,
    );
    print(userChoice);
  },
  child: const Text(
    "Quick confirm",
  ),
),

Full Example #

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

void main() {
  runApp(const MaterialApp(
    home: MyApp(),
  ));
}
class MyApp extends StatelessWidget {
  const MyApp({ Key? key }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: SingleChildScrollView(
          child: Column(
            children: [
              TextButton(
                onPressed: ()async{
                  String? result = await quickString(
                    title: const Text("Write something"),
                    context: context,
                    inputFieldPadding: const EdgeInsets.all(10),
                  );
                  print("The result is $result");
                },
                child: const Text(
                  "String",
                ),
              ),
              TextButton(
                onPressed: ()async{
                  int? result = await quickInt(
                    title: const Text("enter an int"),
                    context: context,
                    inputFieldPadding: const EdgeInsets.all(10),
                  );
                  print("The result is $result");
                },
                child: const Text(
                  "int",
                ),
              ),
              TextButton(
                onPressed: ()async{
                  double? result = await quickDouble(
                    title: const Text("enter an double"),
                    context: context,
                    inputFieldPadding: const EdgeInsets.all(10),
                  );
                  print("The result is $result");
                },
                child: const Text(
                  "double",
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
90
pub points
13%
popularity

Publisher

unverified uploader

A package for doing it quickly

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, translatable_text_field

More

Packages that depend on quickie