refactor: microtask

This commit is contained in:
Rongjian Zhang 2020-01-14 12:33:18 +08:00
parent dd093bc7f7
commit 271e8bd761
2 changed files with 1 additions and 9 deletions

View File

@ -20,8 +20,7 @@ class NewsScreenState extends State<NewsScreen> {
@override
initState() {
super.initState();
// FIXME:
nextTick(() async {
Future.microtask(() async {
// Check if there are unread notification items.
// 1 item is enough since count is not displayed for now.
var items = await Provider.of<AuthModel>(context)

View File

@ -51,13 +51,6 @@ Color getFontColorByBrightness(Color color) {
return showWhite ? Colors.white : Colors.black;
}
void nextTick(Function callback, [int milliseconds = 0]) {
// FIXME:
Future.delayed(Duration(milliseconds: 0)).then((_) {
callback();
});
}
TextSpan createLinkSpan(
BuildContext context,
String text,