// main.dart
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('image')),
body: PhotoView(
imageProvider: AssetImage('assets/images/fake250_100.png')))));
}
//pubspec.yml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
photo_view: any
//更新套件指令
flutter pub upgrade
沒有留言:
張貼留言