1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 04:49:21 +00:00

Fix overflow

This commit is contained in:
Pierre HUBERT 2021-04-17 19:29:22 +02:00
parent eeefaf87f3
commit 532d2412e3
2 changed files with 14 additions and 31 deletions

View File

@ -269,23 +269,9 @@ class _PresentationPane extends StatelessWidget {
style: TextStyle(fontSize: 20),
),
Spacer(flex: 1),
child(context),
Spacer(flex: 1),
_hasAction
? OutlinedButton(
onPressed: () => onActionTap(context),
child: Text(
actionTitle,
style: TextStyle(color: Colors.white),
),
)
: Opacity(
opacity: 0,
child: OutlinedButton(
onPressed: null,
child: Text(""),
),
),
ConstrainedBox(
constraints: BoxConstraints(maxHeight: 300),
child: SingleChildScrollView(child: child(context))),
Spacer(flex: 1),
],
);

View File

@ -46,11 +46,6 @@ class _PushNotificationsConfigurationRouteState
Spacer(),
Icon(Icons.notifications_none, color: Colors.white),
Spacer(),
Text(
tr("Comunic can send you notifications to your device when the application is closed if you want."),
textAlign: TextAlign.center,
),
Spacer(),
PushNotificationsConfigurationWidget(
key: _key,
onConfigured: () => (Navigator.of(context).pop()),
@ -118,10 +113,14 @@ class PushNotificationsConfigurationWidgetState
constraints: BoxConstraints(maxWidth: 300),
child: Column(
children: [
Text(
tr("Comunic can send you push notifications to your device."),
textAlign: TextAlign.center,
),
SizedBox(height: 10),
_NotificationOption(
title: tr("Use Google services (recommended)"),
description: tr(
"Use the Google Play services to send you notifications. This option is less privacy-friendly, but it will work on most phones and will save your battery life."),
description: tr("Save your battery life."),
option: PushNotificationsStatus.FIREBASE,
current: currStatus,
available: srvConfig.notificationsPolicy.hasFirebase,
@ -132,8 +131,7 @@ class PushNotificationsConfigurationWidgetState
),
_NotificationOption(
title: tr("Use independent notifications service"),
description: tr(
"Configure Comunic to use our own self-hosted notifications service. This option is much more privacy-friendly, but it will drain your battery."),
description: tr("Protect more your privacy."),
option: PushNotificationsStatus.INDEPENDENT,
current: currStatus,
available:
@ -145,8 +143,6 @@ class PushNotificationsConfigurationWidgetState
),
_NotificationOption(
title: tr("Do not send notification"),
description: tr(
"Disable notifications service. You will always be able to change it from application settings."),
option: PushNotificationsStatus.DISABLED,
current: currStatus,
available: true,
@ -214,13 +210,12 @@ class _NotificationOption extends StatelessWidget {
const _NotificationOption({
Key key,
@required this.title,
@required this.description,
this.description,
@required this.option,
@required this.current,
@required this.available,
@required this.onChanged,
}) : assert(title != null),
assert(description != null),
assert(option != null),
assert(current != null),
assert(available != null),
@ -242,7 +237,9 @@ class _NotificationOption extends StatelessWidget {
fillColor: MaterialStateProperty.all(Colors.white),
),
title: Text(title, style: TextStyle(color: Colors.white)),
subtitle: Text(description, style: TextStyle(color: Colors.white)),
subtitle: description == null
? null
: Text(description, style: TextStyle(color: Colors.white)),
contentPadding: EdgeInsets.all(0),
onTap: () => onChanged(option),
),