Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
woin2ee committed Feb 5, 2025
2 parents e2e1cb8 + f461b3c commit 38978be
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 889 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy_by_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
flutter pub get
dart run build_runner build
flutter build web --base-href "${BASE_HREF}"
- name: Copy `README.md` to the build dir
run: cp README_web.md build/web/README.md
- name: Move to build dir for web
run: cd build/web
- name: Push directory to another repository
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ lib/**/*.g.dart
# Personal
lib/example
design/

# l10n
lib/l10n/arbs/intl_messages.arb
lib/l10n/gen/messages_messages.dart
4 changes: 4 additions & 0 deletions README_web.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# DST Helper application for web 🌈
https://woin2ee.github.io/DST-Helper-web/

This repository is a dedicated one for web hosting using github pages. The source code is in [DST-Helper](https://github.com/woin2ee/DST-Helper).
30 changes: 30 additions & 0 deletions lib/cook_page/recipe_list/recipe_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:dst_helper/l10n/l10ns.dart';
import 'package:dst_helper/models/v2/item/item.dart';
import 'package:dst_helper/utils/font_family.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:toastification/toastification.dart';

class RecipeList extends StatefulWidget {
RecipeList() : super(key: GlobalKey());
Expand All @@ -21,6 +23,11 @@ class _RecipeListState extends State<RecipeList> {
Widget build(BuildContext context) {
return DragTarget<Recipe>(
onAcceptWithDetails: (details) {
var recipe = details.data;
if (_recipeListNotifier.value.contains(recipe)) {
_showToast(context);
return;
}
_recipeListNotifier.addRecipe(details.data);
},
builder: (context, candidateItems, rejectedItems) {
Expand Down Expand Up @@ -67,4 +74,27 @@ class _RecipeListState extends State<RecipeList> {
},
);
}

void _showToast(BuildContext context) {
String message() => Intl.message(
'The recipe is already registered.',
desc: "It's showed up when a duplicated recipe card is registered to list.",
locale: Localizations.localeOf(context).languageCode,
);

toastification.show(
context: context,
alignment: Alignment.bottomCenter,
icon: const Icon(Icons.warning),
style: ToastificationStyle.flatColored,
primaryColor: Colors.grey,
backgroundColor: Colors.grey.shade100,
title: Text(message()),
autoCloseDuration: const Duration(seconds: 2),
animationDuration: const Duration(milliseconds: 300),
pauseOnHover: false,
boxShadow: kElevationToShadow[3],
dragToClose: false,
);
}
}
1 change: 0 additions & 1 deletion lib/cook_page/recipe_list/recipe_list_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class RecipeListNotifier extends ChangeNotifier {
List<Recipe> get value => _value.toList();

void addRecipe(Recipe recipe) {
if (_value.contains(recipe)) return;
_value.add(recipe);
notifyListeners();
}
Expand Down
6 changes: 6 additions & 0 deletions lib/l10n/arbs/intl_en.arb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"@@last_modified": "2025-02-04T22:53:33.904153",
"@@locale": "en",
"The recipe is already registered.": "The recipe is already registered.",
"@The recipe is already registered.": {
"description": "It's showed up when a duplicated recipe card is registered to list.",
"type": "text",
"placeholders": {}
},
"seasonConditionSatisfyingText": "Becomes a giant crop in the {seasonsText}!",
"@seasonConditionSatisfyingText": {
"type": "text",
Expand Down
6 changes: 6 additions & 0 deletions lib/l10n/arbs/intl_ko.arb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"@@last_modified": "2025-02-04T22:53:33.904153",
"@@locale": "ko",
"The recipe is already registered.": "이미 등록되어 있는 레시피입니다.",
"@The recipe is already registered.": {
"description": "It's showed up when a duplicated recipe card is registered to list.",
"type": "text",
"placeholders": {}
},
"seasonConditionSatisfyingText": "{seasonsText}에 거대 작물이 됩니다!",
"@seasonConditionSatisfyingText": {
"type": "text",
Expand Down
Loading

0 comments on commit 38978be

Please sign in to comment.