Fix issues from code review

This commit is contained in:
Godwin Asuquo 2023-02-21 12:22:32 +02:00
parent 4bc81242fc
commit 88e245e480
3 changed files with 14 additions and 12 deletions

View file

@ -24,7 +24,6 @@ class DesktopDashboardPage extends StatelessWidget {
final WalletAddressListViewModel addressListViewModel;
static final GlobalKey<NavigatorState> desktopKey = GlobalKey<NavigatorState>();
static final GlobalKey kex = GlobalKey();
bool _isEffectsInstalled = false;
StreamSubscription<bool>? _onInactiveSub;

View file

@ -16,7 +16,7 @@ class DesktopSettingsPage extends StatefulWidget {
}
class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
final List<SettingActions> _allItems = [];
final int itemCount = SettingActions.desktopSettings.length;
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
Widget build(BuildContext context) {
return Scaffold(
@ -56,8 +49,8 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
child: ListView.separated(
padding: EdgeInsets.only(top: 0),
itemBuilder: (_, index) {
final item = _allItems[index];
final isLastTile = index == _allItems.length - 1;
final item = SettingActions.desktopSettings[index];
final isLastTile = index == itemCount - 1;
return SettingActionButton(
isLastTile: isLastTile,
selectionActive: currentPage != null,
@ -79,7 +72,7 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
height: 1,
color: Theme.of(context).primaryTextTheme.caption!.decorationColor!,
),
itemCount: _allItems.length,
itemCount: itemCount,
),
),
],

View file

@ -24,6 +24,16 @@ class SettingActions {
supportSettingAction,
];
static List<SettingActions> desktopSettings = [
connectionSettingAction,
addressBookSettingAction,
securityBackupSettingAction,
privacySettingAction,
displaySettingAction,
otherSettingAction,
supportSettingAction,
];
static SettingActions connectionSettingAction = SettingActions._(
name: S.current.connection_sync,
image: 'assets/images/nodes_menu.png',