Skip to content

Instantly share code, notes, and snippets.

@ijoschek

ijoschek/.\lib\main.dart Secret

Last active Aug 25, 2019
Embed
What would you like to do?
flutter_qrreader_tut
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter QR Reader Tutorial',
theme: ThemeData(
primarySwatch: Colors.amber,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String _qrInfo = 'Scan a Code';
bool _camState = false;
_scanCode() {}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter QR Reader Tutorial'),
),
body: Text(_qrInfo),
floatingActionButton: Visibility(
visible: !_camState,
child: FloatingActionButton(
onPressed: _scanCode,
tooltip: 'Scan',
child: Icon(Icons.scanner),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.