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

Session3 #4

Open
github-actions bot opened this issue Jun 6, 2023 · 0 comments · May be fixed by #16
Open

Session3 #4

github-actions bot opened this issue Jun 6, 2023 · 0 comments · May be fixed by #16
Labels

Comments

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

StatefulWidget のライフサイクル

Flutter の StatefulWidget にも、iOS の UIViewController や Android の Activity のようなライフサイクルがあります。

iOS・Android と異なる点があるため、きちんと確認しておきましょう。

課題

  • StatefulWidget を継承した Widget で構築された新しい画面を追加する
  • 新しい画面の背景色は Colors.green に設定する
  • アプリ起動時に新しい画面に遷移する
  • 新しい画面が表示されたら、0.5 秒後に前回まで作っていた画面に遷移する
  • 前回まで作っていた画面の Close ボタンをタップすると画面を閉じる

動作イメージ

demo

ヒント

WidgetsBinding.instance.endOfFrame を利用すると、画面の描画が終わってから処理を実行することができます。

画面遷移は外部パッケージを利用しても問題ありませんが、本課題では Navigator の命令型 API を利用すると比較的簡単に実装できます。

参考資料

@CatNighp CatNighp linked a pull request Jun 19, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants