作成
【Flutter】Undefined name 'rootBundle'. Try correcting the name to one that is defined
###source final html = await rootBundle.loadString('assets/index.html'); final uri = Uri.dataFromString( html, mimeType: 'text/html', encoding: Encoding.getByName('utf-8'), ); ### flutter で ローカルHTML を読み込む際などに使用する rootBundle.loadString で下記のようなエラーが出た場合 ###error Undefined name 'rootBundle'. Try correcting the name to one that is defined, or defining the name. ### 以下でエラー解除されます。 ###solve import 'package:flutter/services.dart' show rootBundle; ### ###source import 'package:flutter/services.dart' show rootBundle; // 省略 final html = await rootBundle.loadString('assets/index.html'); final uri = Uri.dataFromString( html, mimeType: 'text/html', encoding: Encoding.getByName('utf-8'), );
wakatta 記法
投稿の仕方
基本的な記法
エンジニア向け記法
記法のサンプル
このコンテンツを見る