Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ analysis_benchmark.json
.packages.generated

# Flutter/Dart/Pub related
**/lib/firebase_options.dart
**/doc/api/
.dart_tool/
.flutter-plugins
Expand Down
2 changes: 1 addition & 1 deletion mobile-app/lib/features/main/screens/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class _ResonanceWalletAppState extends ConsumerState<ResonanceWalletApp> {
if (FeatureFlags.enableRemoteNotifications) {
ref.read(firebaseMessagingServiceProvider).setupNotificationTapHandlers(navigatorKey);
}

if (Platform.isAndroid) _referralService.checkPlayStoreReferralCode();
});
}
Expand Down
43 changes: 43 additions & 0 deletions mobile-app/lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;
import 'package:resonance_network_wallet/utils/env_utils.dart';

/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions getOptionsForEnvironment() {
if (kIsWeb) throw UnsupportedError('Web not configured');

switch (defaultTargetPlatform) {
case TargetPlatform.android:
return FirebaseOptions(
apiKey: EnvUtils.androidFirebaseApiKey,
appId: '1:700047185713:android:151f32080a837021d98210',
messagingSenderId: '700047185713',
projectId: 'quantus-wallet',
storageBucket: 'quantus-wallet.firebasestorage.app',
);
case TargetPlatform.iOS:
return FirebaseOptions(
apiKey: EnvUtils.iosFirebaseApiKey,
appId: '1:700047185713:ios:4689e532e8a4f174d98210',
messagingSenderId: '700047185713',
projectId: 'quantus-wallet',
storageBucket: 'quantus-wallet.firebasestorage.app',
iosBundleId: 'com.quantus.mobile-wallet',
);
default:
throw UnsupportedError('Platform not supported');
}
}
}
2 changes: 1 addition & 1 deletion mobile-app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() async {
await Supabase.initialize(url: EnvUtils.supabaseUrl, anonKey: EnvUtils.supabaseKey);
await QuantusSdk.init();
if (FeatureFlags.enableRemoteNotifications) {
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
await Firebase.initializeApp(options: DefaultFirebaseOptions.getOptionsForEnvironment());
}

Telemetrydecksdk.start(
Expand Down
2 changes: 1 addition & 1 deletion mobile-app/lib/services/transaction_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class TransactionService {

void navigateToTransactionFromPayloadIfPossible(Map<String, dynamic>? json, GlobalKey<NavigatorState> navigatorKey) {
final event = deserializeTxEventFromJsonIfPossible(json);

if (event != null) {
_ref.read(transactionIntentProvider.notifier).state = event;
navigatorKey.currentState?.pushNamed('/transactions');
Expand Down
16 changes: 16 additions & 0 deletions mobile-app/lib/utils/env_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ class EnvUtils {
return key;
}

static String get iosFirebaseApiKey {
final key = dotenv.env['IOS_FIREBASE_API_KEY'];
if (key == null || key.isEmpty) {
throw Exception('IOS_FIREBASE_API_KEY is not set in .env file');
}
return key;
}

static String get androidFirebaseApiKey {
final key = dotenv.env['ANDROID_FIREBASE_API_KEY'];
if (key == null || key.isEmpty) {
throw Exception('ANDROID_FIREBASE_API_KEY is not set in .env file');
}
return key;
}

static String? getEnv(String key) {
return dotenv.env[key];
}
Expand Down
13 changes: 11 additions & 2 deletions mobile-app/lib/v2/components/glass_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ class GlassContainer extends StatelessWidget {
wideAsset: Rect.fromLTRB(_inset, _inset, 1020 - _inset, 168 - _inset),
};

double get defaultHeight => asset == smallAsset ? 40 : asset == mediumSmallAsset ? 36 : 56;
double get defaultHeight => asset == smallAsset
? 40
: asset == mediumSmallAsset
? 36
: 56;

const GlassContainer({
super.key,
Expand All @@ -49,7 +53,12 @@ class GlassContainer extends StatelessWidget {
),
if (filled)
Positioned.fill(
child: DecoratedBox(decoration: BoxDecoration(color: Colors.white.withValues(alpha: 0.1), borderRadius: BorderRadius.circular(14))),
child: DecoratedBox(
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(14),
),
),
),
Positioned.fill(
child: Padding(
Expand Down
6 changes: 4 additions & 2 deletions mobile-app/lib/v2/screens/home/activity_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ActivitySection extends ConsumerWidget {
const SizedBox(height: 40),
_header(colors, text, context),
const SizedBox(height: 24),

...recentTransactions.mapIndexed((index, tx) {
final data = TxItemData.from(tx, activeAccount.accountId);
final isLastItem = index == recentTransactions.length - 1;
Expand Down Expand Up @@ -137,7 +137,9 @@ class ActivitySection extends ConsumerWidget {
'View All',
style: text.paragraph?.copyWith(
color: Colors.transparent,
shadows: [Shadow(color: colors.textSecondary, offset: const Offset(0, -2))], // Shadow trick to create gap between text and underline
shadows: [
Shadow(color: colors.textSecondary, offset: const Offset(0, -2)),
], // Shadow trick to create gap between text and underline
decoration: TextDecoration.underline,
decorationColor: colors.textSecondary,
decorationStyle: TextDecorationStyle.solid,
Expand Down
12 changes: 11 additions & 1 deletion mobile-app/lib/v2/screens/settings/recovery_phrase_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,17 @@ class _RecoveryPhraseScreenState extends State<RecoveryPhraseScreen> {
);

return SizedBox(
child: GlassContainer(asset: GlassContainer.mediumSmallAsset, filled: true, child: Row(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [const SizedBox(width: 8), Text('$index', style: text.detail?.copyWith(color: colors.textSecondary)), const SizedBox(width: 6), Expanded(
child: GlassContainer(
asset: GlassContainer.mediumSmallAsset,
filled: true,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(width: 8),
Text('$index', style: text.detail?.copyWith(color: colors.textSecondary)),
const SizedBox(width: 6),
Expanded(
child: Stack(
alignment: Alignment.centerLeft,
children: [
Expand Down
3 changes: 2 additions & 1 deletion mobile-app/lib/v2/screens/swap/deposit_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ class _DepositScreenState extends State<DepositScreen> {
child: Container(
color: Colors.white,
padding: const EdgeInsets.all(8),

/// for now this QR Code is invalid so people don't transfer by accident
// child: QrImageView(data: _order.depositAddress, version: QrVersions.auto, size: 184),
// child: QrImageView(data: _order.depositAddress, version: QrVersions.auto, size: 184),
child: QrImageView(data: 'quantum secure bitcoin - quantus!', version: QrVersions.auto, size: 184),
),
),
Expand Down