小编the*_*kaa的帖子

如何让 Transform.translate 发挥作用 Flutter

我使用动画控制器在Flutter中创建了一个交错动画来运行给定的小部件。属性(缩放、旋转)在每个间隔都完美地呈现动画。

\n

但是当我去添加翻译属性时,它会抛出“未实现的错误”。

\n

我已经用不同的值等进行了重新设计,但无法让它工作。

\n

我什至尝试单独运行 .translate 属性,但仍然失败。

\n

有谁知道我做错了什么?

\n

谢谢!

\n
class _AnimatedFlyInShakeState extends State<AnimatedFlyInShake>\n    with SingleTickerProviderStateMixin {\n  late AnimationController _controller;\n  late Animation<double> _rotate, _scale, _scale2;\n  late Animation<Offset> _move;\n\n  @override\n  void initState() {\n    _controller = AnimationController(\n      duration: Duration(milliseconds: 700),\n      vsync: this,\n    );\n\n    _rotate = Tween<double>(begin: 0.20, end: 1.0).animate(CurvedAnimation(\n        parent: _controller,\n        curve: Interval(0.0, 0.70, curve: Curves.easeInOut)));\n\n    _scale = Tween<double>(begin: 0.0, end: 1.0).animate(CurvedAnimation(\n        parent: _controller,\n        curve: Interval(0.0, 0.60, curve: Curves.elasticInOut)));\n\n    _scale2 = Tween<double>(begin: 1.0, end: …
Run Code Online (Sandbox Code Playgroud)

animation flutter

5
推荐指数
1
解决办法
1695
查看次数

HiveError:HiveObject 的同一实例不能存储在两个不同的盒子中

当我尝试将相同的值保存在(多个)不同的框中时,我遇到了问题。
这是配置单元的输出:

[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: HiveError: The same instance of 
an HiveObject cannot be stored in two different boxes.
Run Code Online (Sandbox Code Playgroud)

我真的很感激,如果有人能告诉我,如何将同一个对象保存在多个框中(默认情况下这样做)?

dart flutter flutter-hive

5
推荐指数
1
解决办法
1178
查看次数

标签 统计

flutter ×2

animation ×1

dart ×1

flutter-hive ×1