ViewGroup类中dispatchDraw(Canvas canvas)方法的用途是什么?
我想在用户未与应用程序交互一段特定时间后注销用户。
我已将整个子小部件包装在GestureDetector().
请建议这是否是执行此操作的最佳优化方法。
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new GestureDetector(
onTap: () {
// duration reset's to a specific time
startTimeout([int milliseconds]) { return new Timer(duration, handleTimeout); }
},
child: new HomeWidget(),);
}
void handleTimeOut {
// Log User Out
}
}
Run Code Online (Sandbox Code Playgroud) 如何更改下拉箭头颜色?
这是我想要的:
这就是我得到的
我的小部件:
DropdownButtonHideUnderline (
child: DropdownButton<String>(
isExpanded: true,
value: dropdownValue,
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>['Bank Deposit', 'Mobile Payment', 'Cash Pickup']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
})
.toList(),
),
),
Run Code Online (Sandbox Code Playgroud)
我尝试用主题包装并更改亮度,但它仅将箭头从白色更改为黑色。我想用其他颜色。