Skip to content
Snippets Groups Projects
Commit c6a7474c authored by poka's avatar poka
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,36 +15,61 @@ class OnboardingStepEleven extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text(
'allGood'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
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(
'allGood'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
),
),
extendBodyBehindAppBar: true,
body: SafeArea(
child: Column(children: <Widget>[
const SizedBox(height: 40),
BuildText(text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
SizedBox(height: isTall ? 20 : 10),
Image.asset(
'assets/onBoarding/gecko-clin.gif',
height: isTall ? 400 : 300,
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: finishButton(context)),
),
const SizedBox(height: 40),
]),
));
extendBodyBehindAppBar: true,
body: SafeArea(
child: Stack(children: [
Column(children: <Widget>[
const SizedBox(height: 40),
BuildText(
text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
SizedBox(height: isTall ? 20 : 10),
Image.asset(
'assets/onBoarding/gecko-clin.gif',
height: isTall ? 400 : 300,
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: finishButton(context)),
),
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.
Finish editing this message first!
Please register or to comment