Skip to content

Commit

Permalink
Release v0.2.2 (#130)
Browse files Browse the repository at this point in the history
* Retry Web3WalletService init on SocketException

* Retry wc init on socket and timeout

* Update znn_ledger_dart dep (#121)

* Update znn dependencies (#122)

* Update zenon-node-database references

* Update deprecated TextStyle properties

* Ref znn deps by tag

* Fix create project description typo

* Add NotificationWidget to project details screen

* Update icon assets

* Fix incorrect icon sizes

* Update MacOS icons with trans border

* Update tray and linux icon

* feat: Upgrade flutter_staggered_grid_view to 0.7.0 - along with other dependencies

* feat: Remove unused dependency - screenshot

* feat: Add the WidgetAnimator back

* feat: Hide the TabBar divider

* feat: Show a progress indicator until the splash screen lottie finished loading

* fix: Override debug default target platform in debug mode

* fix: Remove overriding the debug default target platform in debug mode

* fix: Seed input fields

* cicd: upgrade Flutter to `3.24.3`

* Bumped version number to 0.2.2

---------

Co-authored-by: Alien Coder <[email protected]>
Co-authored-by: maznnwell <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent 9ac2b96 commit c8da966
Show file tree
Hide file tree
Showing 31 changed files with 486 additions and 308 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/syrius_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
FLUTTER_VERSION: "3.19.x"
FLUTTER_VERSION: "3.24.3"

jobs:
build-macos:
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Checkout zenon-node-database repository
uses: actions/checkout@v4
with:
repository: HyperCore-One/zenon-node-database
repository: zenon-network/zenon-node-database
path: ./node-db
ref: main
- name: Copy community nodes
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Checkout zenon-node-database repository
uses: actions/checkout@v4
with:
repository: HyperCore-One/zenon-node-database
repository: zenon-network/zenon-node-database
path: ./node-db
ref: main
- name: Copy community nodes
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Checkout zenon-node-database repository
uses: actions/checkout@v4
with:
repository: HyperCore-One/zenon-node-database
repository: zenon-network/zenon-node-database
path: ./node-db
ref: main
- name: Copy community nodes
Expand Down
Binary file modified assets/images/tray_app_icon.ico
Binary file not shown.
Binary file modified assets/images/tray_app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:async';
import 'dart:io';
import 'dart:isolate';

import 'package:flutter/foundation.dart'
show debugDefaultTargetPlatformOverride, kDebugMode;
import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
Expand All @@ -13,6 +13,7 @@ import 'package:logging/logging.dart';
import 'package:overlay_support/overlay_support.dart';
import 'package:path/path.dart' as path;
import 'package:provider/provider.dart';
import 'package:retry/retry.dart';
import 'package:tray_manager/tray_manager.dart';
import 'package:window_manager/window_manager.dart';
import 'package:zenon_syrius_wallet_flutter/blocs/auto_unlock_htlc_worker.dart';
Expand All @@ -36,17 +37,16 @@ import 'package:znn_sdk_dart/znn_sdk_dart.dart';
Zenon? zenon;
SharedPrefsService? sharedPrefsService;
HtlcSwapsService? htlcSwapsService;
IWeb3WalletService? web3WalletService;

final sl = GetIt.instance;

IWeb3WalletService? web3WalletService;
final globalNavigatorKey = GlobalKey<NavigatorState>();

main() async {
WidgetsFlutterBinding.ensureInitialized();

Provider.debugCheckInvalidValueType = null;
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;

ensureDirectoriesExist();
Hive.init(znnDefaultPaths.cache.path.toString());
Expand Down Expand Up @@ -83,7 +83,9 @@ main() async {
// Setup services
setup();

await web3WalletService!.init();
retry(() => web3WalletService!.init(),
retryIf: (e) => e is SocketException || e is TimeoutException,
maxAttempts: 0x7FFFFFFFFFFFFFFF);

// Setup local_notifier
await localNotifier.setup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class _NewWalletConfirmSeedScreenState
fontSize: 12.0,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.all(8.0),
isDense: true,
filled: true,
fillColor: Theme.of(context)
.colorScheme
Expand Down
3 changes: 3 additions & 0 deletions lib/screens/project_details_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class _ProjectDetailsScreenState extends State<ProjectDetailsScreen> {
),
],
),
NotificationWidget(
onSeeMorePressed: widget.onStepperNotificationSeeMorePressed,
),
Expanded(
child: _getStreamBuilder(),
),
Expand Down
32 changes: 17 additions & 15 deletions lib/screens/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,32 @@ class SplashScreen extends StatefulWidget {
State<SplashScreen> createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen>
with TickerProviderStateMixin {
late AnimationController _controller;
class _SplashScreenState extends State<SplashScreen> {
late final Future<LottieComposition> _composition;

@override
void initState() {
super.initState();
_controller = AnimationController(vsync: this);
_composition = AssetLottie('assets/lottie/ic_anim_splash.json').load();
}

@override
Widget build(BuildContext context) {
return Lottie.asset(
'assets/lottie/ic_anim_splash.json',
animate: true,
controller: _controller,
onLoaded: (composition) {
_controller
..duration = composition.duration
..forward().whenComplete(
() => _splashInits(),
return FutureBuilder<LottieComposition>(
future: _composition,
builder: (context, snapshot) {
var composition = snapshot.data;
if (composition != null) {
Future.delayed(composition.duration, () {
_splashInits();
});
return Lottie(
composition: composition,
repeat: false,
);
} else {
return const Center(child: CircularProgressIndicator());
}
},
);
}
Expand All @@ -73,7 +77,6 @@ class _SplashScreenState extends State<SplashScreen>
}

void _navigateToNextScreen() {
_controller.stop();
return kWalletPath != null
? _checkForDefaultNode()
: Navigator.pushReplacementNamed(
Expand Down Expand Up @@ -149,7 +152,6 @@ class _SplashScreenState extends State<SplashScreen>

@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
2 changes: 1 addition & 1 deletion lib/utils/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const SizedBox kSpacingBetweenActionButtons = SizedBox(
const Size kAcceleratorProgressBarSize = Size(300.0, 10.0);

// Wallet version
const String kWalletVersion = '0.2.1';
const String kWalletVersion = '0.2.2';

// Boxes constants
const String kFavoriteTokensBox = 'favourite_tokens_box';
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/main_app_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class _MainAppContainerState extends State<MainAppContainer>
width: 2.0,
),
),
dividerHeight: 0.0,
controller: _tabController,
tabs: _getTabs(),
),
Expand Down Expand Up @@ -753,7 +754,7 @@ class _MainAppContainerState extends State<MainAppContainer>
void _handleIncomingLinks() async {
if (!kIsWeb && !Platform.isLinux) {
_incomingLinkSubscription =
_appLinks.allUriLinkStream.listen((Uri? uri) async {
_appLinks.uriLinkStream.listen((Uri? uri) async {
if (!await windowManager.isFocused() ||
!await windowManager.isVisible()) {
windowManager.show();
Expand Down Expand Up @@ -1025,7 +1026,7 @@ class _MainAppContainerState extends State<MainAppContainer>
if (!_initialUriIsHandled) {
_initialUriIsHandled = true;
try {
final uri = await _appLinks.getInitialAppLink();
final uri = await _appLinks.getInitialLink();
if (uri != null) {
Logger('MainAppContainer').log(Level.INFO, '_handleInitialUri $uri');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CreateProject extends StatelessWidget {
return CardScaffold(
title: 'Create Project',
childBuilder: () => _getWidgetBody(context),
description: 'Innovate. Inspire. Buidl.',
description: 'Innovate. Inspire. Build.',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,26 @@ class _WalletConnectCameraCardState extends State<WalletConnectCameraCard> {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => AiBarcodeScanner(
validator: (value) {
return (canParseWalletConnectUri(value));
},
canPop: true,
onScan: (String value) async {
validator: (capture) => _filterBarcodes(capture) != null,
onDetect: (value) async {
Logger('WalletConnectCameraCard').log(
Level.INFO,
'onDetect',
value.toString(),
);
final wcService = sl.get<IWeb3WalletService>();
final pairingInfo =
await wcService.pair(Uri.parse(value));
Logger('WalletConnectCameraCard').log(Level.INFO,
'pairing info', pairingInfo.toJson());
setState(() {});
},
onScannerStarted: (p0) {
// Pop navigator and close camera after 10 seconds
Timer(const Duration(seconds: 30), () {
Navigator.pop(context);
});
Logger('WalletConnectCameraCard')
.log(Level.INFO, 'onScannerStarted');
},
onDetect: (p0) {
Logger('WalletConnectCameraCard')
.log(Level.INFO, 'onDetect', p0.toString());
final Barcode? barcode = _filterBarcodes(value);
if (barcode != null) {
final pairingInfo = await wcService.pair(
Uri.parse(value.barcodes.first.displayValue!),
);
Logger('WalletConnectCameraCard').log(
Level.INFO,
'pairing info',
pairingInfo.toJson(),
);
setState(() {});
}
},
onDispose: () {
Logger('WalletConnectCameraCard')
Expand Down Expand Up @@ -143,4 +140,18 @@ class _WalletConnectCameraCardState extends State<WalletConnectCameraCard> {
}
return false;
}

/// A BarcodeCapture can contain multiple barcodes. This function returns
/// the first valid WC barcode
Barcode? _filterBarcodes(BarcodeCapture capture) {
for (final barcode in capture.barcodes) {
final String? uri = barcode.displayValue;
if (uri != null) {
if (!canParseWalletConnectUri(uri)) {
return barcode;
}
}
}
return null;
}
}
3 changes: 2 additions & 1 deletion lib/widgets/reusable_widgets/chart/standard_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ class StandardChart extends StatelessWidget {
enabled: true,
touchTooltipData: LineTouchTooltipData(
fitInsideHorizontally: true,
tooltipBgColor: Theme.of(context).colorScheme.background,
tooltipMargin: 14.0,
tooltipPadding: const EdgeInsets.all(4.0),
tooltipRoundedRadius: 6.0,
getTooltipColor: (LineBarSpot lineBarSpot) =>
Theme.of(context).colorScheme.background,
getTooltipItems: (touchedSpots) {
return touchedSpots.map(
(LineBarSpot touchedSpot) {
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/reusable_widgets/dropdown/basic_dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BasicDropdown<T> extends StatelessWidget {
value: item,
child: Text(
item.label,
style: Theme.of(context).textTheme.bodyText2!.copyWith(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: _selectedValue == item
? onChangedCallback != null
? AppColors.znnColor
Expand Down
Loading

0 comments on commit c8da966

Please sign in to comment.