mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-03 08:44:14 +01:00
Merge branch 'braid/homeserver-appbar' into 'main'
fix: homeserver error text not visible in app bar See merge request famedly/fluffychat!1042
This commit is contained in:
commit
56b3297610
37
lib/pages/homeserver_picker/homeserver_app_bar.dart
Normal file
37
lib/pages/homeserver_picker/homeserver_app_bar.dart
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
|
import 'homeserver_picker.dart';
|
||||||
|
|
||||||
|
class HomeserverAppBar extends StatelessWidget {
|
||||||
|
final HomeserverPickerController controller;
|
||||||
|
|
||||||
|
const HomeserverAppBar({Key? key, required this.controller})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextField(
|
||||||
|
focusNode: controller.homeserverFocusNode,
|
||||||
|
controller: controller.homeserverController,
|
||||||
|
onChanged: controller.onChanged,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixIcon: Navigator.of(context).canPop()
|
||||||
|
? IconButton(
|
||||||
|
onPressed: Navigator.of(context).pop,
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
prefixText: '${L10n.of(context)!.homeserver}: ',
|
||||||
|
hintText: L10n.of(context)!.enterYourHomeserver,
|
||||||
|
suffixIcon: const Icon(Icons.search),
|
||||||
|
errorText: controller.error,
|
||||||
|
),
|
||||||
|
readOnly: !AppConfig.allowOtherHomeservers,
|
||||||
|
onSubmitted: (_) => controller.checkHomeserverAction(),
|
||||||
|
autocorrect: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,7 @@ import 'package:url_launcher/url_launcher.dart';
|
|||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
||||||
|
import 'homeserver_app_bar.dart';
|
||||||
import 'homeserver_picker.dart';
|
import 'homeserver_picker.dart';
|
||||||
|
|
||||||
class HomeserverPickerView extends StatelessWidget {
|
class HomeserverPickerView extends StatelessWidget {
|
||||||
@ -16,28 +17,9 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final benchmarkResults = controller.benchmarkResults;
|
final benchmarkResults = controller.benchmarkResults;
|
||||||
return LoginScaffold(
|
return LoginScaffold(
|
||||||
appBar: AppBar(
|
|
||||||
titleSpacing: 0,
|
|
||||||
title: Padding(
|
|
||||||
padding: const EdgeInsets.all(12.0),
|
|
||||||
child: TextField(
|
|
||||||
focusNode: controller.homeserverFocusNode,
|
|
||||||
controller: controller.homeserverController,
|
|
||||||
onChanged: controller.onChanged,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
prefixText: '${L10n.of(context)!.homeserver}: ',
|
|
||||||
hintText: L10n.of(context)!.enterYourHomeserver,
|
|
||||||
suffixIcon: const Icon(Icons.search),
|
|
||||||
errorText: controller.error,
|
|
||||||
),
|
|
||||||
readOnly: !AppConfig.allowOtherHomeservers,
|
|
||||||
onSubmitted: (_) => controller.checkHomeserverAction(),
|
|
||||||
autocorrect: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
|
HomeserverAppBar(controller: controller),
|
||||||
// display a prominent banner to import session for TOR browser
|
// display a prominent banner to import session for TOR browser
|
||||||
// users. This feature is just some UX sugar as TOR users are
|
// users. This feature is just some UX sugar as TOR users are
|
||||||
// usually forced to logout as TOR browser is non-persistent
|
// usually forced to logout as TOR browser is non-persistent
|
||||||
|
Loading…
Reference in New Issue
Block a user