Toast flottant
Utiliser ce package comme bibliothèque
Exécutez cette commande :
Avec Flutter :
$ flutter pub add smartfluttertoast
Cela ajoutera une ligne comme celle-ci au pubspec.yaml de votre package (et exécutera un flutter pub get implicite):
dependencies:
smartfluttertoast: ^0.0.5
Alternativement, votre éditeur peut prendre en charge flutter pub get. Consultez la documentation de votre éditeur pour en savoir plus. Importez-le
Maintenant, dans votre code Dart, vous pouvez utiliser :
import 'package:smartfluttertoast/smartfluttertoast.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _smartToaster = Smartfluttertoast();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Toast Example'),
),
body: Center(
child: InkWell(
child: Text("Show Toast"),
onTap: (){
_smartToaster.showToast('My custom message');
},
),
),
),
);
}
}
LICENCE
MA licence
Copyright (c) 2022 Dheeraj Singh Bhadoria
L’autorisation est accordée, gratuitement, à toute personne obtenant une copie de ce logiciel et des fichiers de documentation associés (le « Logiciel »), de traiter le Logiciel sans restriction, y compris, sans limitation, les droits d’utilisation, de copie, de modification, de fusion , publier, distribuer, sous-licencier et/ou vendre des copies du Logiciel, et permettre aux personnes à qui le Logiciel est fourni de le faire, sous réserve des conditions suivantes :
L’avis de droit d’auteur ci-dessus et cet avis d’autorisation doivent être inclus dans toutes les copies ou parties substantielles du Logiciel.
LE LOGICIEL EST FOURNI « EN L’ÉTAT », SANS GARANTIE D’AUCUNE SORTE, EXPLICITE OU IMPLICITE, Y COMPRIS, MAIS SANS S’Y LIMITER, LES GARANTIES DE QUALITÉ MARCHANDE, D’ADÉQUATION À UN USAGE PARTICULIER ET D’ABSENCE DE CONTREFAÇON. EN AUCUN CAS, LES AUTEURS OU LES DÉTENTEURS DU COPYRIGHT NE SERONT RESPONSABLES DE TOUTE RÉCLAMATION, DOMMAGE OU AUTRE RESPONSABILITÉ, QUE CE SOIT DANS UNE ACTION CONTRACTUELLE, DÉLICTUELLE OU AUTRE, DÉCOULANT DE, DE OU EN RELATION AVEC LE LOGICIEL OU L’UTILISATION OU D’AUTRES TRANSACTIONS DANS LE LOGICIEL.
GitHub
Voir Github