Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#157 感想投稿ページの実装 #201

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

haterain0203
Copy link
Collaborator

Issue

close #157

説明

  • 感想投稿と感想更新ページ(UI)と処理の実装
  • 感想投稿ページの実装 #157 の通り、導線未定のため、development ページの中に固定の jobId をパスパラメータを渡して投稿or更新できる状態
  • 実装済みである job の投稿画面および実装を参考にしました!

UI

投稿画面

更新画面

その他

  • 何箇所か相談・確認したいポイントをコメントしますので、こちらも合わせてご確認お願いします🙇‍♂️

チェックリスト

  • PR の冒頭に関連する Issue 番号を記載しましたか?
  • 本 PR の変更に関して、エディタや IDE で意図しない警告は増えていませんか?(lint 警告やタイポなど)
  • Issue の完了の定義は満たせていますか?
  • 当該 Issue のスレッドで、レビュワーにレビュー依頼をしましたか?

imageFile: pickedImageFile,
);
}
//TODO: 登録 or 更新完了の旨をユーザーに示すUIが必要か?
Copy link
Collaborator Author

@haterain0203 haterain0203 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

現状だと、登録 or 更新完了した際に何もアクションがないので、ユーザーに何かしら通知する
といった対応が必要かと思うのですが、これは別issueで対応でも良さそうでしょうか?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haterain0203 ありがとうございます!いったん OK です!たんに SnackBar を出せば良さそうかなと思います!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kosukesaigusa
ありがとうございます!
承知しました!
一旦このままとしておきます!

}
}

//TODO JobForm で使用しているものと同様のため、dart_flutter_common で共通化すべきか?
Copy link
Collaborator Author

@haterain0203 haterain0203 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上記について、
こういった場合は、dart_flutter_common で共通化すべきですかね?
それとも、mottai_flutter_app 内のどこかで共通化すべきですか??

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mottai_flutter_app で共通化できればしたいです!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kosukesaigusa
ありがとうございます!
mottai_flutter_app で共通化してみます!
出来次第またレビュー依頼させていただきます!

Comment on lines +31 to +33
final asyncValue = ref.watch(reviewFutureProvider(reviewId));
final review = asyncValue.valueOrNull;
final isLoading = asyncValue.isLoading;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

更新時はパスパラメータの reviewId を使って該当の Review を取得していますが、
更新する場合、前の画面ですでに Review を取得済みの場合が多いかと思うので、Review ごと渡すことで都度の取得処理が不要になる?かと思ったのですが、どうでしょうか・・・?
(そもそもauto_routeでそういったことができないかもですが)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haterain0203

インスタンスごと渡すという考え方ですね!読み取り回数を減らすという意味ではいいアイディアですし、実際にそうするプロジェクトもよくあると思います!が、

  • 一応ここで明示的に取得することで最新であることを担保する
  • このページは関係ないですが、auto_route を使ってどんな画面にもパスパラメータ、クエリパラメータで必要な情報とともに遷移できるようにしているので、プッシュ通知をタップして特定の画面に飛びたい時(つまり Dart のインスタンスは渡せない)や、Flutter Web で URL を直接入力して特定の画面を開きたい時(同じく Dart のインスタンスは渡せない)にも対応できるようにする方針で統一している

という理由でこれでいいと思います!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kosukesaigusa
なるほど!勉強になりました!
ありがとうございます!

imageFile: pickedImageFile,
);
}
//TODO: 登録 or 更新完了の旨をユーザーに示すUIが必要か?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haterain0203 ありがとうございます!いったん OK です!たんに SnackBar を出せば良さそうかなと思います!


class ReviewFormState extends ConsumerState<ReviewForm> {
/// フォームのグローバルキー
final formKey = GlobalKey<FormState>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Job などを参考にしていただいたと思うのですが、簡便化のために辞める予定です!いまはこのままでいいです!

Comment on lines +31 to +33
final asyncValue = ref.watch(reviewFutureProvider(reviewId));
final review = asyncValue.valueOrNull;
final isLoading = asyncValue.isLoading;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haterain0203

インスタンスごと渡すという考え方ですね!読み取り回数を減らすという意味ではいいアイディアですし、実際にそうするプロジェクトもよくあると思います!が、

  • 一応ここで明示的に取得することで最新であることを担保する
  • このページは関係ないですが、auto_route を使ってどんな画面にもパスパラメータ、クエリパラメータで必要な情報とともに遷移できるようにしているので、プッシュ通知をタップして特定の画面に飛びたい時(つまり Dart のインスタンスは渡せない)や、Flutter Web で URL を直接入力して特定の画面を開きたい時(同じく Dart のインスタンスは渡せない)にも対応できるようにする方針で統一している

という理由でこれでいいと思います!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

感想投稿ページの実装
2 participants