mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-23 10:34:25 +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 prefixText;
|
||||||
final String hintText;
|
final String hintText;
|
||||||
final EdgeInsets padding;
|
final EdgeInsets padding;
|
||||||
|
final bool readOnly;
|
||||||
|
|
||||||
const DefaultAppBarSearchField({
|
const DefaultAppBarSearchField({
|
||||||
Key key,
|
Key key,
|
||||||
@ -18,6 +19,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
|
|||||||
this.prefixText,
|
this.prefixText,
|
||||||
this.hintText,
|
this.hintText,
|
||||||
this.padding,
|
this.padding,
|
||||||
|
this.readOnly = false,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -71,6 +73,7 @@ class _DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
|||||||
controller: _searchController,
|
controller: _searchController,
|
||||||
onChanged: widget.onChanged,
|
onChanged: widget.onChanged,
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
|
readOnly: widget.readOnly,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixText: widget.prefixText,
|
prefixText: widget.prefixText,
|
||||||
contentPadding: EdgeInsets.only(
|
contentPadding: EdgeInsets.only(
|
||||||
@ -82,9 +85,10 @@ class _DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
|||||||
borderRadius: BorderRadius.circular(32),
|
borderRadius: BorderRadius.circular(32),
|
||||||
),
|
),
|
||||||
hintText: widget.hintText,
|
hintText: widget.hintText,
|
||||||
suffixIcon: _focusNode.hasFocus ||
|
suffixIcon: !widget.readOnly &&
|
||||||
(widget.suffix == null &&
|
(_focusNode.hasFocus ||
|
||||||
(_searchController.text?.isNotEmpty ?? false))
|
(widget.suffix == null &&
|
||||||
|
(_searchController.text?.isNotEmpty ?? false)))
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Icon(Icons.backspace_outlined),
|
icon: Icon(Icons.backspace_outlined),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -71,6 +71,7 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||||||
suffix: Icon(Icons.edit_outlined),
|
suffix: Icon(Icons.edit_outlined),
|
||||||
padding: padding,
|
padding: padding,
|
||||||
onChanged: (s) => _domain = s,
|
onChanged: (s) => _domain = s,
|
||||||
|
readOnly: !AppConfig.allowOtherHomeservers,
|
||||||
),
|
),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user