Skip to content

Commit

Permalink
Update charts (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
KingGorrin authored Feb 14, 2024
1 parent b07a103 commit 6864cd8
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 36 deletions.
8 changes: 4 additions & 4 deletions lib/screens/export/export_wallet_password_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class _ExportWalletPasswordScreenState
initialDirectory =
(await getApplicationDocumentsDirectory()).path;
}
final walletPath = await getSavePath(
final walletPath = await getSaveLocation(
acceptedTypeGroups: <XTypeGroup>[
const XTypeGroup(
label: 'file',
Expand All @@ -161,17 +161,17 @@ class _ExportWalletPasswordScreenState
if (walletPath != null) {
KeyStoreManager keyStoreManager = KeyStoreManager(
walletPath: Directory(
path.dirname(walletPath),
path.dirname(walletPath.path),
),
);
KeyStore keyStore = KeyStore.fromMnemonic(widget.seed);
await keyStoreManager.saveKeyStore(
keyStore,
_passwordController.text,
name: path.basename(walletPath),
name: path.basename(walletPath.path),
);
if (widget.backupWalletFlow) {
_sendSuccessNotification(walletPath);
_sendSuccessNotification(walletPath.path);
} else {
_updateExportedSeedList();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/charts/realtime_txs_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RealtimeTxsChartState extends State<RealtimeTxsChart> {
}

double _getTransactionsByDay(TokenStandard tokenId, DateTime date) {
var transactions = [];
List<AccountBlock> transactions = [];
for (var transaction in widget.transactions) {
AccountBlock? pairedAccountBlock;
if (transaction.blockType == 3 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/utils/color_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/constants.dart';
import 'package:zenon_syrius_wallet_flutter/utils/zts_utils.dart';
import 'package:zenon_syrius_wallet_flutter/widgets/widgets.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';
Expand Down Expand Up @@ -39,9 +38,9 @@ class _RealtimeStatisticsState extends State<RealtimeStatistics> {
}

Widget _widgetBody(List<AccountBlock> list) {
return Column(
children: [
kVerticalSpacing,
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand All @@ -60,10 +59,8 @@ class _RealtimeStatisticsState extends State<RealtimeStatistics> {
),
],
),
Expanded(
child: RealtimeTxsChart(list),
),
],
Expanded(child: RealtimeTxsChart(list)),
]),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ class _PillarsListWidgetState extends State<PillarsListWidget> {

@override
void dispose() {
_scrollController.dispose();
_pillarsListBloc.dispose();
_blocListingStateSubscription.cancel();
super.dispose();
Expand Down
7 changes: 3 additions & 4 deletions lib/widgets/reusable_widgets/chart/standard_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class StandardChart extends StatelessWidget {
drawVerticalLine: false,
drawHorizontalLine: true,
getDrawingHorizontalLine: (_) {
return FlLine(
return const FlLine(
strokeWidth: 1.0,
color: Colors.black87,
dashArray: [3, 3],
Expand Down Expand Up @@ -109,12 +109,12 @@ class StandardChart extends StatelessWidget {
reservedSize: 26.0,
),
),
rightTitles: AxisTitles(
rightTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
topTitles: AxisTitles(
topTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
)),
Expand All @@ -126,7 +126,6 @@ class StandardChart extends StatelessWidget {
minY: 0.0,
lineBarsData: lineBarsData,
),
swapAnimationDuration: const Duration(milliseconds: 250),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:zenon_syrius_wallet_flutter/utils/app_colors.dart';

class StandardLineChartBarData extends LineChartBarData {
StandardLineChartBarData({
required Color color,
required List<FlSpot>? spots,
}) : super(
spots: spots,
isCurved: false,
color: color,
barWidth: 3.0,
isStrokeCapRound: true,
dotData: FlDotData(
show: true,
),
belowBarData: BarAreaData(
show: true,
gradient: LinearGradient(
colors: [
AppColors.znnColor.withOpacity(0.5),
AppColors.znnColor.withOpacity(0.0),
],
stops: const [0.1, 1.0],
),
),
spots: spots ?? const []
);
}
1 change: 1 addition & 0 deletions lib/widgets/reusable_widgets/infinite_scroll_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class _InfiniteScrollTableState<T> extends State<InfiniteScrollTable<T>> {

@override
void dispose() {
_scrollController.dispose();
_pagingController.dispose();
_blocListingStateSubscription.cancel();
if (widget.disposeBloc) {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ packages:
dependency: "direct main"
description:
name: fl_chart
sha256: "48a1b69be9544e2b03d9a8e843affd89e43f3194c9248776222efcb4206bb1ec"
sha256: c1e26c7e48496be85104c16c040950b0436674cdf0737f3f6e95511b2529b592
url: "https://pub.dev"
source: hosted
version: "0.62.0"
version: "0.63.0"
flip_card:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
flutter:
sdk: flutter

fl_chart: ^0.62.0
fl_chart: ^0.63.0
overlay_support: ^2.1.0
lottie: ^2.1.0
dotted_border: ^2.0.0+2
Expand Down

0 comments on commit 6864cd8

Please sign in to comment.