Skip to content

Commit

Permalink
Merge pull request #1624 from matthiasn/new_tag_from_search
Browse files Browse the repository at this point in the history
New tag from search
  • Loading branch information
matthiasn committed Jun 22, 2023
2 parents 0eb88f7 + 6db251e commit ea36363
Show file tree
Hide file tree
Showing 27 changed files with 744 additions and 743 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Changed
- Delete icon style
- Start new tag dialog with search field content
- Whitespace on entity detail pages

## [0.8.384] - 2023-06-21
### Changed
- Audio recorder and player icons and style

## [0.8.382] - 2023-06-21
## [0.8.383] - 2023-06-21
### Changed:
- Upgraded dependencies

## [0.8.381] - 2023-06-19
## [0.8.382] - 2023-06-19
### Added:
- Shimmer animation on habit success button

Expand Down
2 changes: 1 addition & 1 deletion lib/pages/create/complete_habit_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class _HabitDialogState extends State<HabitDialog> {
padding: const EdgeInsets.all(10),
icon: Semantics(
label: 'close habit completion',
child: const Icon(Icons.close),
child: const Icon(Icons.close_rounded),
),
onPressed: () => Navigator.pop(context),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/create/create_measurement_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class _MeasurementDialogState extends State<MeasurementDialog> {
),
IconButton(
padding: const EdgeInsets.all(10),
icon: const Icon(Icons.close),
icon: const Icon(Icons.close_rounded),
onPressed: () => Navigator.pop(context, 'Close'),
),
],
Expand Down
195 changes: 91 additions & 104 deletions lib/pages/settings/categories/category_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:lotti/widgets/app_bar/title_app_bar.dart';
import 'package:lotti/widgets/categories/select_color_field.dart';
import 'package:lotti/widgets/modal/modal_action_sheet.dart';
import 'package:lotti/widgets/modal/modal_sheet_action.dart';
import 'package:lotti/widgets/settings/entity_detail_card.dart';
import 'package:lotti/widgets/settings/form/form_switch.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

Expand Down Expand Up @@ -59,118 +60,104 @@ class CategoryDetailsPage extends StatelessWidget {
)
],
),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
child: Card(
child: Padding(
padding: const EdgeInsets.all(20),
body: EntityDetailCard(
child: Column(
children: [
FormBuilder(
key: state.formKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
onChanged: cubit.setDirty,
child: Column(
children: [
FormBuilder(
key: state.formKey,
autovalidateMode:
AutovalidateMode.onUserInteraction,
onChanged: cubit.setDirty,
child: Column(
children: <Widget>[
FormBuilderTextField(
key: const Key('category_name_field'),
name: 'name',
initialValue: item.name,
textCapitalization:
TextCapitalization.sentences,
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(
fontSize: fontSizeLarge,
),
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(),
(categoryName) {
final existingId = categoryNames[
categoryName?.toLowerCase()];
if (existingId != null &&
existingId != item.id) {
return localizations
.settingsCategoriesDuplicateError;
}
return null;
}
]),
decoration: inputDecoration(
labelText: AppLocalizations.of(context)!
.settingsCategoriesNameLabel,
semanticsLabel: 'Category name field',
themeData: Theme.of(context),
),
children: <Widget>[
FormBuilderTextField(
key: const Key('category_name_field'),
name: 'name',
initialValue: item.name,
textCapitalization: TextCapitalization.sentences,
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(
fontSize: fontSizeLarge,
),
inputSpacer,
FormSwitch(
name: 'private',
initialValue: item.private,
title:
localizations.settingsHabitsPrivateLabel,
activeColor:
Theme.of(context).colorScheme.error,
),
FormSwitch(
name: 'active',
key: const Key('category_active'),
initialValue: state.categoryDefinition.active,
title: localizations.dashboardActiveLabel,
activeColor: starredGold,
),
inputSpacer,
SelectColorField(
hexColor: state.categoryDefinition.color,
onColorChanged: cubit.setColor,
),
inputSpacer,
],
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(),
(categoryName) {
final existingId =
categoryNames[categoryName?.toLowerCase()];
if (existingId != null &&
existingId != item.id) {
return localizations
.settingsCategoriesDuplicateError;
}
return null;
}
]),
decoration: inputDecoration(
labelText: AppLocalizations.of(context)!
.settingsCategoriesNameLabel,
semanticsLabel: 'Category name field',
themeData: Theme.of(context),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
key: const Key('category_delete'),
icon: Icon(MdiIcons.trashCanOutline),
iconSize: settingsIconSize,
tooltip: AppLocalizations.of(context)!
.settingsHabitsDeleteTooltip,
color: Theme.of(context).colorScheme.outline,
onPressed: () async {
const deleteKey = 'deleteKey';
final result =
await showModalActionSheet<String>(
context: context,
title: localizations.categoryDeleteQuestion,
actions: [
ModalSheetAction(
icon: Icons.warning,
label:
localizations.categoryDeleteConfirm,
key: deleteKey,
isDestructiveAction: true,
isDefaultAction: true,
),
],
);

if (result == deleteKey) {
await cubit.delete();
}
},
),
],
inputSpacer,
FormSwitch(
name: 'private',
initialValue: item.private,
title: localizations.settingsHabitsPrivateLabel,
activeColor: Theme.of(context).colorScheme.error,
),
FormSwitch(
name: 'active',
key: const Key('category_active'),
initialValue: state.categoryDefinition.active,
title: localizations.dashboardActiveLabel,
activeColor: starredGold,
),
// const HabitAutocompleteWrapper(),
inputSpacer,
SelectColorField(
hexColor: state.categoryDefinition.color,
onColorChanged: cubit.setColor,
),
inputSpacer,
],
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
key: const Key('category_delete'),
icon: Icon(MdiIcons.trashCanOutline),
iconSize: settingsIconSize,
tooltip: AppLocalizations.of(context)!
.settingsHabitsDeleteTooltip,
color: Theme.of(context).colorScheme.outline,
onPressed: () async {
const deleteKey = 'deleteKey';
final result = await showModalActionSheet<String>(
context: context,
title: localizations.categoryDeleteQuestion,
actions: [
ModalSheetAction(
icon: Icons.warning,
label: localizations.categoryDeleteConfirm,
key: deleteKey,
isDestructiveAction: true,
isDefaultAction: true,
),
],
);

if (result == deleteKey) {
await cubit.delete();
}
},
),
],
),
// const HabitAutocompleteWrapper(),
],
),
),
);
Expand Down
Loading

0 comments on commit ea36363

Please sign in to comment.