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/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.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/pages_desktop_specific/home/settings_menu/backup_and_restore/restore_backup_dialog.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.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:stackwallet/widgets/rounded_white_container.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'enable_backup_dialog.dart';
class BackupRestoreSettings extends ConsumerStatefulWidget { class BackupRestoreSettings extends ConsumerStatefulWidget {
const BackupRestoreSettings({Key? key}) : super(key: key); const BackupRestoreSettings({Key? key}) : super(key: key);

View file

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