dropdown fix

This commit is contained in:
julian 2022-11-01 09:36:37 -06:00
parent 7b41da4a4f
commit d9b825b001
2 changed files with 48 additions and 22 deletions

View file

@ -2,6 +2,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart';
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/restore_backup_dialog.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
@ -9,8 +10,6 @@ import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:url_launcher/url_launcher.dart';
import 'enable_backup_dialog.dart';
class BackupRestoreSettings extends ConsumerStatefulWidget {
const BackupRestoreSettings({Key? key}) : super(key: key);

View file

@ -32,13 +32,27 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
bool get fieldsMatch =>
passphraseController.text == passphraseRepeatController.text;
List<DropdownMenuItem<String>> get dropdownItems {
List<DropdownMenuItem<String>> menuItems = [
DropdownMenuItem(
child: Text("Every 10 minutes"), value: "Every 10 minutes"),
];
return menuItems;
}
String _currentDropDownValue = "Every 10 minutes";
final List<String> _dropDOwnItems = [
"Every 10 minutes",
"Every 20 minutes",
"Every 30 minutes",
];
// List<DropdownMenuItem<String>> get dropdownItems {
// List<DropdownMenuItem<String>> menuItems = [
// const DropdownMenuItem(
// value: "Every 10 minutes",
// child: Text("Every 10 minutes"),
// ),
// const DropdownMenuItem(
// value: "Every 20 minutes",
// child: Text("Every 20 minutes"),
// ),
// ];
// return menuItems;
// }
@override
void initState() {
@ -50,7 +64,7 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
passphraseFocusNode = FocusNode();
passphraseRepeatFocusNode = FocusNode();
// super.initState();
super.initState();
}
@override
@ -63,7 +77,7 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
passphraseFocusNode.dispose();
passphraseRepeatFocusNode.dispose();
// super.dispose();
super.dispose();
}
@override
@ -114,7 +128,7 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 32),
padding: const EdgeInsets.only(left: 32),
child: Text(
"Choose file location",
style: STextStyles.desktopTextExtraSmall(context).copyWith(
@ -123,7 +137,7 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
textAlign: TextAlign.left,
),
),
SizedBox(
const SizedBox(
height: 10,
),
Padding(
@ -177,12 +191,12 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
),
),
),
SizedBox(
const SizedBox(
height: 24,
),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 32),
padding: const EdgeInsets.only(left: 32),
child: Text(
"Create a passphrase",
style: STextStyles.desktopTextExtraSmall(context).copyWith(
@ -191,11 +205,11 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
textAlign: TextAlign.left,
),
),
SizedBox(
const SizedBox(
height: 10,
),
Padding(
padding: EdgeInsets.only(
padding: const EdgeInsets.only(
left: 32,
right: 32,
),
@ -338,11 +352,24 @@ class _CreateAutoBackup extends State<CreateAutoBackup> {
const SizedBox(
height: 10,
),
// DropdownButton(
// value: dropdownItems,
// items: dropdownItems,
// onChanged: null,
// ),
DropdownButton(
value: _currentDropDownValue,
items: _dropDOwnItems
.map(
(e) => DropdownMenuItem(
value: e,
child: Text(e),
),
)
.toList(),
onChanged: (value) {
if (value is String) {
setState(() {
_currentDropDownValue = value;
});
}
},
),
const Spacer(),
Padding(
padding: const EdgeInsets.all(32),