Skip to content

Commit

Permalink
bump: 3.2.5+1
Browse files Browse the repository at this point in the history
fix: answer should be in box
  • Loading branch information
Arenukvern committed Oct 21, 2021
1 parent 0495fe8 commit 4a87a09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
20 changes: 13 additions & 7 deletions lib/abstract/idea_project/idea_project_answer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ class IdeaProjectAnswer extends HiveObject
static Future<IdeaProjectAnswer> create({
required final String text,
required final IdeaProjectQuestion question,
}) async =>
IdeaProjectAnswer(
text: text,
question: question,
id: createId(),
created: DateTime.now(),
);
}) async {
final answer = IdeaProjectAnswer(
text: text,
question: question,
id: createId(),
created: DateTime.now(),
);
final box = await Hive.openBox<IdeaProjectAnswer>(
HiveBoxesIds.ideaProjectAnswerKey,
);
await box.put(answer.id, answer);
return answer;
}

@HiveField(0)
String text;
Expand Down
5 changes: 1 addition & 4 deletions lib/screens/idea_project/widgets/answer_creator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class _AnswerCreator extends HookWidget {
if (question == null || text.isEmpty) return;
final answer =
await IdeaProjectAnswer.create(text: text, question: question);
final box = await Hive.openBox<IdeaProjectAnswer>(
HiveBoxesIds.ideaProjectAnswerKey,
);
await box.put(answer.id, answer);

onCreated(answer);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 3.2.4+1
version: 3.2.5+1

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down

0 comments on commit 4a87a09

Please sign in to comment.