mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-14 16:09:31 +01:00
fix: Homeserver readonly if conifg wants it
This commit is contained in:
parent
3f14d5ed07
commit
c81158a1c9
@ -8,6 +8,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
|
||||
final String prefixText;
|
||||
final String hintText;
|
||||
final EdgeInsets padding;
|
||||
final bool readOnly;
|
||||
|
||||
const DefaultAppBarSearchField({
|
||||
Key key,
|
||||
@ -18,6 +19,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
|
||||
this.prefixText,
|
||||
this.hintText,
|
||||
this.padding,
|
||||
this.readOnly = false,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -71,6 +73,7 @@ class _DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
||||
controller: _searchController,
|
||||
onChanged: widget.onChanged,
|
||||
focusNode: _focusNode,
|
||||
readOnly: widget.readOnly,
|
||||
decoration: InputDecoration(
|
||||
prefixText: widget.prefixText,
|
||||
contentPadding: EdgeInsets.only(
|
||||
@ -82,9 +85,10 @@ class _DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
),
|
||||
hintText: widget.hintText,
|
||||
suffixIcon: _focusNode.hasFocus ||
|
||||
(widget.suffix == null &&
|
||||
(_searchController.text?.isNotEmpty ?? false))
|
||||
suffixIcon: !widget.readOnly &&
|
||||
(_focusNode.hasFocus ||
|
||||
(widget.suffix == null &&
|
||||
(_searchController.text?.isNotEmpty ?? false)))
|
||||
? IconButton(
|
||||
icon: Icon(Icons.backspace_outlined),
|
||||
onPressed: () {
|
||||
|
@ -71,6 +71,7 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
||||
suffix: Icon(Icons.edit_outlined),
|
||||
padding: padding,
|
||||
onChanged: (s) => _domain = s,
|
||||
readOnly: !AppConfig.allowOtherHomeservers,
|
||||
),
|
||||
elevation: 0,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user