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), style: TextStyle(fontSize: 20),
), ),
Spacer(flex: 1), Spacer(flex: 1),
child(context), ConstrainedBox(
Spacer(flex: 1), constraints: BoxConstraints(maxHeight: 300),
_hasAction child: SingleChildScrollView(child: child(context))),
? OutlinedButton(
onPressed: () => onActionTap(context),
child: Text(
actionTitle,
style: TextStyle(color: Colors.white),
),
)
: Opacity(
opacity: 0,
child: OutlinedButton(
onPressed: null,
child: Text(""),
),
),
Spacer(flex: 1), Spacer(flex: 1),
], ],
); );

View File

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