Files
qr.flutter/example/lib/main_screen.dart
2019-08-19 16:47:17 -07:00

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),
),
],
),
),
),
);
}
}