Skip to content

Commit

Permalink
Merge pull request #1627 from matthiasn/tag_chip_style
Browse files Browse the repository at this point in the history
Tag chip style
  • Loading branch information
matthiasn authored Jun 23, 2023
2 parents 4b1aec6 + 00eef33 commit 801ec16
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Changed:
- Upgraded dependencies

### Fixed:
- Text color on tag and task status chips

## [0.8.387] - 2023-06-22
### Changed:
- Unfocus keyboard on entry/task save

## [0.8.386] - 2023-06-22
Expand Down
11 changes: 9 additions & 2 deletions lib/widgets/journal/tags/tag_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:lotti/services/nav_service.dart';
import 'package:lotti/themes/colors.dart';
import 'package:lotti/themes/theme.dart';
import 'package:lotti/themes/utils.dart';
import 'package:tinycolor2/tinycolor2.dart';

class TagWidget extends StatelessWidget {
const TagWidget({
Expand All @@ -19,13 +20,19 @@ class TagWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final localizations = AppLocalizations.of(context)!;
final tagColor = getTagColor(tagEntity);

return Chip(
label: GestureDetector(
onDoubleTap: () => beamToNamed('/settings/tags/${tagEntity.id}'),
child: Text(tagEntity.tag),
child: Text(
tagEntity.tag,
style: TextStyle(
color: tagColor.isLight ? Colors.black : Colors.white,
),
),
),
backgroundColor: getTagColor(tagEntity),
backgroundColor: tagColor,
visualDensity: VisualDensity.compact,
onDeleted: onTapRemove,
deleteIcon: const Icon(
Expand Down
9 changes: 7 additions & 2 deletions lib/widgets/tasks/task_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:lotti/classes/journal_entities.dart';
import 'package:lotti/themes/theme.dart';
import 'package:lotti/utils/task_utils.dart';
import 'package:tinycolor2/tinycolor2.dart';

class TaskStatusWidget extends StatelessWidget {
const TaskStatusWidget(
Expand All @@ -15,6 +16,7 @@ class TaskStatusWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final localizations = AppLocalizations.of(context)!;
final backgroundColor = taskColor(task.data.status) ?? Colors.grey;

return Chip(
label: Text(
Expand All @@ -29,9 +31,12 @@ class TaskStatusWidget extends StatelessWidget {
done: (_) => localizations.taskStatusDone,
rejected: (_) => localizations.taskStatusRejected,
),
style: const TextStyle(fontSize: fontSizeSmall),
style: TextStyle(
fontSize: fontSizeSmall,
color: backgroundColor.isLight ? Colors.black : Colors.white,
),
),
backgroundColor: taskColor(task.data.status),
backgroundColor: backgroundColor,
visualDensity: VisualDensity.compact,
);
}
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2081,10 +2081,10 @@ packages:
dependency: transitive
description:
name: sqlparser
sha256: "1c075a15ff144b9f381140b9abc73f46b3f88a7fce9207d3d6607a3c24439cf6"
sha256: "9611f46d30a4e8286e54d17a1b5182d132512dc6fc3da90c45ad8ec2828a58b1"
url: "https://pub.dev"
source: hosted
version: "0.30.2"
version: "0.30.3"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -2257,10 +2257,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: eed4e6a1164aa9794409325c3b707ff424d4d1c2a785e7db67f8bbda00e36e51
sha256: "15f5acbf0dce90146a0f5a2c4a002b1814a6303c4c5c075aa2623b2d16156f03"
url: "https://pub.dev"
source: hosted
version: "6.0.35"
version: "6.0.36"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -2465,10 +2465,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: "7dacfda1edcca378031db9905ad7d7bd56b29fd1a90b0908b71a52a12c41e36b"
sha256: "1414f27dd781737e51afa9711f2ac2ace6ab4498ee98e20863fa5505aa00c58c"
url: "https://pub.dev"
source: hosted
version: "5.0.3"
version: "5.0.4"
win32_registry:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: lotti
description: Achieve your goals and keep your data private with Lotti.
publish_to: 'none'
version: 0.9.387+2274
version: 0.9.388+2276

msix_config:
display_name: LottiApp
Expand Down

0 comments on commit 801ec16

Please sign in to comment.