0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Flutter】スタックされた画面をすべて破棄する

0
Posted at

ログアウトして、
スタックしていた画面をすべて破棄してスプラッシュやログイン画面を表示する場合、
pushAndRemoveUntil を使う。

    Navigator.pushAndRemoveUntil(
      context,
      MaterialPageRoute<void>(builder: (context) => LoginPage()),
      (_) => false,
    );

第三引数のpredicateを、falseにすることでスタックしていたものを全て消す。

環境

  • Flutter version 3.10.5
  • Android Studio (version 2022.2)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?