Skip to content
Snippets Groups Projects
Commit c6a7474c authored by poka's avatar poka :speech_balloon:
Browse files

improve contact management

parent 9d63e6e5
No related branches found
No related tags found
No related merge requests found
Pipeline #18999 waiting for manual action
......@@ -142,12 +142,13 @@ class WalletsProfilesProvider with ChangeNotifier {
// log.d(profile.username);
if (isContact(profile.address)) {
await contactsBox.delete(profile.address);
snackMessage(homeContext, message: 'removedFromcontacts'.tr());
snackMessage(homeContext,
message: 'removedFromcontacts'.tr(), duration: 4);
} else {
centerController.play();
await contactsBox.put(profile.address, profile);
// drawStar(Size(50, 50));
snackMessage(homeContext, message: 'addedToContacts'.tr());
snackMessage(homeContext, message: 'addedToContacts'.tr(), duration: 4);
}
notifyListeners();
}
......
......@@ -2,15 +2,18 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:gecko/widgets/commons/offline_info.dart';
import 'package:gecko/widgets/contacts_list.dart';
import 'package:provider/provider.dart';
class ContactsScreen extends StatelessWidget {
const ContactsScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
Provider.of<WalletsProfilesProvider>(context, listen: true);
double avatarSize = 55;
final myContacts = contactsBox.toMap().values.toList();
......@@ -34,9 +37,7 @@ class ContactsScreen extends StatelessWidget {
bottomNavigationBar: const GeckoBottomAppBar(),
body: SafeArea(
child: Stack(children: [
ContactsList(
myContacts: myContacts,
avatarSize: avatarSize),
ContactsList(myContacts: myContacts, avatarSize: avatarSize),
const OfflineInfo(),
]),
),
......
// ignore_for_file: file_names
import 'dart:math';
import 'package:confetti/confetti.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
......@@ -12,10 +15,18 @@ class OnboardingStepEleven extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
final conffetiController =
ConfettiController(duration: const Duration(milliseconds: 300));
conffetiController.play();
return WillPopScope(
onWillPop: () {
return Future<bool>.value(false);
},
child: Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
leading: const Icon(Icons.check),
title: SizedBox(
height: 22,
child: Text(
......@@ -26,9 +37,11 @@ class OnboardingStepEleven extends StatelessWidget {
),
extendBodyBehindAppBar: true,
body: SafeArea(
child: Column(children: <Widget>[
child: Stack(children: [
Column(children: <Widget>[
const SizedBox(height: 40),
BuildText(text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
BuildText(
text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
SizedBox(height: isTall ? 20 : 10),
Image.asset(
'assets/onBoarding/gecko-clin.gif',
......@@ -41,7 +54,22 @@ class OnboardingStepEleven extends StatelessWidget {
),
const SizedBox(height: 40),
]),
));
Align(
alignment: Alignment.topCenter,
child: ConfettiWidget(
confettiController: conffetiController,
blastDirection: pi / 2,
maxBlastForce: 5,
minBlastForce: 1,
emissionFrequency: 0.01,
numberOfParticles: 10,
shouldLoop: false,
gravity: 0.1,
),
),
]),
)),
);
}
}
......
......@@ -26,7 +26,7 @@ class ContactsList extends StatelessWidget {
@override
Widget build(BuildContext context) {
final walletsProfilesClass =
Provider.of<WalletsProfilesProvider>(context, listen: true);
Provider.of<WalletsProfilesProvider>(context, listen: false);
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
return Padding(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment