Skip to content

Commit

Permalink
Merge pull request #1510 from ardriveapp/PE-5170
Browse files Browse the repository at this point in the history
PE-5170: aligns the nav buttons with the full screen button
  • Loading branch information
thiagocarvalhodev authored Dec 4, 2023
2 parents 86964c3 + 117e578 commit 6b64540
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions lib/pages/drive_detail/components/fs_entry_preview_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1456,19 +1456,22 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Flexible(
flex: 1,
child: Center(child: SizedBox.shrink()),
),
Flexible(
flex: 1,
child: Center(child: _buildNavigationButtons()),
flex: 2,
child: Center(
child: _buildNavigationButtons(isFullScreen: false),
),
),
Flexible(
flex: 1,
child: Center(
child: _buildFullScreenButton(isFileExplorer: isFileExplorer),
child: _buildFullScreenButton(),
),
),
],
Expand All @@ -1489,14 +1492,16 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
),
Flexible(
flex: 1,
child: Center(child: _buildNavigationButtons()),
child: Center(
child: _buildNavigationButtons(isFullScreen: true),
),
),
Flexible(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
_buildFullScreenButton(isFileExplorer: isFileExplorer),
_buildFullScreenButton(),
const SizedBox(width: 24),
],
),
Expand All @@ -1509,7 +1514,7 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
Expanded(
child: _buildNameAndExtension(isFileExplorer: isFileExplorer),
),
_buildFullScreenButton(isFileExplorer: isFileExplorer),
_buildFullScreenButton(),
],
);
}
Expand Down Expand Up @@ -1602,9 +1607,13 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
);
}

Widget _buildNavigationButtons() {
Widget _buildNavigationButtons({
required bool isFullScreen,
}) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: isFullScreen
? MainAxisAlignment.spaceEvenly
: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: widget.canNavigateThroughImages
Expand All @@ -1622,12 +1631,12 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
);
}

Widget _buildFullScreenButton({required bool isFileExplorer}) {
Widget _buildFullScreenButton() {
return SafeArea(
child: Padding(
padding: EdgeInsets.only(
padding: const EdgeInsets.only(
left: 24,
top: isFileExplorer ? 0 : 24,
top: 24,
bottom: 24,
),
child: IconButton(
Expand Down

0 comments on commit 6b64540

Please sign in to comment.