我正在尝试获取当前的小吃店(显示一个)以确定它是否与我试图展示的小吃相同;换句话说,我不想复制小吃,但我无法得到它。
我试图用谷歌搜索它,但没有任何显示,真正让我生气的是当我Scaffold.of(context).showSnackBar(sb);多次打电话时,他们会一次显示一个直到他们结束。
import 'package:flutter/material.dart';
const sb = SnackBar(
content: Text('the snack bar'),
);
void main() => runApp(MaterialApp(
title: 'Snack bar test',
home: Scaffold(
appBar: AppBar(
title: Text('snack bar demo'),
),
body: Center(
child: MyApp(),
),
),
));
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return RaisedButton(
child: Text('push to test'),
onPressed: () {
// Scaffold.of(context).
Scaffold.of(context).showSnackBar(sb);
},
);
}
}
Run Code Online (Sandbox Code Playgroud)
我想要实现的是这样的:-
if (sb.isShowing()){
//hide or remove it
}
Run Code Online (Sandbox Code Playgroud)
并提前致谢。
我想要的是链接多个Animation对象,就像我们有一个Animation<double>从 0 到 40 的对象(我们称之为大对象),而我还有另外 4 个 Animation<double>对象,我想要的是
有人知道如何在颤振中做到这一点吗?