Skip to content

Commit

Permalink
Merge pull request #501 from ardriveapp/dev
Browse files Browse the repository at this point in the history
Release v1.17.0
  • Loading branch information
fedellen authored May 18, 2022
2 parents 7732099 + 1c31388 commit 57a917b
Show file tree
Hide file tree
Showing 13 changed files with 1,040 additions and 208 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.dart]
indent_brace_style = K&R
10 changes: 5 additions & 5 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include: package:pedantic/analysis_options.yaml
include: package:flutter_lints/flutter.yaml

analyzer:
plugins:
- moor

exclude:
- 'lib/services/arweave/graphql/**'
- '**.g.dart'
linter:
rules:
- prefer_final_locals

57 changes: 46 additions & 11 deletions lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:url_launcher/url_launcher.dart';

import 'blocs/blocs.dart';
import 'components/components.dart';
import 'components/progress_bar.dart';
import 'components/wallet_switch_dialog.dart';
import 'utils/app_localizations_wrapper.dart';

Expand Down Expand Up @@ -94,17 +95,44 @@ class _AppShellState extends State<AppShell> {
.isCurrentProfileArConnect(),
builder: (BuildContext context,
AsyncSnapshot snapshot) {
if (snapshot.data ?? false) {
return ProgressDialog(
title: appLocalizationsOf(context)
.syncingPleaseRemainOnThisTab,
);
} else {
return ProgressDialog(
title: appLocalizationsOf(context)
.syncingPleaseWait,
);
}
return ProgressDialog(
progressBar: ProgressBar(
percentage: context
.read<SyncCubit>()
.syncProgressController
.stream,
),
percentageDetails: _syncStreamBuilder(
builderWithData: (syncProgress) =>
Text(appLocalizationsOf(context)
.syncProgressPercentage(
(syncProgress.progress *
100)
.roundToDouble()
.toString()))),
progressDescription: _syncStreamBuilder(
builderWithData: (syncProgress) => Text(
syncProgress.drivesCount == 0
? ''
: syncProgress.drivesCount > 1
? appLocalizationsOf(context)
.driveSyncedOfDrivesCount(
syncProgress
.drivesSynced,
syncProgress
.drivesCount)
: appLocalizationsOf(context)
.syncingOnlyOneDrive,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
),
),
title: snapshot.data ?? false
? appLocalizationsOf(context)
.syncingPleaseRemainOnThisTab
: appLocalizationsOf(context)
.syncingPleaseWait);
},
);
},
Expand Down Expand Up @@ -144,6 +172,13 @@ class _AppShellState extends State<AppShell> {
},
);

Widget _syncStreamBuilder(
{required Widget Function(SyncProgress s) builderWithData}) =>
StreamBuilder<SyncProgress>(
stream: context.read<SyncCubit>().syncProgressController.stream,
builder: (context, snapshot) =>
snapshot.hasData ? builderWithData(snapshot.data!) : Container());

void toggleProfileOverlay() =>
setState(() => _showProfileOverlay = !_showProfileOverlay);
}
Loading

0 comments on commit 57a917b

Please sign in to comment.