From aab622bb83cdb4f51004e9b6abab12cd36805210 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 18 Feb 2021 21:38:35 +0100 Subject: [PATCH] Add drag icon to bottom sheet This should make more obvious that the whole sheet can be dragged down --- Gemfile.lock | 22 +++++++++++----------- lib/widgets/core/bottom_sheet.dart | 28 +++++++++++++++++----------- lib/widgets/workouts/day.dart | 11 ++++++++++- lib/widgets/workouts/forms.dart | 6 ++++-- pubspec.yaml | 2 +- 5 files changed, 43 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 504fa903..139efd2e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,17 +7,17 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.0) - aws-partitions (1.422.0) - aws-sdk-core (3.111.2) + aws-partitions (1.427.0) + aws-sdk-core (3.112.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.41.0) - aws-sdk-core (~> 3, >= 3.109.0) + aws-sdk-kms (1.42.0) + aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.87.0) - aws-sdk-core (~> 3, >= 3.109.0) + aws-sdk-s3 (1.88.1) + aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) aws-sigv4 (1.2.2) @@ -36,7 +36,7 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.7.6) emoji_regex (3.2.1) - excon (0.78.1) + excon (0.79.0) faraday (1.3.0) faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) @@ -47,8 +47,8 @@ GEM faraday-net_http (1.0.1) faraday_middleware (1.0.0) faraday (~> 1.0) - fastimage (2.2.1) - fastlane (2.172.0) + fastimage (2.2.2) + fastlane (2.174.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) artifactory (~> 3.0) @@ -106,7 +106,7 @@ GEM webrick google-apis-iamcredentials_v1 (0.1.0) google-apis-core (~> 0.1) - google-apis-storage_v1 (0.1.0) + google-apis-storage_v1 (0.2.0) google-apis-core (~> 0.1) google-cloud-core (1.5.0) google-cloud-env (~> 1.0) @@ -122,7 +122,7 @@ GEM google-cloud-core (~> 1.2) googleauth (~> 0.9) mini_mime (~> 1.0) - googleauth (0.15.0) + googleauth (0.15.1) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) diff --git a/lib/widgets/core/bottom_sheet.dart b/lib/widgets/core/bottom_sheet.dart index 6c279c17..bfd6e4b6 100644 --- a/lib/widgets/core/bottom_sheet.dart +++ b/lib/widgets/core/bottom_sheet.dart @@ -23,17 +23,23 @@ Future showFormBottomSheet(BuildContext context, String header, Widget f isScrollControlled: true, context: context, builder: (BuildContext ctx) { - return Container( - margin: EdgeInsets.symmetric(vertical: 50, horizontal: 15), - child: Column( - children: [ - Text( - header, - style: Theme.of(ctx).textTheme.headline6, - ), - form - ], - ), + return Column( + children: [ + Icon( + Icons.remove, + color: Colors.grey, + ), + Text( + header, + style: Theme.of(ctx).textTheme.headline6, + ), + SizedBox(height: 10), + Divider(), + Container( + margin: EdgeInsets.symmetric(horizontal: 20), + child: form, + ) + ], ); }); } diff --git a/lib/widgets/workouts/day.dart b/lib/widgets/workouts/day.dart index ac1298c7..817ea133 100644 --- a/lib/widgets/workouts/day.dart +++ b/lib/widgets/workouts/day.dart @@ -17,10 +17,12 @@ */ import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:wger/locale/locales.dart'; import 'package:wger/models/workouts/day.dart'; import 'package:wger/models/workouts/set.dart'; import 'package:wger/models/workouts/setting.dart'; +import 'package:wger/providers/workout_plans.dart'; import 'package:wger/widgets/core/bottom_sheet.dart'; import 'package:wger/widgets/workouts/forms.dart'; @@ -47,6 +49,14 @@ class SettingWidget extends StatelessWidget { ), title: Text(setting.exerciseObj.name), subtitle: Text(setting.repsText), + trailing: IconButton( + visualDensity: VisualDensity.compact, + icon: Icon(Icons.delete), + //iconSize: 16, + onPressed: () { + Provider.of(context, listen: false).deleteSetting(setting); + }, + ), ); } } @@ -60,7 +70,6 @@ class WorkoutDayWidget extends StatelessWidget { return Row( crossAxisAlignment: CrossAxisAlignment.baseline, children: [ - Text('#${set.order}'), Expanded( child: Column( children: [ diff --git a/lib/widgets/workouts/forms.dart b/lib/widgets/workouts/forms.dart index d65cde3d..8fd18fc7 100644 --- a/lib/widgets/workouts/forms.dart +++ b/lib/widgets/workouts/forms.dart @@ -375,8 +375,10 @@ class _SetFormWidgetState extends State { // Save remaining settings for (var setting in widget._set.settings) { setting.setId = setDb.id; - setting.weightUnit = workoutProvider.defaultWeightUnit.id; - setting.repetitionUnit = workoutProvider.defaultRepetitionUnit.id; + + setting.weightUnit = setting.weightUnit ?? workoutProvider.defaultWeightUnit.id; + setting.repetitionUnit = + setting.repetitionUnit ?? workoutProvider.defaultRepetitionUnit.id; setting.comment = ''; setting.repsText = 'temp text'; diff --git a/pubspec.yaml b/pubspec.yaml index 2c0f156c..fa042e1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+2 +version: 1.0.0+4 environment: sdk: ">=2.7.0 <3.0.0"