fix: Add missing SafeArea to homeserver picker

krille/remove-custom-fonts
Christian Pauly 3 years ago
parent 3bbbf8349e
commit 52fe7132cf

@ -46,123 +46,125 @@ class HomeserverPickerView extends StatelessWidget {
), ),
], ],
), ),
body: Column( body: SafeArea(
children: [ child: Column(
// display a prominent banner to import session for TOR browser children: [
// users. This feature is just some UX sugar as TOR users are // display a prominent banner to import session for TOR browser
// usually forced to logout as TOR browser is non-persistent // users. This feature is just some UX sugar as TOR users are
AnimatedContainer( // usually forced to logout as TOR browser is non-persistent
height: controller.isTorBrowser ? 64 : 0, AnimatedContainer(
duration: const Duration(milliseconds: 300), height: controller.isTorBrowser ? 64 : 0,
clipBehavior: Clip.hardEdge, duration: const Duration(milliseconds: 300),
curve: Curves.bounceInOut,
decoration: const BoxDecoration(),
child: Material(
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: curve: Curves.bounceInOut,
const BorderRadius.vertical(bottom: Radius.circular(8)), decoration: const BoxDecoration(),
color: Theme.of(context).colorScheme.surface, child: Material(
child: ListTile( clipBehavior: Clip.hardEdge,
leading: const Icon(Icons.vpn_key), borderRadius:
title: Text(L10n.of(context)!.hydrateTor), const BorderRadius.vertical(bottom: Radius.circular(8)),
subtitle: Text(L10n.of(context)!.hydrateTorLong), color: Theme.of(context).colorScheme.surface,
trailing: const Icon(Icons.chevron_right_outlined), child: ListTile(
onTap: controller.restoreBackup, leading: const Icon(Icons.vpn_key),
title: Text(L10n.of(context)!.hydrateTor),
subtitle: Text(L10n.of(context)!.hydrateTorLong),
trailing: const Icon(Icons.chevron_right_outlined),
onTap: controller.restoreBackup,
),
), ),
), ),
), Expanded(
Expanded( child: ListView(
child: ListView( children: [
children: [ Container(
Container( alignment: Alignment.center,
alignment: Alignment.center, height: 200,
height: 200, child: Image.asset('assets/info-logo.png'),
child: Image.asset('assets/info-logo.png'),
),
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,
fillColor: Theme.of(context)
.colorScheme
.background
.withOpacity(0.75),
),
readOnly: !AppConfig.allowOtherHomeservers,
onSubmitted: (_) => controller.checkHomeserverAction(),
autocorrect: false,
), ),
),
if (controller.displayServerList)
Padding( Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Material( child: TextField(
borderRadius: focusNode: controller.homeserverFocusNode,
BorderRadius.circular(AppConfig.borderRadius), controller: controller.homeserverController,
color: Colors.white.withAlpha(200), onChanged: controller.onChanged,
clipBehavior: Clip.hardEdge, decoration: InputDecoration(
child: benchmarkResults == null prefixText: '${L10n.of(context)!.homeserver}: ',
? const Center( hintText: L10n.of(context)!.enterYourHomeserver,
child: Padding( suffixIcon: const Icon(Icons.search),
padding: EdgeInsets.all(12.0), errorText: controller.error,
child: CircularProgressIndicator.adaptive(), fillColor: Theme.of(context)
)) .colorScheme
: Column( .background
children: controller.filteredHomeservers .withOpacity(0.75),
.map( ),
(server) => ListTile( readOnly: !AppConfig.allowOtherHomeservers,
trailing: IconButton( onSubmitted: (_) => controller.checkHomeserverAction(),
icon: const Icon( autocorrect: false,
Icons.info_outlined, ),
color: Colors.black, ),
if (controller.displayServerList)
Padding(
padding: const EdgeInsets.all(12.0),
child: Material(
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
color: Colors.white.withAlpha(200),
clipBehavior: Clip.hardEdge,
child: benchmarkResults == null
? const Center(
child: Padding(
padding: EdgeInsets.all(12.0),
child: CircularProgressIndicator.adaptive(),
))
: Column(
children: controller.filteredHomeservers
.map(
(server) => ListTile(
trailing: IconButton(
icon: const Icon(
Icons.info_outlined,
color: Colors.black,
),
onPressed: () =>
controller.showServerInfo(server),
),
onTap: () => controller.setServer(
server.homeserver.baseUrl.host),
title: Text(
server.homeserver.baseUrl.host,
style: const TextStyle(
color: Colors.black),
),
subtitle: Text(
server.homeserver.description ?? '',
style: TextStyle(
color: Colors.grey.shade700),
), ),
onPressed: () =>
controller.showServerInfo(server),
),
onTap: () => controller.setServer(
server.homeserver.baseUrl.host),
title: Text(
server.homeserver.baseUrl.host,
style: const TextStyle(
color: Colors.black),
),
subtitle: Text(
server.homeserver.description ?? '',
style: TextStyle(
color: Colors.grey.shade700),
), ),
), )
) .toList(),
.toList(), ),
), ),
), ),
), ],
], ),
), ),
), Container(
Container( padding: const EdgeInsets.all(12),
padding: const EdgeInsets.all(12), width: double.infinity,
width: double.infinity, child: Hero(
child: Hero( tag: 'loginButton',
tag: 'loginButton', child: ElevatedButton(
child: ElevatedButton( onPressed: controller.isLoading
onPressed: controller.isLoading ? null
? null : controller.checkHomeserverAction,
: controller.checkHomeserverAction, child: controller.isLoading
child: controller.isLoading ? const LinearProgressIndicator()
? const LinearProgressIndicator() : Text(L10n.of(context)!.connect),
: Text(L10n.of(context)!.connect), ),
), ),
), ),
), ],
], ),
), ),
); );
} }

Loading…
Cancel
Save