Wrap view elements in SafeArea (#3778)

Co-authored-by: ggurdin <ggurdin@gmail.com>
Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
pull/2245/head
Kelrap 3 months ago committed by GitHub
parent bd39abc54b
commit 5efaf8e7f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -68,6 +68,9 @@ class SettingsView extends StatelessWidget {
// Pangea#
body: ListTileTheme(
iconColor: theme.colorScheme.onSurface,
// #Pangea
child: SafeArea(
// Pangea#
child: ListView(
key: const Key('SettingsListViewContent'),
children: <Widget>[
@ -244,8 +247,8 @@ class SettingsView extends StatelessWidget {
ListTile(
leading: const Icon(Icons.notifications_outlined),
title: Text(L10n.of(context).notifications),
tileColor:
activeRoute.startsWith('/rooms/settings/notifications')
tileColor: activeRoute
.startsWith('/rooms/settings/notifications')
? theme.colorScheme.surfaceContainerHigh
: null,
onTap: () => context.go('/rooms/settings/notifications'),
@ -254,7 +257,8 @@ class SettingsView extends StatelessWidget {
leading: const Icon(Icons.devices_outlined),
title: Text(L10n.of(context).devices),
onTap: () => context.go('/rooms/settings/devices'),
tileColor: activeRoute.startsWith('/rooms/settings/devices')
tileColor:
activeRoute.startsWith('/rooms/settings/devices')
? theme.colorScheme.surfaceContainerHigh
: null,
),
@ -397,6 +401,7 @@ class SettingsView extends StatelessWidget {
),
),
),
),
],
);
}

@ -31,7 +31,8 @@ class ActivityGeneratorView extends StatelessWidget {
final l10n = L10n.of(context);
if (controller.loading) {
return Scaffold(
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text(L10n.of(context).makeYourOwnActivity),
),
@ -39,9 +40,11 @@ class ActivityGeneratorView extends StatelessWidget {
padding: EdgeInsets.all(32.0),
child: Center(child: CircularProgressIndicator()),
),
),
);
} else if (controller.error != null || controller.room == null) {
return Scaffold(
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text(L10n.of(context).makeYourOwnActivity),
),
@ -60,10 +63,12 @@ class ActivityGeneratorView extends StatelessWidget {
],
),
),
),
);
} else if (controller.activities != null &&
controller.activities!.isNotEmpty) {
return ActivityPlannerBuilder(
return SafeArea(
child: ActivityPlannerBuilder(
initialActivity: controller.activities!.first,
initialFilename: controller.filename,
room: controller.room!,
@ -91,10 +96,12 @@ class ActivityGeneratorView extends StatelessWidget {
),
);
},
),
);
}
return Scaffold(
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text(L10n.of(context).makeYourOwnActivity),
leading: BackButton(
@ -145,26 +152,29 @@ class ActivityGeneratorView extends StatelessWidget {
MatrixState.pangeaController.pLanguageStore.baseOptions,
onChange: (val) => controller
.setSelectedLanguageOfInstructions(val.langCode),
initialLanguage: controller.selectedLanguageOfInstructions !=
null
initialLanguage:
controller.selectedLanguageOfInstructions != null
? PLanguageStore.byLangCode(
controller.selectedLanguageOfInstructions!,
)
: MatrixState.pangeaController.languageController.userL1,
: MatrixState
.pangeaController.languageController.userL1,
isL2List: false,
decorationText: L10n.of(context).languageOfInstructionsLabel,
decorationText:
L10n.of(context).languageOfInstructionsLabel,
),
const SizedBox(height: 16.0),
PLanguageDropdown(
languages:
MatrixState.pangeaController.pLanguageStore.targetOptions,
languages: MatrixState
.pangeaController.pLanguageStore.targetOptions,
onChange: (val) =>
controller.setSelectedTargetLanguage(val.langCode),
initialLanguage: controller.selectedTargetLanguage != null
? PLanguageStore.byLangCode(
controller.selectedTargetLanguage!,
)
: MatrixState.pangeaController.languageController.userL2,
: MatrixState
.pangeaController.languageController.userL2,
decorationText: L10n.of(context).targetLanguageLabel,
isL2List: true,
),
@ -221,7 +231,8 @@ class ActivityGeneratorView extends StatelessWidget {
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onFieldSubmitted: (_) {
if (controller.formKey.currentState?.validate() ?? false) {
if (controller.formKey.currentState?.validate() ??
false) {
controller.generate();
}
},
@ -273,7 +284,8 @@ class ActivityGeneratorView extends StatelessWidget {
const SizedBox(height: 24.0),
ElevatedButton(
onPressed: () {
if (controller.formKey.currentState?.validate() ?? false) {
if (controller.formKey.currentState?.validate() ??
false) {
controller.generate();
}
},
@ -291,6 +303,7 @@ class ActivityGeneratorView extends StatelessWidget {
),
),
),
),
);
}
}

@ -60,7 +60,8 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
break;
}
return Scaffold(
return SafeArea(
child: Scaffold(
appBar: ActivityPlannerPageAppBar(
pageMode: pageMode,
roomID: widget.roomID,
@ -151,6 +152,7 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
),
),
),
),
);
}
}

Loading…
Cancel
Save