有什么方法可以在TextField中进行货币格式设置,以便当用户输入要实时格式化的值时?
就像上图中一样,当用户输入格式时,格式会更新已格式化的值。
[更新]
我刚刚发现这个使它像魅力一样起作用的库:https : //pub.dartlang.org/packages/flutter_masked_text
我想知道如何从 Flutter 上的路径获取对象列表,这是我获取一个对象并正常工作的方法:
static Future<Year> getYear(
String yearKey) async {
Completer<Year> completer = new Completer<Year>();
FirebaseDatabase.instance
.reference()
.child("year")
.child(yearKey)
.once()
.then((DataSnapshot snapshot) {
var year = new Year.fromJson(snapshot.key, snapshot.value);
completer.complete(year);
});
return completer.future;
}
Run Code Online (Sandbox Code Playgroud)
现在我正在尝试以这种方式获取同一路径中所有年份的列表,但不知道如何迭代项目:
static Future<List<Year>> getYears() async {
Completer<List<Year>> completer = new Completer<List<Year>>();
List<Year> years = new List<Year>();
FirebaseDatabase.instance
.reference()
.child("year")
.once()
.then((DataSnapshot snapshot) {
//how to iterate over the items here?
completer.complete(years);
});
return completer.future;
}
Run Code Online (Sandbox Code Playgroud)
请有人帮助我。
我想知道如何使用新查询、更改路径的新内容重建 FirebaseAnimatedList。
new Flexible(
child: new FirebaseAnimatedList(
query: query,
sort: (DataSnapshot a, DataSnapshot b) =>
b.key.compareTo(a.key),
itemBuilder: (BuildContext context, DataSnapshot snapshot,
Animation<double> animation, int index) {...})
Run Code Online (Sandbox Code Playgroud)
当我实时更改查询时,它不会更改列表中的结果:
setState(() {
query = "another/path";
});
Run Code Online (Sandbox Code Playgroud) 我想知道是否有办法在Flutter中查询firebase firestore集合,为查询添加多个字段.我尝试了一些方法,但我没有意识到如何做到这一点.例如:
CollectionReference col = Firestore.instance
.collection("mycollection");
col.where('nome', isEqualTo: 'Tyg');
col.where('valor', isLessThan: '39');
Run Code Online (Sandbox Code Playgroud)
请有人有办法做到这一点吗?我是新的扑克而不是顺便说一句.
我想知道是否有可能只有月份和年份的选择器,而对于当前的DatePicker,我没有找到此选项。
先感谢您。