mirror of
https://github.com/theyakka/qr.flutter.git
synced 2025-08-06 10:29:33 +08:00
added an example so pub doesn't punish us
This commit is contained in:
47
example/lib/main_screen.dart
Normal file
47
example/lib/main_screen.dart
Normal file
@ -0,0 +1,47 @@
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user