小编Val*_*nal的帖子

Flutter 延迟动画代码错误:在 AnimationController.dispose() 之后调用 AnimationController.forward()

我在欢迎屏幕中实现了延迟动画,但在我的 flutter 应用程序中出现以下错误。如果我的代码中有错误,请告诉我,我可以纠正并解决此问题。

错误是:

E/flutter (11565): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)]
Unhandled Exception:
'package:flutter/src/animation/animation_controller.dart': Failed
assertion: line 455 pos 7: '_ticker != null':
AnimationController.forward() called after
AnimationController.dispose()
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

E/flutter (11565): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)]
Unhandled Exception:
'package:flutter/src/animation/animation_controller.dart': Failed
assertion: line 455 pos 7: '_ticker != null':
AnimationController.forward() called after
AnimationController.dispose()
Run Code Online (Sandbox Code Playgroud)

dart flutter

3
推荐指数
1
解决办法
3833
查看次数

为什么 flutter 在 url 启动器中给我 url null ?

ElevatedButton(
  onPressed: () async {
    const url ='https://www.facebook.com';

    if (await canLaunch(url)) {
      await launch(url,forceWebView: true,enableJavaScript: true);
    } else {
      // can't launch url
    }
  },
);
Run Code Online (Sandbox Code Playgroud)
I/UrlLauncher( 7566): component name for https://www.facebook.com is null
Run Code Online (Sandbox Code Playgroud)

url launcher flutter

3
推荐指数
1
解决办法
3446
查看次数

嵌套滚动视图的主体溢出 - 颤动

屏幕截图应用程序

我制作了一个页面NestedScrollView,其主体NestedScrollView是一个容器,用于保存以前请求的数据。但身体NestedScrollView已经溢出了。下面的代码:

NestedScrollView(
          controller: _scrollViewController,
          headerSliverBuilder:
              (BuildContext context, bool innerBoxIsScrolled) {
            return <Widget>[
              SliverAppBar(
                title: new Text(
                  nama,
                  style: TextStyle(color: putih),
                ),
                iconTheme: IconThemeData(color: putih),
                backgroundColor: colorPrimaryDark,
              )
            ];
          },
          body: Container(
            child: Column(
              children: <Widget>[
                Container(
                  color: goldtua,
                  child: Padding(
                    padding: const EdgeInsets.all(12.0),
                    child: Row(
                      mainAxisSize: MainAxisSize.max,
                      children: <Widget>[
                        Text(
                          string.harga,
                          style: TextStyle(color: putih, fontSize: 24.0),
                        ),
                        Text(
                          formatingRupiah(harga),
                          style: TextStyle(color: putih, fontSize: 24.0),
                        ),
                      ],
                    ),
                  ),
                ),
                Expanded(
                  child: Padding(
                    padding: const …
Run Code Online (Sandbox Code Playgroud)

nestedscrollview flutter flutter-layout

2
推荐指数
1
解决办法
1万
查看次数

具有泛型类型的 Dart 扩展类不会使用直接父类型

我有 2 个类(BC),我正在尝试创建一个父类型,以便我可以操作type 的A变量。下面的例子工作正常:aA

class A {}

class B extends A {}

class C extends A {}

var b = true;

final A a = b ? C() : B();
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,当A有泛型类型时A<T>,它不起作用

class A<T> {}

class B extends A<int> {}

class C extends A<String> {}

var b = true;

final A a = b ? C() : B(); // <- Error
Run Code Online (Sandbox Code Playgroud)

我收到 linting 错误:

A value of type 'Object' …
Run Code Online (Sandbox Code Playgroud)

abstract-class extends types dart

0
推荐指数
1
解决办法
358
查看次数