以下のサンプルソース(main.dart)を実行させたのですが、画像表示ができませんでした
実行ログを確認したところエラーが発生していました。
現在、原因を調査中です。
- main.dart
dart
1import 'package:flutter/material.dart'; 2 3void main() { 4 runApp(MyApp()); 5} 6 7class MyApp extends StatelessWidget { 8 // This widget is the root of your application. 9 10 Widget build(BuildContext context) { 11 return MaterialApp( 12 title: 'Flutter Demo', 13 theme: ThemeData( 14 primarySwatch: Colors.blue, 15 visualDensity: VisualDensity.adaptivePlatformDensity, 16 ), 17 home: MyHomePage(title: 'Flutter Demo Home Page'), 18 ); 19 } 20} 21 22class MyHomePage extends StatefulWidget { 23 MyHomePage({Key key, this.title}) : super(key: key); 24 final String title; 25 26 _MyHomePageState createState() => _MyHomePageState(); 27} 28 29class _MyHomePageState extends State<MyHomePage> { 30 31 32 Widget build(BuildContext context) { 33 return Scaffold( 34 appBar: AppBar( 35 title: Text(widget.title), 36 ), 37 body: Center( 38 child:Image.network('https://nzigen.com/flutter-reference/assets/img/samples/logo-jumper.png'), 39 ), 40 ); 41 } 42}
- 実行ログ
Performing hot restart... Syncing files to device sdk gphone x86... Restarted application in 952ms. ════════ Exception caught by image resource service ════════════════════════════════════════════════ The following HandshakeException was thrown resolving an image codec: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(handshake.cc:354)) When the exception was thrown, this was the stack: Image provider: NetworkImage("https://nzigen.com/flutter-reference/assets/img/samples/logo-jumper.png", scale: 1.0) Image key: NetworkImage("https://nzigen.com/flutter-reference/assets/img/samples/logo-jumper.png", scale: 1.0) ════════════════════════════════════════════════════════════════════════════════════════════════════
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/12/26 04:08
2020/12/26 04:13
2020/12/26 06:21