如何在没有导航器的情况下将动画带到另一个类(页面)上?

时间:2021-02-03 15:06:00

标签: flutter dart

    final loginButton = RaisedButton(
  shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(32)),
  child: Text(
    'Sign In',
    style: TextStyle(color: Colors.brown[800]),
  ),
  color: Colors.amber,
  padding: EdgeInsets.symmetric(vertical: 10),
  textColor: Colors.black,
  onPressed: () {
    if (email == 'test' && password == '1234') {
      return Navigator.pushNamed(context, '/primaryTable');
    } else {
      Navigator.of(context)  //here
          .overlay
          .insert(OverlayEntry(builder: (BuildContext context) {
        return NotifySth();
      }));
    }
  },
);

。 . . 我不想使用 Navigator 因为当我按下 loginButton 时它会屏蔽我的 homePage 。当我按下它时,我希望它只在我的主页上显示 topCenter。怎么改?

0 个答案:

没有答案
相关问题