Skip to content

Commit

Permalink
Rearchitecture of Dashboard features (#131)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
maznnwell and kossmmos authored Dec 11, 2024
1 parent 85b76ce commit be86ca2
Show file tree
Hide file tree
Showing 513 changed files with 12,713 additions and 7,019 deletions.
14 changes: 7 additions & 7 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
channel: stable
revision: "2663184aa79047d0a33a14a3b607954f8fdd8730"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
- platform: windows
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730

# User provided section

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

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

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
avoid_print: true # Uncomment to disable the `avoid_print` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
cancel_subscriptions: true
close_sinks: true
comment_references: true
one_member_abstracts: true
always_use_package_imports: true
avoid_empty_else: true
avoid_slow_async_io: true
avoid_web_libraries_in_flutter: true
control_flow_in_finally: true
empty_statements: true
depend_on_referenced_packages: true
secure_pubspec_urls: true
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
# Always specifying types will make an unfamiliar codebase more readable for a new developer
# More details about the rule:
# https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c#file-analysis_options-yaml-L138
always_specify_types: true
# This rule is in contradiction with always_specify_types, so it must be disabled if the other
# one is enabled
omit_local_variable_types: false
3 changes: 3 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
1 change: 0 additions & 1 deletion lib/blocs/accelerator/accelerator.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
library accelerator;

export 'accelerator_balance_bloc.dart';
export 'create_phase_bloc.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/accelerator/accelerator_balance_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AcceleratorBalanceBloc extends BaseBloc<AccountInfo?> {
Future<void> getAcceleratorBalance() async {
try {
addEvent(null);
AccountInfo accountInfo = await zenon!.ledger.getAccountInfoByAddress(
final AccountInfo accountInfo = await zenon!.ledger.getAccountInfoByAddress(
acceleratorAddress,
);
if (accountInfo.qsr()! > BigInt.zero ||
Expand Down
8 changes: 3 additions & 5 deletions lib/blocs/accelerator/create_phase_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
) async {
try {
addEvent(null);
AccountBlockTemplate transactionParams =
final AccountBlockTemplate transactionParams =
zenon!.embedded.accelerator.addPhase(
id,
name,
Expand All @@ -25,12 +25,10 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
);
AccountBlockUtils.createAccountBlock(transactionParams, 'create phase')
.then(
(block) => addEvent(block),
addEvent,
)
.onError(
(error, stackTrace) {
addError(error, stackTrace);
},
addError,
);
} catch (e, stackTrace) {
addError(e, stackTrace);
Expand Down
10 changes: 5 additions & 5 deletions lib/blocs/accelerator/create_project_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:zenon_syrius_wallet_flutter/utils/utils.dart';
Expand All @@ -13,7 +15,7 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
) {
try {
addEvent(null);
AccountBlockTemplate transactionParams =
final AccountBlockTemplate transactionParams =
zenon!.embedded.accelerator.createProject(
name,
description,
Expand All @@ -25,14 +27,12 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
transactionParams,
'creating project',
).then(
(block) {
(AccountBlockTemplate block) {
ZenonAddressUtils.refreshBalance();
addEvent(block);
},
).onError(
(error, stackTrace) {
addError(error, stackTrace);
},
addError,
);
} catch (e, stackTrace) {
addError(e, stackTrace);
Expand Down
Loading

0 comments on commit be86ca2

Please sign in to comment.