Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mobile into nostr-nip07
  • Loading branch information
sarthak13gupta committed Jul 13, 2023
2 parents 82e5a24 + 93ddcd1 commit dc033a8
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 88 deletions.
84 changes: 42 additions & 42 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- "app_settings (3.0.0+1)":
- app_settings (4.3.0):
- Flutter
- AppAuth (1.6.2):
- AppAuth/Core (= 1.6.2)
Expand Down Expand Up @@ -59,49 +59,49 @@ PODS:
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Firebase/CoreOnly (10.9.0):
- FirebaseCore (= 10.9.0)
- Firebase/Database (10.9.0):
- Firebase/CoreOnly (10.10.0):
- FirebaseCore (= 10.10.0)
- Firebase/Database (10.10.0):
- Firebase/CoreOnly
- FirebaseDatabase (~> 10.9.0)
- Firebase/DynamicLinks (10.9.0):
- FirebaseDatabase (~> 10.10.0)
- Firebase/DynamicLinks (10.10.0):
- Firebase/CoreOnly
- FirebaseDynamicLinks (~> 10.9.0)
- Firebase/Messaging (10.9.0):
- FirebaseDynamicLinks (~> 10.10.0)
- Firebase/Messaging (10.10.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.9.0)
- firebase_core (2.13.0):
- Firebase/CoreOnly (= 10.9.0)
- FirebaseMessaging (~> 10.10.0)
- firebase_core (2.14.0):
- Firebase/CoreOnly (= 10.10.0)
- Flutter
- firebase_database (10.2.1):
- Firebase/Database (= 10.9.0)
- firebase_database (10.2.3):
- Firebase/Database (= 10.10.0)
- firebase_core
- Flutter
- firebase_dynamic_links (5.3.1):
- Firebase/DynamicLinks (= 10.9.0)
- firebase_dynamic_links (5.3.3):
- Firebase/DynamicLinks (= 10.10.0)
- firebase_core
- Flutter
- firebase_messaging (14.6.1):
- Firebase/Messaging (= 10.9.0)
- firebase_messaging (14.6.4):
- Firebase/Messaging (= 10.10.0)
- firebase_core
- Flutter
- FirebaseCore (10.9.0):
- FirebaseCore (10.10.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreInternal (10.10.0):
- FirebaseCoreInternal (10.11.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseDatabase (10.9.0):
- FirebaseDatabase (10.10.0):
- FirebaseCore (~> 10.0)
- leveldb-library (~> 1.22)
- FirebaseDynamicLinks (10.9.0):
- FirebaseDynamicLinks (10.10.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (10.10.0):
- FirebaseInstallations (10.11.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseMessaging (10.9.0):
- FirebaseMessaging (10.10.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.2)
Expand Down Expand Up @@ -217,15 +217,15 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.0.4):
- permission_handler_apple (9.1.1):
- Flutter
- printing (1.0.0):
- Flutter
- PromisesObjC (2.2.0)
- ReachabilitySwift (5.0.0)
- SDWebImage (5.15.8):
- SDWebImage/Core (= 5.15.8)
- SDWebImage/Core (5.15.8)
- SDWebImage (5.16.0):
- SDWebImage/Core (= 5.16.0)
- SDWebImage/Core (5.16.0)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
Expand Down Expand Up @@ -392,7 +392,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"

SPEC CHECKSUMS:
app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3
app_settings: ee4ae4d1c9a907a23b81c40e5c56a5ca8a20a62b
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
Expand All @@ -404,17 +404,17 @@ SPEC CHECKSUMS:
ffmpeg-kit-ios-https-gpl: e43266620f2b601959b473be4a09ea190d7d9c40
ffmpeg_kit_flutter_https_gpl: 6434a09be0b21b6ee399e855935684f5e81cb5b7
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: bd152f0f3d278c4060c5c71359db08ebcfd5a3e2
firebase_core: fc68c0f9eec4e800b9418deff14a7e0a504016f3
firebase_database: 4d3dda99ba3d7740d3d00ce163b29b5bf5d649c6
firebase_dynamic_links: cf9f52378c722d7aa4563437feedee9160d5257c
firebase_messaging: ffb4e7c95d4daca8cef4eca0283f0ddd2b365d40
FirebaseCore: b68d3616526ec02e4d155166bbafb8eca64af557
FirebaseCoreInternal: 971029061d326000d65bfdc21f5502c75c8b0893
FirebaseDatabase: 0abe52c2b687e05f76e19f94248730187f83d48a
FirebaseDynamicLinks: 8cb66c4f403aa6ddf86ff3bc3c383a652f344ce9
FirebaseInstallations: 52153982b057d3afcb4e1fbb3eb0b6d00611e681
FirebaseMessaging: 6b7052cc3da7bc8e5f72bef871243e8f04a14eed
Firebase: facd334e557a979bd03a0b58d90fd56b52b8aba0
firebase_core: 85b6664038311940ad60584eaabc73103c61f5de
firebase_database: e6efdeffa31750d0f5664a8dc161e04a73c3f888
firebase_dynamic_links: 8e1ef5000616eb1004f06ec5cdd5e679ef199c29
firebase_messaging: c55f70dd48a998dea00a29ccf94572e1e4d454b2
FirebaseCore: d027ff503d37edb78db98429b11f580a24a7df2a
FirebaseCoreInternal: 9e46c82a14a3b3a25be4e1e151ce6d21536b89c0
FirebaseDatabase: c3f61dfb9dbd2e8a2804454283d493e9372f1465
FirebaseDynamicLinks: 3f61f496236d30fa749377159fb7b3d82ecb3c49
FirebaseInstallations: 2a2c6859354cbec0a228a863d4daf6de7c74ced4
FirebaseMessaging: 8a3b9a8b98ce72a42d22e69865cf662e38d2d6f5
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
Expand Down Expand Up @@ -445,13 +445,13 @@ SPEC CHECKSUMS:
nfc_manager: d7da7cb781f7744b94df5fe9dbca904ac4a0939e
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
printing: 233e1b73bd1f4a05615548e9b5a324c98588640b
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
SDWebImage: cb032eba469c54e0000e78bcb0a13cdde0a52798
SDWebImage: 2aea163b50bfcb569a2726b6a754c54a4506fcf6
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
Expand Down
6 changes: 3 additions & 3 deletions lib/bloc/account/add_funds_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ class AddFundsBloc extends Bloc {
String redirectURL = config.get("MoonPay Parameters", 'redirectURL');
String walletAddress = response.address;
String maxQuoteCurrencyAmount = Currency.BTC.format(
response.maxAllowedDeposit,
includeDisplayName: false,
removeTrailingZeros: true);
response.maxAllowedDeposit,
includeDisplayName: false,
);
String queryString = "?${[
"apiKey=$apiKey",
"currencyCode=$currencyCode",
Expand Down
11 changes: 0 additions & 11 deletions lib/bloc/user_profile/currency.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class Currency extends Object {
Int64 sat, {
includeCurrencySymbol = false,
includeDisplayName = true,
removeTrailingZeros = false,
userInput = false,
}) =>
_CurrencyFormatter().format(sat, this,
addCurrencySymbol: includeCurrencySymbol,
addCurrencySuffix: includeDisplayName,
removeTrailingZeros: removeTrailingZeros,
userInput: userInput);

Int64 parse(String amountStr) => _CurrencyFormatter().parse(amountStr, this);
Expand Down Expand Up @@ -81,21 +79,12 @@ class _CurrencyFormatter {
String format(satoshies, Currency currency,
{bool addCurrencySuffix = true,
bool addCurrencySymbol = false,
removeTrailingZeros = false,
userInput = false}) {
String formattedAmount = formatter.format(satoshies);
switch (currency) {
case Currency.BTC:
double amountInBTC = (satoshies.toInt() / 100000000);
formattedAmount = amountInBTC.toStringAsFixed(8);
if (removeTrailingZeros) {
if (amountInBTC.truncateToDouble() == amountInBTC) {
formattedAmount = amountInBTC.toInt().toString();
} else {
formattedAmount = formattedAmount.replaceAllMapped(
RegExp(r'^(\d+\.\d*?[1-9])0+$'), (match) => match.group(1));
}
}
break;
case Currency.SAT:
formattedAmount = formatter.format(satoshies);
Expand Down
1 change: 0 additions & 1 deletion lib/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:io';

import 'package:anytime/bloc/podcast/audio_bloc.dart';
import 'package:anytime/ui/anytime_podcast_app.dart';
Expand Down
11 changes: 6 additions & 5 deletions lib/routes/charge/currency_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ class CurrencyWrapper {
}) {
if (btc != null) {
var satValue = btc.toSats(value);
return btc.format(satValue,
userInput: userInput,
includeDisplayName: includeDisplayName,
includeCurrencySymbol: includeCurrencySymbol,
removeTrailingZeros: removeTrailingZeros);
return btc.format(
satValue,
userInput: userInput,
includeDisplayName: includeDisplayName,
includeCurrencySymbol: includeCurrencySymbol,
);
}
return fiat.formatFiat(value,
includeDisplayName: includeDisplayName,
Expand Down
1 change: 0 additions & 1 deletion lib/routes/home/bottom_actions_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ Future showReceiveOptions(
texts.bottom_action_bar_warning_balance_title(
account.currency.format(
account.warningMaxChanReserveAmount,
removeTrailingZeros: true,
),
),
maxFontSize: Theme.of(context)
Expand Down
1 change: 0 additions & 1 deletion lib/routes/home/qr_action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class QrActionButton extends StatelessWidget {
btcInvoice.satAmount,
userInput: true,
includeDisplayName: false,
removeTrailingZeros: true,
);
}
navigator.push(
Expand Down
1 change: 0 additions & 1 deletion lib/routes/home/wallet_dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ class WalletDashboardState extends State<WalletDashboard> {
),
text: widget._accountModel.currency.format(
widget._accountModel.balance,
removeTrailingZeros: true,
includeDisplayName: false,
),
children: [
Expand Down
1 change: 0 additions & 1 deletion lib/routes/withdraw_funds/withdraw_funds_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class WithdrawFundsPageState extends State<WithdrawFundsPage> {
btcInvoice.satAmount,
userInput: true,
includeDisplayName: false,
removeTrailingZeros: true,
);
}
setState(() {
Expand Down
5 changes: 2 additions & 3 deletions lib/utils/print_pdf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class PrintService {
final sale = printParameters.submittedSale;
final totalAmount = sale.totalAmountInSats;

var totalMsg = _satCurrency.format(totalAmount, removeTrailingZeros: true);
var totalMsg = _satCurrency.format(totalAmount);
totalMsg = "$totalMsg ${_satCurrency.shortName}";
final totalAmountInFiat = sale.totalAmountInFiat;
if (totalAmountInFiat.length == 1) {
Expand All @@ -204,7 +204,6 @@ class PrintService {
);
final fiatTotalMsg = saleCurrency.format(
total,
removeTrailingZeros: true,
includeDisplayName: true,
);
totalMsg = "$totalMsg ($fiatTotalMsg)";
Expand Down Expand Up @@ -299,7 +298,7 @@ class PrintService {

String _buildPriceValue(CurrencyWrapper saleCurrency, double amount) {
if (saleCurrency.shortName == _satCurrency.shortName) {
final value = _satCurrency.format(amount, removeTrailingZeros: true);
final value = _satCurrency.format(amount);
return "$value ${_satCurrency.shortName}";
}
return saleCurrency.format(
Expand Down
Loading

0 comments on commit dc033a8

Please sign in to comment.