mirror of
https://github.com/feeddeck/feeddeck.git
synced 2026-07-20 21:25:24 -05:00
[core] Wrap Actions in SafeArea Widget (#172)
With this commit we are wrapping all action widgets in a `SafeArea` widget, to improve the alignment of the actions.
This commit is contained in:
@@ -94,28 +94,41 @@ class _ItemVideoPlayerState extends State<ItemVideoPlayer> {
|
||||
maxWidth: Constants.centeredFormMaxWidth,
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: widget.qualities!
|
||||
.asMap()
|
||||
.entries
|
||||
.map((quality) {
|
||||
if (quality.key == widget.qualities!.length - 1) {
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
),
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: widget.qualities!
|
||||
.asMap()
|
||||
.entries
|
||||
.map((quality) {
|
||||
if (quality.key == widget.qualities!.length - 1) {
|
||||
return [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
await _playerOpen(quality.value.video);
|
||||
},
|
||||
title: Text(quality.value.quality),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
@@ -125,27 +138,16 @@ class _ItemVideoPlayerState extends State<ItemVideoPlayer> {
|
||||
},
|
||||
title: Text(quality.value.quality),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
await _playerOpen(quality.value.video);
|
||||
},
|
||||
title: Text(quality.value.quality),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
];
|
||||
})
|
||||
.expand((e) => e)
|
||||
.toList(),
|
||||
})
|
||||
.expand((e) => e)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -185,70 +185,72 @@ class _ItemActionsState extends State<ItemActions> {
|
||||
maxWidth: Constants.centeredFormMaxWidth,
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
_read(mainContext);
|
||||
},
|
||||
leading: widget.item.isRead
|
||||
? const Icon(Icons.visibility_off)
|
||||
: const Icon(Icons.visibility),
|
||||
title: widget.item.isRead
|
||||
? const Text('Mark as Unread')
|
||||
: const Text('Mark as Read'),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
_bookmark(mainContext);
|
||||
},
|
||||
leading: widget.item.isBookmarked
|
||||
? const Icon(Icons.bookmark)
|
||||
: const Icon(Icons.bookmark_outline),
|
||||
title: widget.item.isBookmarked
|
||||
? const Text('Remove Bookmark')
|
||||
: const Text('Add Bookmark'),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
_openUrl();
|
||||
},
|
||||
leading: const Icon(Icons.launch),
|
||||
title: const Text('Open Link'),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
_read(mainContext);
|
||||
},
|
||||
leading: widget.item.isRead
|
||||
? const Icon(Icons.visibility_off)
|
||||
: const Icon(Icons.visibility),
|
||||
title: widget.item.isRead
|
||||
? const Text('Mark as Unread')
|
||||
: const Text('Mark as Read'),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
_bookmark(mainContext);
|
||||
},
|
||||
leading: widget.item.isBookmarked
|
||||
? const Icon(Icons.bookmark)
|
||||
: const Icon(Icons.bookmark_outline),
|
||||
title: widget.item.isBookmarked
|
||||
? const Text('Remove Bookmark')
|
||||
: const Text('Add Bookmark'),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
_openUrl();
|
||||
},
|
||||
leading: const Icon(Icons.launch),
|
||||
title: const Text('Open Link'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -18,60 +18,62 @@ class SettingsAccountsActions extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
reconnect();
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.link,
|
||||
),
|
||||
title: const Text(
|
||||
'Re-Connect',
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
delete();
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.delete,
|
||||
color: Constants.error,
|
||||
),
|
||||
title: const Text(
|
||||
'Delete',
|
||||
style: TextStyle(
|
||||
color: Constants.error,
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
reconnect();
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.link,
|
||||
),
|
||||
title: const Text(
|
||||
'Re-Connect',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
delete();
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.delete,
|
||||
color: Constants.error,
|
||||
),
|
||||
title: const Text(
|
||||
'Delete',
|
||||
style: TextStyle(
|
||||
color: Constants.error,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -152,60 +152,62 @@ class SettingsProfileSignOutActions extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(
|
||||
Constants.spacingMiddle,
|
||||
),
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
signOut(supabase.SignOutScope.local);
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.logout,
|
||||
),
|
||||
title: const Text(
|
||||
'From current device',
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: Constants.spacingMiddle,
|
||||
right: Constants.spacingMiddle,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Constants.background,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.spacingMiddle),
|
||||
),
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
signOut(supabase.SignOutScope.global);
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.logout,
|
||||
color: Constants.error,
|
||||
),
|
||||
title: const Text(
|
||||
'From all devices',
|
||||
style: TextStyle(
|
||||
color: Constants.error,
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
signOut(supabase.SignOutScope.local);
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.logout,
|
||||
),
|
||||
title: const Text(
|
||||
'From current device',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const Divider(
|
||||
color: Constants.dividerColor,
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
ListTile(
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
signOut(supabase.SignOutScope.global);
|
||||
},
|
||||
leading: const Icon(
|
||||
Icons.logout,
|
||||
color: Constants.error,
|
||||
),
|
||||
title: const Text(
|
||||
'From all devices',
|
||||
style: TextStyle(
|
||||
color: Constants.error,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user