看看视频看看我在说什么?
在我开始制作自定义小部件之前,我想看看是否有人知道用 vanilla Flutter 解决这个问题的方法。它似乎与 TextEditingController 相关,但我不完全确定。
当 TextField 设置为居中或右对齐时,它似乎工作得很好,但在左/开始/对齐时,它似乎总是有轻微的抖动。
提前致谢!~ 我也可以把它发布到 Github 存储库
编辑:您可以看到只有当光标移动到文本字段的左侧时才会抖动。当它在字符串内移动时,它根本不会抖动。我在模拟的 iPhone 11 上对此进行了测试
当我使用showModalBottomSheet方法弹出bottomSheet时,如何使背景色透明。因为我需要圆角,所以我知道在materialApp中更改canvasColor可以解决问题,但是其他小部件也可以更改颜色。
我试图将其嵌入主题中,但是没有用
showModalBottomSheet < Null > (context: context, builder: (BuildContext context) {
return Theme(
data: Theme.of(context).copyWith(canvasColor: Colors.orange),
child: Material(
borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
child: Container(
color: Colors.purple,
),
),
);
});
Run Code Online (Sandbox Code Playgroud)