Skip to content

Commit

Permalink
Merge branch 'master' into js/#1235-TextStyles-inside-Theme
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/lib/page-encointer/bazaar/0_main/bazaar_main.dart
#	app/lib/page-encointer/new_bazaar/businesses/widgets/businesses_card.dart
#	app/lib/page-encointer/new_bazaar/single_business/widgets/single_business_detail.dart
#	app/lib/page/assets/qr_code_printing/pages/qr_code_share_or_print_view.dart
  • Loading branch information
clangenb committed Jul 15, 2023
2 parents dd787bf + e610d63 commit f08401a
Show file tree
Hide file tree
Showing 62 changed files with 1,316 additions and 309 deletions.
87 changes: 87 additions & 0 deletions app/lib/common/components/animation/animated_check.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import 'dart:ui';

import 'package:flutter/material.dart';

import 'package:encointer_wallet/theme/theme.dart';

class AnimatedCheck extends StatelessWidget {
const AnimatedCheck({
required this.progress,
required this.size,
this.color,
super.key,
});

final Animation<double> progress;
final double size;
final Color? color;

@override
Widget build(BuildContext context) {
return CustomPaint(
foregroundPainter: AnimatedPathPainter(progress, color ?? context.colorScheme.primary),
child: SizedBox(width: size, height: size),
);
}
}

class AnimatedPathPainter extends CustomPainter {
const AnimatedPathPainter(this.animation, this.color) : super(repaint: animation);

final Animation<double> animation;
final Color color;

Path _createAnyPath(Size size) {
return Path()
..moveTo(0.27083 * size.width, 0.54167 * size.height)
..lineTo(0.41667 * size.width, 0.68750 * size.height)
..lineTo(0.75000 * size.width, 0.35417 * size.height);
}

Path createAnimatedPath(Path originalPath, double animationPercent) {
final totalLength =
// ignore: prefer_int_literals
originalPath.computeMetrics().fold(0.0, (double prev, PathMetric metric) => prev + metric.length);
final currentLength = totalLength * animationPercent;

return extractPathUntilLength(originalPath, currentLength);
}

Path extractPathUntilLength(Path originalPath, double length) {
var currentLength = 0.0;
final path = Path();
final metricsIterator = originalPath.computeMetrics().iterator;

while (metricsIterator.moveNext()) {
final metric = metricsIterator.current;
final nextLength = currentLength + metric.length;
final isLastSegment = nextLength > length;

if (isLastSegment) {
final remainingLength = length - currentLength;
final pathSegment = metric.extractPath(0, remainingLength);
path.addPath(pathSegment, Offset.zero);
break;
} else {
final pathSegment = metric.extractPath(0, metric.length);
path.addPath(pathSegment, Offset.zero);
}
currentLength = nextLength;
}
return path;
}

@override
void paint(Canvas canvas, Size size) {
final animationPercent = animation.value;
final path = createAnimatedPath(_createAnyPath(size), animationPercent);
final paint = Paint()
..color = color
..style = PaintingStyle.stroke
..strokeWidth = size.width * 0.06;
canvas.drawPath(path, paint);
}

@override
bool shouldRepaint(CustomPainter oldDelegate) => true;
}
1 change: 1 addition & 0 deletions app/lib/common/components/logo/community_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CommunityIconObserver extends StatelessWidget {
return SvgPicture.asset(fallBackCommunityIcon);
}
} else {
///TODO(Azamat): Add some image saying community not selected
return const CupertinoActivityIndicator();
}
},
Expand Down
2 changes: 1 addition & 1 deletion app/lib/common/components/map/encointer_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class EncointerMap extends StatelessWidget {
required this.popupBuilder,
required this.locations,
this.initialZoom = 13,
this.maxZoom = 18,
this.maxZoom = 20,
this.center,
this.mapController,
this.onPointerDown,
Expand Down
1 change: 1 addition & 0 deletions app/lib/config/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ String ceremonyInfoLink(String locale, String? cid) {

const assignmentFAQLinkEN = 'https://leu.zuerich/en/#why-have-i-not-been-assigned-to-a-cycle';
const assignmentFAQLinkDE = 'https://leu.zuerich/#warum-wurde-ich-keinem-cycle-zugewiesen';
const infuraIpfsUrl = 'https://encointer.infura-ipfs.io/ipfs';

String leuZurichCycleAssignmentFAQLink(String locale) {
return switch (locale) {
Expand Down
11 changes: 10 additions & 1 deletion app/lib/l10n/arb/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -416,5 +416,14 @@
"successfullySentNAttestations": "Du hast erfolgreich Bezeugungen für {participantsCount} andere Leute eingereicht.",
"tokenSend": "{symbol} senden",
"communityWithName": "{name} Gemeinschaft",
"verifyAuthTitle": "{useBioAuth, select, true{deine Identität} false{deine PIN} other{}} überprüfen, um die Transaktion abzuschließen."
"verifyAuthTitle": "{useBioAuth, select, true{deine Identität} false{deine PIN} other{}} überprüfen, um die Transaktion abzuschließen.",
"offersForCommunity": "Angebote für {value}",
"@offersForCommunity": {
"placeholders": {
"value": {
"type": "String",
"example": "LEU"
}
}
}
}
9 changes: 9 additions & 0 deletions app/lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -568,5 +568,14 @@
"example": "true"
}
}
},
"offersForCommunity": "Offers for {value}",
"@offersForCommunity": {
"placeholders": {
"value": {
"type": "String",
"example": "LEU"
}
}
}
}
11 changes: 10 additions & 1 deletion app/lib/l10n/arb/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -416,5 +416,14 @@
"successfullySentNAttestations": "Tu as soumis avec succès des attestations pour {participantsCount} autres personnes.",
"tokenSend": "Envoyer {symbol}",
"communityWithName": "Communauté {name}",
"verifyAuthTitle": "Veuillez vérifier {useBioAuth, select, true{ta identité} false{le NIP} other{}} pour finaliser la transaction."
"verifyAuthTitle": "Veuillez vérifier {useBioAuth, select, true{ta identité} false{le NIP} other{}} pour finaliser la transaction.",
"offersForCommunity": "Des offres pour un {value}",
"@offersForCommunity": {
"placeholders": {
"value": {
"type": "String",
"example": "LEU"
}
}
}
}
15 changes: 12 additions & 3 deletions app/lib/l10n/arb/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"pinSecure": "Защитите свой аккаунт с помощью PIN-кода",
"pleaseCommunityChoose": "Пожалуйста выберите общину",
"pleaseConfirmYourNewPin": "Подтвердите PIN-код",
"preview": "Предварительный просмотр",
"preview": "Предпросмотр",
"price": "Цена",
"print": "Распечатать",
"productNewness": "Новые продукты",
Expand Down Expand Up @@ -320,7 +320,7 @@
"settingPrefix": "Префикс адреса",
"settingPrefixList": "Доступные префиксы",
"share": "Поделиться",
"shareInvoice": "Поделиться инвойсом",
"shareInvoice": "Отправить инвойс",
"shareLinkHint": "Или Вы можете поделиться ссылкой",
"showAll": "+ Показать все",
"showRouteMeetupLocation": "Показать маршрут",
Expand Down Expand Up @@ -416,5 +416,14 @@
"successfullySentNAttestations": "Вы успешно отправили аттестации {participantsCount} других людей.",
"tokenSend": "Отправить {symbol}",
"communityWithName": "Сообщество {name}",
"verifyAuthTitle": "Для завершения транзакции {useBioAuth, select, true{подтвердите вашу личность} false{введите PIN-код} other{}}."
"verifyAuthTitle": "Для завершения транзакции {useBioAuth, select, true{подтвердите вашу личность} false{введите PIN-код} other{}}.",
"offersForCommunity": "Предложения за {value}",
"@offersForCommunity": {
"placeholders": {
"value": {
"type": "String",
"example": "LEU"
}
}
}
}
31 changes: 27 additions & 4 deletions app/lib/mocks/mock_bazaar_data.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:encointer_wallet/models/bazaar/account_business_tuple.dart';
import 'package:encointer_wallet/models/bazaar/business_data.dart';
import 'package:encointer_wallet/models/bazaar/business_identifier.dart';
import 'package:encointer_wallet/models/bazaar/businesses.dart';
import 'package:encointer_wallet/models/bazaar/ipfs_business.dart';
import 'package:encointer_wallet/models/bazaar/ipfs_offering.dart';
import 'package:encointer_wallet/models/bazaar/offering_data.dart';
Expand All @@ -17,6 +18,9 @@ const String businessIpfsCid3 = '0x3ebf164a5bb618ec6caad31488161b237e24d75efa304
final CommunityIdentifier cid1 = CommunityIdentifier.fromFmtString('gbsuv7YXq9G');
final CommunityIdentifier cid2 = CommunityIdentifier.fromFmtString('fbsuv7YXq9G');

/// EdisonPaula
final CommunityIdentifier cidEdisonPaula = CommunityIdentifier.fromFmtString('u0qj94fxxJ6');

final BusinessIdentifier bid1 = BusinessIdentifier(cid1, controller1);
final BusinessIdentifier bid2 = BusinessIdentifier(cid1, controller2);
final BusinessIdentifier bid3 = BusinessIdentifier(cid1, controller3);
Expand All @@ -32,10 +36,10 @@ const String offeringIpfsCid2 = '0x77ebf164a5bb618ec6caad31488161b237e24d75efa30
const String offeringIpfsCid3 = '0x87ebf164a5bb618ec6caad31488161b237e24d75efa3040286767b620d9183989';
const String offeringIpfsCid4 = '0x97ebf164a5bb618ec6caad31488161b237e24d75efa3040286767b620d9183989';

final OfferingData offeringData1 = OfferingData(offeringIpfsCid1);
final OfferingData offeringData2 = OfferingData(offeringIpfsCid2);
final OfferingData offeringData3 = OfferingData(offeringIpfsCid3);
final OfferingData offeringData4 = OfferingData(offeringIpfsCid4);
final OfferingData offeringData1 = OfferingData(url: offeringIpfsCid1);
final OfferingData offeringData2 = OfferingData(url: offeringIpfsCid2);
final OfferingData offeringData3 = OfferingData(url: offeringIpfsCid3);
final OfferingData offeringData4 = OfferingData(url: offeringIpfsCid4);

final Map<BusinessIdentifier, List<OfferingData>> offeringsForBusiness = {
bid1: business1MockOfferings,
Expand Down Expand Up @@ -96,3 +100,22 @@ final ipfsOffering3 = IpfsOffering('Harry Potter Heptalogy', 1, 'I am interestin
'assets/images/assets/assets_nav_0.png');
final ipfsOffering4 = IpfsOffering(
'Picasso Fake as NFT by C.L.', 1, 'I am beautiful', 'Miami Beach', 'assets/images/assets/assets_nav_0.png');

final mockBusinessData = {
'name': 'HIGHLIGHTED',
'description': 'wir offerieren kühles Bier',
'category': 'food',
'photo': null,
'address': 'Technoparkstrasse 1, 8005 Zürich',
'telephone': null,
'email': null,
'longitude': '8.515377938747404',
'latitude': '47.389401263868514',
'openingHours': 'Mon-Fri 8h-18h',
'photos': 'QmaQfq6Zr2yCMkSMe8VjSxoYd89hyzcJjeE8jTUG3uXpBG',
'logo': 'QmcULG6AN5wwMfuwtpsMcjQmFwwUnSHsvSEUFLrCoWMpWh',
'status': 'highlight',
'controller': controller1,
};

final Businesses businessesMockForSingleBusiness = Businesses.fromJson(mockBusinessData);
Loading

0 comments on commit f08401a

Please sign in to comment.