flutter util---->常用的一些工具方法
copy text to clipboard
Clipboard.setData(ClipboardData(text: string));
since Flutter1.9, you can use SelectableText
, it enable the copy feature.
get text from clipboard
final clipboardData = await Clipboard.getData(Clipboard.kTextPlain);
String content = clipboardData.text;
close the keyboard
// Flutter v1.7.8+hotfix.2
FocusScope.of(context).unfocus();
// Before
FocusScope.of(context).requestFocus(FocusNode());
fix issue ListView inside ListView
add code as follow in the nested ListView
shrinkWrap: true,
physics: ClampingScrollPhysics(),
transparent appbar
Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
....
)
)
hide the back button in the appbar
AppBar(
automaticallyImplyLeading: false,
)
To be continue
Everything will be alright because of you.
作者:
huhx
出处: www.cnblogs.com/huhx
格言:你尽力了,才有资格说自己的运气不好。
版权:本文版权归作者huhx和博客园共有,欢迎转载。未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。
出处: www.cnblogs.com/huhx
格言:你尽力了,才有资格说自己的运气不好。
版权:本文版权归作者huhx和博客园共有,欢迎转载。未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。