From c687a90191c01cf6225f67186aa2869eff7c8894 Mon Sep 17 00:00:00 2001 From: TonyBest318 Date: Sun, 3 Mar 2024 15:57:23 +0800 Subject: [PATCH] adjust ui to fit 6 buttons at the top --- .flutter-plugins-dependencies | 2 +- lib/widgets.dart | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 4853147..ad1becc 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/tony/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/home/tony/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-03-03 14:53:28.435744","version":"3.19.2"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/tony/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/home/tony/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/home/tony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-03-03 15:50:36.130902","version":"3.19.2"} \ No newline at end of file diff --git a/lib/widgets.dart b/lib/widgets.dart index bc3c2d6..3f53b0d 100644 --- a/lib/widgets.dart +++ b/lib/widgets.dart @@ -586,6 +586,11 @@ class StopwatchTimelineState extends State { setState(() {}); }, child: const Text("开始"), + style: ElevatedButton.styleFrom( + minimumSize: Size.zero, // Set this + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), + ), ), ElevatedButton( onPressed: (isSessionStarted) @@ -594,6 +599,11 @@ class StopwatchTimelineState extends State { } : null, child: const Text("⬅️"), + style: ElevatedButton.styleFrom( + minimumSize: Size.zero, // Set this + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), + ), ), ElevatedButton( onPressed: (widget.timer.isRunning || @@ -613,6 +623,11 @@ class StopwatchTimelineState extends State { } : null, child: const Text("计次"), + style: ElevatedButton.styleFrom( + minimumSize: Size.zero, // Set this + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), + ), ), ElevatedButton( onPressed: (widget.timer.isRunning || @@ -629,6 +644,11 @@ class StopwatchTimelineState extends State { } : null, child: const Text("放弃"), + style: ElevatedButton.styleFrom( + minimumSize: Size.zero, // Set this + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), + ), ), ElevatedButton( onPressed: (widget.selectedTimelineDuration == null || @@ -649,6 +669,11 @@ class StopwatchTimelineState extends State { } }, child: const Text("删除"), + style: ElevatedButton.styleFrom( + minimumSize: Size.zero, // Set this + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), + ), ), ElevatedButton( onPressed: () async { @@ -662,6 +687,11 @@ class StopwatchTimelineState extends State { } }, child: const Text("重置"), + style: ElevatedButton.styleFrom( + minimumSize: Size.zero, // Set this + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), + ), ), ], ),