feat: information about contacts add/remove
This commit is contained in:
parent
6ec550e7ec
commit
9d63e6e522
|
@ -215,6 +215,7 @@
|
|||
"blockN": "block N°{}",
|
||||
"thisIsNotAGoodCode": "This is not a good code",
|
||||
"youHaveToBeConnectedToValidateChest": "You have to be connected\nto validate your chest",
|
||||
"thisIdentityAlreadyExist": "This identity already exists"
|
||||
|
||||
"thisIdentityAlreadyExist": "This identity already exists",
|
||||
"removedFromcontacts": "Removed from contacts",
|
||||
"addedToContacts": "Added to contacts"
|
||||
}
|
|
@ -216,5 +216,7 @@
|
|||
"blockN": "bloque N°{}",
|
||||
"thisIsNotAGoodCode": "Este codígo no es valido",
|
||||
"youHaveToBeConnectedToValidateChest": "Tienes que tener conneción\npara validar tu cofre",
|
||||
"thisIdentityAlreadyExist": "Esta identidad ya existe"
|
||||
"thisIdentityAlreadyExist": "Esta identidad ya existe",
|
||||
"removedFromcontacts": "Removed from contacts",
|
||||
"addedToContacts": "Added to contacts"
|
||||
}
|
|
@ -215,5 +215,7 @@
|
|||
"blockN": "bloc N°{}",
|
||||
"thisIsNotAGoodCode": "Ce n'est pas le bon code",
|
||||
"youHaveToBeConnectedToValidateChest": "Vous devez vous connecter à internet\npour valider votre coffre",
|
||||
"thisIdentityAlreadyExist": "Cette identité existe déjà"
|
||||
"thisIdentityAlreadyExist": "Cette identité existe déjà",
|
||||
"removedFromcontacts": "Retiré des contact",
|
||||
"addedToContacts": "Ajouté au contacts"
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'dart:io';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -8,6 +10,7 @@ import 'package:jdenticon_dart/jdenticon_dart.dart';
|
|||
import 'package:permission_handler/permission_handler.dart';
|
||||
// import 'package:qrscan/qrscan.dart' as scanner;
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:confetti/confetti.dart';
|
||||
|
||||
class WalletsProfilesProvider with ChangeNotifier {
|
||||
WalletsProfilesProvider(this.address);
|
||||
|
@ -21,6 +24,8 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
TextEditingController payAmount = TextEditingController();
|
||||
TextEditingController payComment = TextEditingController();
|
||||
num? _balance;
|
||||
final centerController =
|
||||
ConfettiController(duration: const Duration(milliseconds: 300));
|
||||
|
||||
Future<String> scan(context) async {
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
|
@ -137,8 +142,12 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
// log.d(profile.username);
|
||||
if (isContact(profile.address)) {
|
||||
await contactsBox.delete(profile.address);
|
||||
snackMessage(homeContext, message: 'removedFromcontacts'.tr());
|
||||
} else {
|
||||
centerController.play();
|
||||
await contactsBox.put(profile.address, profile);
|
||||
// drawStar(Size(50, 50));
|
||||
snackMessage(homeContext, message: 'addedToContacts'.tr());
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:confetti/confetti.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
|
@ -61,6 +64,16 @@ class WalletViewScreen extends StatelessWidget {
|
|||
actions: [
|
||||
Row(
|
||||
children: [
|
||||
ConfettiWidget(
|
||||
confettiController: walletProfile.centerController,
|
||||
blastDirection: pi / 2,
|
||||
maxBlastForce: 7,
|
||||
minBlastForce: 3,
|
||||
emissionFrequency: 0,
|
||||
numberOfParticles: 7,
|
||||
shouldLoop: false,
|
||||
gravity: 0.001,
|
||||
),
|
||||
Consumer<WalletsProfilesProvider>(
|
||||
builder: (context, walletProfile, _) {
|
||||
return IconButton(
|
||||
|
|
|
@ -265,6 +265,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.17.0"
|
||||
confetti:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: confetti
|
||||
sha256: "979aafde2428c53947892c95eb244466c109c129b7eee9011f0a66caaca52267"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
connectivity_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -65,6 +65,7 @@ dependencies:
|
|||
hive_generator: ^2.0.0
|
||||
riverpod: ^2.1.1
|
||||
tutorial_coach_mark: ^1.2.4
|
||||
confetti: ^0.7.0
|
||||
|
||||
dev_dependencies:
|
||||
# flutter_launcher_icons: ^0.9.2
|
||||
|
|
Loading…
Reference in New Issue