小编rav*_*508的帖子

Flutter 中导航的回调函数

在导航器中,我们可以使用.then. 例如:

 Navigator.push(
        context,
        MaterialPageRoute(
          builder: (context) => XyzScreen(),
        ),
      ).then((value) => _someFuncion());
Run Code Online (Sandbox Code Playgroud)

那么有什么办法可以实现同样的功能go_router吗?

navigation callback dart flutter gorouter

6
推荐指数
1
解决办法
2116
查看次数

是否可以在 Flutter 的自定义绘画中提供渐变模糊效果,如下图所示?

我正在对下面的输出进行编码,我得到了我想要的设计,但无法在画布内获得模糊效果。

这是我试图构建的输出,
我想要的输出

这就是我尝试过的 我的输出

这是代码,

class MyCustomPainter extends CustomPainter {

@override



 void paint(Canvas canvas, Size size) {
    Paint paint0 = Paint()
      ..color = const Color.fromARGB(128,255,255,255)
    ..style = PaintingStyle.fill
    ..strokeWidth = 2.0;

Path path0 = Path();
path0.moveTo(size.width * 0.1500300, size.height * 0.1238500);
path0.cubicTo(
    size.width * 0.0037200,
    size.height * 0.1023500,
    size.width * 0.0522600,
    size.height * 0.7552500,
    size.width * 0.1500500,
    size.height * 0.8761750);
path0.cubicTo(
    size.width * 0.2767600,
    size.height * 0.8761750,
    size.width * 0.7234100,
    size.height * 0.8735500,
    size.width * 0.8501100,
    size.height * 0.8735500);
path0.cubicTo(
    size.width …
Run Code Online (Sandbox Code Playgroud)

user-interface paint flutter flutter-layout flutter-custompaint

4
推荐指数
1
解决办法
1945
查看次数