Add drag icon to bottom sheet

This should make more obvious that the whole sheet can be dragged down
This commit is contained in:
Roland Geider
2021-02-18 21:38:35 +01:00
parent ec1fff3289
commit aab622bb83
5 changed files with 43 additions and 26 deletions

View File

@@ -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)

View File

@@ -23,17 +23,23 @@ Future<Widget> 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,
)
],
);
});
}

View File

@@ -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<WorkoutPlans>(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: [

View File

@@ -375,8 +375,10 @@ class _SetFormWidgetState extends State<SetFormWidget> {
// 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';

View File

@@ -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"