最近、私はflutterを使ってウェブインターフェースを開発していたのですが、この問題が出てきました。
Overflow on channel: flutter/platform. Messages on this channel are being discarded in FIFO fashion. The engine may not be running or you need to adjust the buffer size if of the channel.
githubの42880 issues見ると、チャンネルの問題であり、将来的に変更されると書かれていますが、よく見てみるとそうではなく、ステータスバーのプロパティが変更されたことに関係していることに気づきました。
解決方法
brightness
ステータスバーのフォントカラーを変更するためにAppBarが使われている場所を、プロジェクト内で以下のように探してください。
AppBar(
brightness: Brightness.light,
);
かきかえる
AppBar(
brightness: kIsWeb ? null : Brightness.light,
);
AnnotatedRegion
ご存知のように、ステータスバーの色もここで変更します。
AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.dark,
)
ウェブ上では、使わなければいいだけです。こんな感じで。
Widget build(BuildContext context) {
return kIsWeb
? mainWidgets
: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.dark, child: mainWidgets);
}