0 purchases
easy comp utils toast
Componentes #
EasyCompUtilsToast
Instalação #
Adicione a ultima versão ao arquivo pubspec.yaml (e rode 'dart pub get');
dependencies:
easy_comp_utils_toast: ^0.0.2
copied to clipboard
Inicialize a lib passando o [NavigatorState]
import 'package:easy_comp_utils_toast/easy_comp_utils_toast.dart';
class MyApp extends StatelessWidget {
const MyApp({super.key});
final navigatorKeyGlobal = GlobalKey<NavigatorState>();
@override
Widget build(BuildContext context) {
EasyCompUtilsToast.init(navigatorKeyGlobal);
return MaterialApp(
title: 'MyApp',
navigatorKey: navigatorKeyGlobal,
);
}
}
copied to clipboard
Importe o pacote para usar no seu App Flutter
import 'package:easy_comp_utils_toast/easy_comp_utils_toast.dart';
copied to clipboard
Modo de usar #
Usando componente EasyCompUtilsToast.
import 'package:flutter/material.dart';
import 'package:easy_comp_utils_toast/easy_comp_utils_toast.dart';
class EasyCompTeste extends StatelessWidget {
const EasyCompTeste({super.key});
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: TextButton(
child: const Text("Teste"),
onPressed: () async {
EasyCompUtilsToast.success(
message: "success !",
);
await Future.delayed(const Duration(seconds: 2));
EasyCompUtilsToast.info(
message: "info !",
);
await Future.delayed(const Duration(seconds: 2));
EasyCompUtilsToast.error(
message: "error !",
);
},
),
),
);
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.