mirror of
https://github.com/theyakka/qr.flutter.git
synced 2025-05-19 21:56:27 +08:00
48 lines
1.3 KiB
Dart
48 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:qr_flutter/qr_flutter.dart';
|
|
|
|
/// This is the screen that you'll see when the app starts
|
|
class MainScreen extends StatefulWidget {
|
|
@override
|
|
_MainScreenState createState() => _MainScreenState();
|
|
}
|
|
|
|
class _MainScreenState extends State<MainScreen> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final message =
|
|
// ignore: lines_longer_than_80_chars
|
|
'Hey this is a QR code. Change this value in the main_screen.dart file.';
|
|
return Material(
|
|
color: Colors.white,
|
|
child: SafeArea(
|
|
top: true,
|
|
bottom: true,
|
|
child: Container(
|
|
child: Column(
|
|
children: <Widget>[
|
|
Expanded(
|
|
child: Center(
|
|
child: Container(
|
|
width: 280,
|
|
child: QrImage(
|
|
data: message,
|
|
foregroundColor: Color(0xff03291c),
|
|
embeddedImage: AssetImage('assets/images/logo_yakka.png'),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 40)
|
|
.copyWith(bottom: 40),
|
|
child: Text(message),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|