加载本地图片
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: Scaffold( appBar: AppBar(title: const Text("加载本地图片")), body: const MyApp()), )); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return Center( child: Container( decoration: const BoxDecoration(color: Colors.lightBlue), child: Image.asset( "assets/splash.png", fit: BoxFit.cover, ), ), ); } }