1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| import 'package:flutter/material.dart'; import 'package:qr_flutter/qr_flutter.dart';
main() async { runApp(const MaterialApp( home: App(), )); }
class App extends StatefulWidget { const App({super.key});
@override AppState createState() => AppState(); }
class AppState extends State<App> { final GlobalKey qrKey = GlobalKey();
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text("文本内容")), body: Column( children: [ QrImageView( data: '1', version: QrVersions.auto, size: 200.0, gapless: false, embeddedImage: AssetImage("images/图片名.jpg"), embeddedImageStyle: QrEmbeddedImageStyle( size: Size(80, 80), ), ) ], ), ); } }
|