问题是我想在文本字段的值末尾添加“,00”在 iOS 设备中效果很好,但在 android 中光标移动到文本字段中值的起点。所以,我无法添加“,00”。
不知道如何从颤振中的云函数中获得响应。
我的云功能
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.testDemo = functions.https.onRequest((request, response) => {
return response.status(200).json({msg:"Hello from Firebase!"});
});
Run Code Online (Sandbox Code Playgroud)
我的颤振代码
///Getting an instance of the callable function:
try {
final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable(
functionName: 'testDemo',);
///Calling the function with parameters:
dynamic resp = await callable.call();
print("this is responce from firebase $resp");
} on CloudFunctionsException catch (e) {
print('caught firebase functions exception');
print(e.code);
print(e.message);
print(e.details);
} catch (e) {
print('caught generic exception');
print(e);
}
Run Code Online (Sandbox Code Playgroud)
颤振:捕获了 Firebase 函数异常颤振:内部颤振:响应缺少数据字段。颤振:空
我将google map小部件添加到具有边框半径的容器中,但google map角未圆化。
Container(
height: 100,
width: double.infinity,
margin: EdgeInsets.only(left: 30, right: 30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(
style: BorderStyle.solid,
),
),
child: GoogleMap(),)Run Code Online (Sandbox Code Playgroud)
如何在 flutter 中使用 where 和 orderBy。
任何人都可以告诉我这些索引是如何工作的以及如何正确创建它们。
Query query = Firestore.instance
.collection('clients')
.where('sequenceStatus', isEqualTo: sequenceName)
.orderBy('created', descending: true)
.limit(20);
Run Code Online (Sandbox Code Playgroud)
W/Firestore(19854):(19.0.0) [Firestore]:侦听查询(其中sequenceStatus ==引用 order by -created, - name的客户端)失败:Status{code=FAILED_PRECONDITION,description=查询需要索引。您可以在此处创建它: https: //console.firebase.google.com/project/rigatoinfissitest/database/firestore/indexes ?create_composite =ClFwcm9qZWN0cy9yaWdhdG9pbmZpc3NpdGVzdC9kYXRhYmFzZXMvKGRlZmF1bHQpL2NvbGxlY3Rpb25Hcm91cHMvY2 xpZW50cy9pbmRleGVzL18QARoSCg5zZXF1ZW5jZVN0YXR1cxABGgsKB2NyZWF0ZWQQAhoMCghfX25hbWVfXxAC,原因=null}
在选项卡之间切换 initstate() 被多次调用。
我的标签栏中有 4 个标签 A、B、C 和 D。
情况(1)如果我像从选项卡 A 切换到选项卡 B 一样,它工作正常。
情况 (2) 但如果我要转到选项卡 A 到 C,则选项卡“B”的 initstate() 会调用两次
案例(1)结果
扑动:A
颤振:B
案例(2)的结果
扑动:A
颤振:B
颤振:C
颤振:B
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) …Run Code Online (Sandbox Code Playgroud) 想要找到 2 个点的中心并适合地图。当我在地图上查看时,我想适合所有屏幕。我准备好绘制路线,但它只适合 1 点。请帮我。这个类是用于颤振的地图视图。我尝试更多天找到插件和解决方案,但仍未找到。
GoogleMap(
mapType: MapType.normal,
markers: _markers,
// cameraTargetBounds: CameraTargetBounds(new LatLngBounds(
// northeast: LatLng(latFrom, logFrom),
// southwest: LatLng(latTo, logTo),
// )),
// minMaxZoomPreference: MinMaxZoomPreference(1, 15),
mapToolbarEnabled: true,
scrollGesturesEnabled: true,
zoomGesturesEnabled: true,
trafficEnabled: true,
compassEnabled: true,
indoorViewEnabled: true,
rotateGesturesEnabled: true,
tiltGesturesEnabled: true,
myLocationButtonEnabled: true,
myLocationEnabled: true,
polylines: _polyline,
// padding: EdgeInsets.all(20),
initialCameraPosition:
CameraPosition(
target: LatLng(latFrom, logFrom),
zoom: 10,
),
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
})
Run Code Online (Sandbox Code Playgroud) 我想重新排序我的列表,但出现此错误。该小部件的所有子项都必须在可重新排序列表视图中拥有一个键
Widget list(list) {
return Scrollbar(
child: ReorderableListView(
header: null,
onReorder: _onReorder,
padding: const EdgeInsets.symmetric(vertical: 8.0),
children: <Widget>[
ListView.builder(
itemCount: list.length,
shrinkWrap: true,
itemBuilder: (contex, index) {
return _singleToDoWidget(list[index], index);
},
)
]),
);
}
Run Code Online (Sandbox Code Playgroud) 我没有找到构造函数的任何示例CupertinoFullscreenDialogTransition
https://api.flutter.dev/flutter/cupertino/CupertinoFullscreenDialogTransition-class.html
我试图理解下面的代码,但我没有明白。
CupertinoFullscreenDialogTransition({
Key key,
@required Animation<double> animation,
@required this.child,
}) : _positionAnimation = CurvedAnimation(
parent: animation,
curve: Curves.linearToEaseOut,
// The curve must be flipped so that the reverse animation doesn't play
// an ease-in curve, which iOS does not use.
reverseCurve: Curves.linearToEaseOut.flipped,
).drive(_kBottomUpTween),
super(key: key);
Run Code Online (Sandbox Code Playgroud) 我们如何在 Dropdown 中更改 Flutter DropdownMenuItem 的宽度/填充?
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LightText(
text: "Agent",
),
Padding(
padding: EdgeInsets.only(top: 3),
),
Container(
height: 27,
child: Row(
children: <Widget>[
DropdownButtonHideUnderline(
child: DropdownButton<Agent>(
// isExpanded: true,
hint: Text(
agentName == null ? "" : agentName,
style: TextStyle(
fontSize: MediaQuery.of(context).size.width * 0.035,
),
),
value: selectedAgent,
onChanged: (Agent value) async {
selectedAgent = value;
agentName = selectedAgent.getAgentName();
agentId = selectedAgent.getAgentId();
},
items: agentList.map((Agent agent) {
return DropdownMenuItem<Agent>(
value: agent, …Run Code Online (Sandbox Code Playgroud)