Made GitHub PATs hidden (password field) (#215)

This commit is contained in:
Imran Remtulla
2023-01-06 20:57:26 -05:00
parent 95f3362a84
commit 02751fe8fa
2 changed files with 7 additions and 2 deletions

View File

@ -3,7 +3,6 @@ import 'dart:math';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:obtainium/components/generated_form_modal.dart';
import 'package:obtainium/providers/settings_provider.dart';
abstract class GeneratedFormItem {
late String key;
@ -24,6 +23,7 @@ class GeneratedFormTextField extends GeneratedFormItem {
late bool required;
late int max;
late String? hint;
late bool password;
GeneratedFormTextField(String key,
{String label = 'Input',
@ -32,7 +32,8 @@ class GeneratedFormTextField extends GeneratedFormItem {
List<String? Function(String? value)> additionalValidators = const [],
this.required = true,
this.max = 1,
this.hint})
this.hint,
this.password = false})
: super(key,
label: label,
belowWidgets: belowWidgets,
@ -188,6 +189,9 @@ class _GeneratedFormState extends State<GeneratedForm> {
if (formItem is GeneratedFormTextField) {
final formFieldKey = GlobalKey<FormFieldState>();
return TextFormField(
obscureText: formItem.password,
autocorrect: !formItem.password,
enableSuggestions: !formItem.password,
key: formFieldKey,
initialValue: values[formItem.key],
autovalidateMode: AutovalidateMode.onUserInteraction,