Skip to content

Commit be86ca2

Browse files
maznnwellkossmmos
andauthored
Rearchitecture of Dashboard features (#131)
* feat: Create dev run configuration * refactor: dashboard blocs. * mods: delegation cubit. tests. * mods: delegation cubit - tests. * feat: Improve the DashboardCubit class * feat: Finish the delegation widgets * feat: Use a CardData object to hold the title and description of a card * feat: Fill up the balance widgets * fix: Assign the correct card data to the CardType.balance value * feat: Improve the DashboardCubit so that the cubits that implement it can specify the state * feat: Fill up the dual coin stats widgets * fix: Navigate after the current frame finished rendering * fix: Apply fixes with dart fix --apply * fix: Use the super parameters * refactor: Replace deprecated methods or classes * feat: Use very_good_analysis for linter rules and solve some issues with dart fix --apply * feat: Add localization * feat: Exemplify how to use AppLocalizations * feat: Enable l10n for the dev entry point also * fix: Regenerate the windows folder * refactor: Delete unused widgets * feat: Add documentation of public members inside the dual_coin_stats folder * feat: Replace Pillars with PillarsCard * feat: Replace RealtimeStatistics with RealtimeStatisticsCard * feat: Fill up the sentinels widgets * refactor: Change fields' order * fix: Documentation * feat: Fill the staking widgets * fix: Documentation * feat: Fill up the total hourly transactions widgets * feat: Delete unused blocs * feat: Tweak balance features * refactor: Delete unused bloc * feat: Create the node sync status feature * feat: Delete unused class * feat: Adapt Transfer widget to the new architecture * chore: Redo dashboard.dart exports * chore: Delete unused feature balance_dashboard * feat: Use localization version strings for generating CardData objects * chore: Improve documentation * chore: Rename CubitStatus class to DashboardStatus * chore: Improve documentation of the balance feature * chore: Improve documentation and solve linter issues * feat: Make the DashboardCubit a HydratedCubit * feat: Make custom exceptions serializable and move them to separated feature folders * feat: Structure the error handling mechanism * feat: Localize some strings * refactor: Make custom exceptions extend from DashboardCubitException * refactor: Restructure new code in a single folder * chore: Move node_sync_status inside features folder * chore: Improve documentation * feat: Add always_specify_types to the linter rules and run dart fix * chore: Solve linter hints in rearchitecture folder * chore: Improve documentation * chore: Create and use the state_copy_with documentation template * feat: transfer BLoC rearchitecture complete. added receive_transaction & transfer_widget_balance * feat: Add tests for delegation cubit * feat: Add asserts for the TimerState class * feat: Restructure exceptions * feat: Improve error logging * chore: Update Zenon SDK * chore: Delete flutter_lints dependency * chore: Update dependencies * feat: Change the interval at which the node sync status is fetched * chore: Rename and change location of a refresh interval constant * feat: Don't emit the loading state if the current one has a success status * feat: Add required named parameters to the TimerCubit constructor * feat: Run dart format in rearchitecture folder * feat: Delete the CubitException class * testing dashboard wip * chore: Improve documentation * testing dashboard wip * feat: Create constants for specific UI gaps * feat: dashboard unit testing added * removed unused import * node sync status tests added * feat: Create the new app themes and improve the UI of the back of the new card scaffold * feat: Create a cubit for hiding the front widget of the NewCardScaffold * feat: Log errors * feat: Make password field obscure text by default * feat: Create the newTheme and isDarkMode getters to the BuildContextExtension * feat: Rename local variable * feat: Delete the font specification from the new themes * fix: Getting setting and getting the new theme * chore: Rename 'newTheme' getter to 'theme' * feat: Adapt widgets to the new theme data * chore: Rename getter 'theme' to 'themeData' * refactor: Cubit initializations * chore: Use documentation templates for cubit state's fromJson and toJson * fix: Some tests * chore: Improve documentation * feat: Align the text field and the button on the center axis * chore: Repair dart analysis hints * feat: Remove styling from left side chart titles and use the default generated Y interval * feat: Revert some Windows changes * feat: Associated a custom URL deep linking scheme with the app - on Windows * feat: Restore bundling local libraries * feat: Restore updating Git metadata * fix: Fetching the dlls that will be installed in the Windows app folder and re-enable the generation of git metadata * shell script modified * build generated changes * fix: Fetching the dlls that will be installed in the Linux app folder * fix: Finding the correct path for .so files * feat: Update znn sdk and ledger * feat: Reset local git metadata * feat: Init kNumOfPillars --------- Co-authored-by: kossmmos <[email protected]>
1 parent 85b76ce commit be86ca2

File tree

513 files changed

+12713
-7019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

513 files changed

+12713
-7019
lines changed

.metadata

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled.
4+
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
8-
channel: stable
7+
revision: "2663184aa79047d0a33a14a3b607954f8fdd8730"
8+
channel: "stable"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
17-
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
16+
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
17+
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
1818
- platform: windows
19-
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
20-
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
19+
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
20+
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
2121

2222
# User provided section
2323

analysis_options.yaml

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,21 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
1+
include: package:very_good_analysis/analysis_options.yaml
72

8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
10-
include: package:flutter_lints/flutter.yaml
3+
analyzer:
4+
exclude:
5+
- "**/*.g.dart"
6+
language:
7+
# I've disabled it so as to make the code compile without
8+
# strict type-checking
9+
strict-casts: false
10+
strict-inference: false
11+
strict-raw-types: false
1112

1213
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
2414
rules:
25-
avoid_print: true # Uncomment to disable the `avoid_print` rule
26-
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
cancel_subscriptions: true
28-
close_sinks: true
29-
comment_references: true
30-
one_member_abstracts: true
31-
always_use_package_imports: true
32-
avoid_empty_else: true
33-
avoid_slow_async_io: true
34-
avoid_web_libraries_in_flutter: true
35-
control_flow_in_finally: true
36-
empty_statements: true
37-
depend_on_referenced_packages: true
38-
secure_pubspec_urls: true
39-
# Additional information about this file can be found at
40-
# https://dart.dev/guides/language/analysis-options
15+
# Always specifying types will make an unfamiliar codebase more readable for a new developer
16+
# More details about the rule:
17+
# https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c#file-analysis_options-yaml-L138
18+
always_specify_types: true
19+
# This rule is in contradiction with always_specify_types, so it must be disabled if the other
20+
# one is enabled
21+
omit_local_variable_types: false

l10n.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
arb-dir: lib/l10n
2+
template-arb-file: app_en.arb
3+
output-localization-file: app_localizations.dart

lib/blocs/accelerator/accelerator.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
library accelerator;
21

32
export 'accelerator_balance_bloc.dart';
43
export 'create_phase_bloc.dart';

lib/blocs/accelerator/accelerator_balance_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AcceleratorBalanceBloc extends BaseBloc<AccountInfo?> {
88
Future<void> getAcceleratorBalance() async {
99
try {
1010
addEvent(null);
11-
AccountInfo accountInfo = await zenon!.ledger.getAccountInfoByAddress(
11+
final AccountInfo accountInfo = await zenon!.ledger.getAccountInfoByAddress(
1212
acceleratorAddress,
1313
);
1414
if (accountInfo.qsr()! > BigInt.zero ||

lib/blocs/accelerator/create_phase_bloc.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
1414
) async {
1515
try {
1616
addEvent(null);
17-
AccountBlockTemplate transactionParams =
17+
final AccountBlockTemplate transactionParams =
1818
zenon!.embedded.accelerator.addPhase(
1919
id,
2020
name,
@@ -25,12 +25,10 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
2525
);
2626
AccountBlockUtils.createAccountBlock(transactionParams, 'create phase')
2727
.then(
28-
(block) => addEvent(block),
28+
addEvent,
2929
)
3030
.onError(
31-
(error, stackTrace) {
32-
addError(error, stackTrace);
33-
},
31+
addError,
3432
);
3533
} catch (e, stackTrace) {
3634
addError(e, stackTrace);

lib/blocs/accelerator/create_project_bloc.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:async';
2+
13
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
24
import 'package:zenon_syrius_wallet_flutter/main.dart';
35
import 'package:zenon_syrius_wallet_flutter/utils/utils.dart';
@@ -13,7 +15,7 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
1315
) {
1416
try {
1517
addEvent(null);
16-
AccountBlockTemplate transactionParams =
18+
final AccountBlockTemplate transactionParams =
1719
zenon!.embedded.accelerator.createProject(
1820
name,
1921
description,
@@ -25,14 +27,12 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
2527
transactionParams,
2628
'creating project',
2729
).then(
28-
(block) {
30+
(AccountBlockTemplate block) {
2931
ZenonAddressUtils.refreshBalance();
3032
addEvent(block);
3133
},
3234
).onError(
33-
(error, stackTrace) {
34-
addError(error, stackTrace);
35-
},
35+
addError,
3636
);
3737
} catch (e, stackTrace) {
3838
addError(e, stackTrace);

0 commit comments

Comments
 (0)