From 0570147b3104eb329207ff374541d9d6797fe427 Mon Sep 17 00:00:00 2001 From: davidpkj Date: Sat, 11 Mar 2023 17:54:46 +0100 Subject: Updated code to dart analysis recommendations --- lib/views/settings_view.dart | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'lib/views/settings_view.dart') diff --git a/lib/views/settings_view.dart b/lib/views/settings_view.dart index 7268acf..c4cd1ce 100644 --- a/lib/views/settings_view.dart +++ b/lib/views/settings_view.dart @@ -17,7 +17,6 @@ class SettingsView extends StatefulWidget { class SettingsViewState extends State { final TextEditingController _controller = TextEditingController(); - final FocusNode _focusNode = FocusNode(); @override void initState() { @@ -83,11 +82,11 @@ class SettingsViewState extends State { trailing: ElevatedButton( child: Text(AppLocalizations.of(context)!.option312, style: cOptionTextStyle.copyWith(color: cIconColor)), onPressed: () async { - final _file = await FileHandler.pickDeserializableFile(context); + final file = await FileHandler.pickDeserializableFile(context); - if (_file == null) return; + if (file == null) return; - await FileHandler.deserializeFile(context, _file); + await FileHandler.deserializeFile(context, file); setState(() {}); }, @@ -99,36 +98,6 @@ class SettingsViewState extends State { ); } - void _updateSettings(String? text) { - _focusNode.unfocus(); - - if (text != null) { - SettingsData.settings["serverURL"] = text; - SettingsData.save(); - } - } - -/* - // TODO: Use later in direct settings? - Widget _buildServerIPInput() { - if (MediaQuery.of(context).viewInsets.bottom == 0) _updateSettings(null); - - return Container( - width: 150.0, - child: TextFormField( - keyboardType: TextInputType.url, - controller: _controller, - style: cRecipeTextStyle, - focusNode: _focusNode, - cursorColor: cPrimaryColor, - onEditingComplete: () { - _updateSettings(_controller.text); - }, - ), - ); - } -*/ - Widget _buildPhotoSourceDropDownButton() { return DropdownButton( value: int.parse(SettingsData.settings["photoSource"]!), -- cgit v1.2.3