From ee120ef34371267d18c56812b4ccd3190eb3e184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr>
Date: Tue, 14 Jan 2025 14:36:59 +0100
Subject: [PATCH] Put "delete" and "resume" buttons on same line

---
 CHANGELOG.md                         |  4 +++
 lib/parameters/pages/parameters.dart | 45 ++++++++++++++++------------
 pubspec.yaml                         |  2 +-
 3 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index bcf9e12..a497620 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.0.4
+
+-   Put "delete" and "resume" buttons on same line
+
 ## 1.0.3
 
 -   Split tag and publish CI/CD steps, minor CI/CD improvements
diff --git a/lib/parameters/pages/parameters.dart b/lib/parameters/pages/parameters.dart
index d07ef92..db58446 100644
--- a/lib/parameters/pages/parameters.dart
+++ b/lib/parameters/pages/parameters.dart
@@ -51,31 +51,38 @@ class PageParameters extends StatelessWidget {
     }
 
     // Actions buttons (middle block)
+    final double buttonBaseSize = MediaQuery.of(context).size.width / 4;
     final List<Widget> blockActions = [];
     if (canBeResumed) {
-      // Resume activity
-      blockActions.add(AspectRatio(
-        aspectRatio: 3,
-        child: ActivityButtonResumeSaved(
-          onPressed: () {
-            appConfig.resumeActivity(context);
-          },
-        ),
-      ));
-      // Delete saved activity
-      blockActions.add(SizedBox.square(
-        dimension: MediaQuery.of(context).size.width / 5,
-        child: ActivityButtonDeleteSaved(
-          onPressed: () {
-            appConfig.deleteCurrentActivity(context);
-          },
-        ),
+      blockActions.add(Row(
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        crossAxisAlignment: CrossAxisAlignment.center,
+        children: [
+          // Delete saved activity
+          SizedBox.fromSize(
+            size: Size(buttonBaseSize, buttonBaseSize),
+            child: ActivityButtonDeleteSaved(
+              onPressed: () {
+                appConfig.deleteCurrentActivity(context);
+              },
+            ),
+          ),
+          // Resume activity
+          SizedBox.fromSize(
+            size: Size(2.9 * buttonBaseSize, buttonBaseSize),
+            child: ActivityButtonResumeSaved(
+              onPressed: () {
+                appConfig.resumeActivity(context);
+              },
+            ),
+          ),
+        ],
       ));
     } else {
       // Start new activity
       blockActions.add(
-        AspectRatio(
-          aspectRatio: 3,
+        SizedBox.fromSize(
+          size: Size(4 * buttonBaseSize, buttonBaseSize),
           child: ActivityButtonStartNew(
             onPressed: () {
               appConfig.startNewActivity(context);
diff --git a/pubspec.yaml b/pubspec.yaml
index 1108353..ea201a5 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects."
 
 publish_to: https://pub.harrault.fr/
 
-version: 1.0.3
+version: 1.0.4
 
 homepage: https://git.harrault.fr/android/flutter-toolbox
 
-- 
GitLab