mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-25 08:39:06 +00:00
Fix issues from code review
This commit is contained in:
parent
4bc81242fc
commit
88e245e480
3 changed files with 14 additions and 12 deletions
|
@ -24,7 +24,6 @@ class DesktopDashboardPage extends StatelessWidget {
|
||||||
final WalletAddressListViewModel addressListViewModel;
|
final WalletAddressListViewModel addressListViewModel;
|
||||||
|
|
||||||
static final GlobalKey<NavigatorState> desktopKey = GlobalKey<NavigatorState>();
|
static final GlobalKey<NavigatorState> desktopKey = GlobalKey<NavigatorState>();
|
||||||
static final GlobalKey kex = GlobalKey();
|
|
||||||
|
|
||||||
bool _isEffectsInstalled = false;
|
bool _isEffectsInstalled = false;
|
||||||
StreamSubscription<bool>? _onInactiveSub;
|
StreamSubscription<bool>? _onInactiveSub;
|
||||||
|
|
|
@ -16,7 +16,7 @@ class DesktopSettingsPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||||
final List<SettingActions> _allItems = [];
|
final int itemCount = SettingActions.desktopSettings.length;
|
||||||
|
|
||||||
int? currentPage;
|
int? currentPage;
|
||||||
|
|
||||||
|
@ -26,13 +26,6 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
final allActions = List<SettingActions>.from(SettingActions.all);
|
|
||||||
allActions.remove(SettingActions.walletSettingAction);
|
|
||||||
_allItems.addAll(allActions); super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
@ -56,8 +49,8 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
padding: EdgeInsets.only(top: 0),
|
padding: EdgeInsets.only(top: 0),
|
||||||
itemBuilder: (_, index) {
|
itemBuilder: (_, index) {
|
||||||
final item = _allItems[index];
|
final item = SettingActions.desktopSettings[index];
|
||||||
final isLastTile = index == _allItems.length - 1;
|
final isLastTile = index == itemCount - 1;
|
||||||
return SettingActionButton(
|
return SettingActionButton(
|
||||||
isLastTile: isLastTile,
|
isLastTile: isLastTile,
|
||||||
selectionActive: currentPage != null,
|
selectionActive: currentPage != null,
|
||||||
|
@ -79,7 +72,7 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||||
height: 1,
|
height: 1,
|
||||||
color: Theme.of(context).primaryTextTheme.caption!.decorationColor!,
|
color: Theme.of(context).primaryTextTheme.caption!.decorationColor!,
|
||||||
),
|
),
|
||||||
itemCount: _allItems.length,
|
itemCount: itemCount,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -24,6 +24,16 @@ class SettingActions {
|
||||||
supportSettingAction,
|
supportSettingAction,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
static List<SettingActions> desktopSettings = [
|
||||||
|
connectionSettingAction,
|
||||||
|
addressBookSettingAction,
|
||||||
|
securityBackupSettingAction,
|
||||||
|
privacySettingAction,
|
||||||
|
displaySettingAction,
|
||||||
|
otherSettingAction,
|
||||||
|
supportSettingAction,
|
||||||
|
];
|
||||||
|
|
||||||
static SettingActions connectionSettingAction = SettingActions._(
|
static SettingActions connectionSettingAction = SettingActions._(
|
||||||
name: S.current.connection_sync,
|
name: S.current.connection_sync,
|
||||||
image: 'assets/images/nodes_menu.png',
|
image: 'assets/images/nodes_menu.png',
|
||||||
|
|
Loading…
Reference in a new issue