Skip to content

Commit

Permalink
social recovery WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn committed Jun 4, 2020
1 parent d549811 commit 737fb15
Show file tree
Hide file tree
Showing 28 changed files with 985 additions and 227 deletions.
16 changes: 0 additions & 16 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,13 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
290C6EF024874ED200C3561B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2E5C930B0B11FFACB230966 /* Pods_Runner.framework */; };
290C6EF124874ED200C3561B /* Pods_Runner.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E2E5C930B0B11FFACB230966 /* Pods_Runner.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
290C6EF224874ED200C3561B /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
290C6EF124874ED200C3561B /* Pods_Runner.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0FB4ED323DB222DAED23878A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -150,7 +135,6 @@
97C146EC1CF9000F007C117D /* Resources */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
D7418BA1FC2C4B910CFCF420 /* [CP] Embed Pods Frameworks */,
290C6EF224874ED200C3561B /* Embed Frameworks */,
);
buildRules = (
);
Expand Down
20 changes: 14 additions & 6 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ import 'package:polka_wallet/page/profile/aboutPage.dart';
import 'package:polka_wallet/page/profile/account/accountManagePage.dart';
import 'package:polka_wallet/page/profile/account/changeNamePage.dart';
import 'package:polka_wallet/page/profile/account/changePasswordPage.dart';
import 'package:polka_wallet/page/profile/account/createRecoveryPage.dart';
import 'package:polka_wallet/page/profile/account/exportAccountPage.dart';
import 'package:polka_wallet/page/profile/account/exportResultPage.dart';
import 'package:polka_wallet/page/profile/account/friendListPage.dart';
import 'package:polka_wallet/page/profile/account/recoverySettingPage.dart';
import 'package:polka_wallet/page/profile/recovery/createRecoveryPage.dart';
import 'package:polka_wallet/page/profile/recovery/friendListPage.dart';
import 'package:polka_wallet/page/profile/recovery/initiateRecoveryPage.dart';
import 'package:polka_wallet/page/profile/recovery/recoveryProofPage.dart';
import 'package:polka_wallet/page/profile/recovery/recoverySettingPage.dart';
import 'package:polka_wallet/page/profile/contacts/contactListPage.dart';
import 'package:polka_wallet/page/profile/contacts/contactPage.dart';
import 'package:polka_wallet/page/profile/contacts/contactsPage.dart';
import 'package:polka_wallet/page/profile/recovery/recoveryStatePage.dart';
import 'package:polka_wallet/page/profile/recovery/vouchRecoveryPage.dart';
import 'package:polka_wallet/page/profile/settings/remoteNodeListPage.dart';
import 'package:polka_wallet/page/profile/settings/settingsPage.dart';
import 'package:polka_wallet/page/profile/settings/ss58PrefixListPage.dart';
Expand Down Expand Up @@ -252,12 +256,16 @@ class _WalletAppState extends State<WalletApp> {
SettingsPage(_appStore.settings, _changeLang),
ExportAccountPage.route: (_) => ExportAccountPage(_appStore.account),
ExportResultPage.route: (_) => ExportResultPage(),
RecoverySettingPage.route: (_) => RecoverySettingPage(_appStore),
CreateRecoveryPage.route: (_) => CreateRecoveryPage(_appStore),
FriendListPage.route: (_) => FriendListPage(_appStore),
RemoteNodeListPage.route: (_) => RemoteNodeListPage(_appStore.settings),
SS58PrefixListPage.route: (_) => SS58PrefixListPage(_appStore.settings),
AboutPage.route: (_) => AboutPage(),
RecoverySettingPage.route: (_) => RecoverySettingPage(_appStore),
RecoveryStatePage.route: (_) => RecoveryStatePage(_appStore),
RecoveryProofPage.route: (_) => RecoveryProofPage(_appStore),
CreateRecoveryPage.route: (_) => CreateRecoveryPage(_appStore),
FriendListPage.route: (_) => FriendListPage(_appStore),
InitiateRecoveryPage.route: (_) => InitiateRecoveryPage(_appStore),
VouchRecoveryPage.route: (_) => VouchRecoveryPage(_appStore),

// acala-network
SwapPage.route: (_) => SwapPage(_appStore),
Expand Down
38 changes: 38 additions & 0 deletions lib/common/components/TxList.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:polka_wallet/page/staking/actions/stakingDetailPage.dart';
import 'package:polka_wallet/store/staking/types/txData.dart';

class TxList extends StatelessWidget {
TxList(this.txs);

final List<TxData> txs;

@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: txs.length,
itemBuilder: (_, i) {
return ListTile(
leading: Container(
padding: EdgeInsets.only(top: 8),
child: txs[i].success
? Icon(Icons.check_circle, color: Colors.green)
: Icon(Icons.error, color: Colors.red),
),
title: Text(txs[i].call),
subtitle: Text(DateTime.fromMillisecondsSinceEpoch(
txs[i].blockTimestamp * 1000)
.toIso8601String()),
trailing: Container(
width: 80,
child: Text(txs[i].txNumber),
),
onTap: () {
Navigator.of(context)
.pushNamed(StakingDetailPage.route, arguments: txs[i]);
},
);
});
}
}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:polka_wallet/app.dart';

import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:polka_wallet/service/notification.dart';
import 'package:polka_wallet/service/polkascan.dart';
import 'package:polka_wallet/service/subscan.dart';

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand Down
2 changes: 1 addition & 1 deletion lib/page-acala/homePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _AcalaHomePageState extends State<AcalaHomePage> {
// case 2:
// return Governance(store);
default:
return Profile(store.account);
return Profile(store);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/page/assets/asset/assetPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'package:polka_wallet/common/consts/settings.dart';
import 'package:polka_wallet/page/assets/receive/receivePage.dart';
import 'package:polka_wallet/page/assets/transfer/detailPage.dart';
import 'package:polka_wallet/page/assets/transfer/transferPage.dart';
import 'package:polka_wallet/service/subscan.dart';
import 'package:polka_wallet/service/substrateApi/api.dart';
import 'package:polka_wallet/service/polkascan.dart';
import 'package:polka_wallet/store/app.dart';
import 'package:polka_wallet/store/assets/types/balancesInfo.dart';
import 'package:polka_wallet/store/assets/types/transferData.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/page/homePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class _HomePageState extends State<HomePage> {
case 2:
return Governance(store);
default:
return Profile(store.account);
return Profile(store);
}
}

Expand Down
7 changes: 0 additions & 7 deletions lib/page/profile/account/accountManagePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:polka_wallet/common/components/passwordInputDialog.dart';
import 'package:polka_wallet/page/profile/account/changeNamePage.dart';
import 'package:polka_wallet/page/profile/account/changePasswordPage.dart';
import 'package:polka_wallet/page/profile/account/exportAccountPage.dart';
import 'package:polka_wallet/page/profile/account/recoverySettingPage.dart';
import 'package:polka_wallet/service/substrateApi/api.dart';
import 'package:polka_wallet/store/app.dart';
import 'package:polka_wallet/utils/format.dart';
Expand Down Expand Up @@ -96,12 +95,6 @@ class AccountManagePage extends StatelessWidget {
onTap: () => Navigator.of(context)
.pushNamed(ExportAccountPage.route),
),
// ListTile(
// title: Text(dic['recovery']),
// trailing: Icon(Icons.arrow_forward_ios, size: 18),
// onTap: () => Navigator.of(context)
// .pushNamed(RecoverySettingPage.route),
// ),
],
),
),
Expand Down
92 changes: 0 additions & 92 deletions lib/page/profile/account/friendListPage.dart

This file was deleted.

11 changes: 11 additions & 0 deletions lib/page/profile/contacts/contactListPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:polka_wallet/common/components/accountSelectList.dart';
import 'package:polka_wallet/page/profile/contacts/contactPage.dart';
import 'package:polka_wallet/store/settings.dart';
import 'package:polka_wallet/utils/i18n/index.dart';

Expand All @@ -18,6 +19,16 @@ class ContactListPage extends StatelessWidget {
appBar: AppBar(
title: Text(I18n.of(context).profile['contact']),
centerTitle: true,
actions: <Widget>[
Padding(
padding: EdgeInsets.only(right: 8),
child: IconButton(
icon: Icon(Icons.add, size: 28),
onPressed: () =>
Navigator.of(context).pushNamed(ContactPage.route),
),
)
],
),
body: Padding(
padding: EdgeInsets.only(top: 8, left: 8),
Expand Down
31 changes: 15 additions & 16 deletions lib/page/profile/contacts/contactsPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ class ContactsPage extends StatelessWidget {
@override
Widget build(BuildContext context) => Observer(
builder: (_) {
List<Widget> ls = store.contactList.map((i) {
return ListTile(
leading: AddressIcon(i.address),
title: Text(Fmt.accountName(context, i)),
subtitle: Text(Fmt.address(i.address)),
trailing: IconButton(
icon: Icon(Icons.more_vert),
onPressed: () => _showActions(context, i),
),
);
}).toList();
return Scaffold(
appBar: AppBar(
title: Text(I18n.of(context).profile['contact']),
Expand All @@ -104,11 +93,21 @@ class ContactsPage extends StatelessWidget {
],
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.only(top: 8, left: 8),
child: ListView(
children: ls,
),
child: ListView(
children: store.contactList.map((i) {
return ListTile(
leading: AddressIcon(i.address),
title: Text(Fmt.accountName(context, i)),
subtitle: Text(Fmt.address(i.address)),
trailing: Container(
width: 36,
child: IconButton(
icon: Icon(Icons.more_vert),
onPressed: () => _showActions(context, i),
),
),
);
}).toList(),
),
),
);
Expand Down
Loading

0 comments on commit 737fb15

Please sign in to comment.