-
-
Save ijoschek/43a6be8dc91f2170df31937471197906 to your computer and use it in GitHub Desktop.
flutter_qrreader_tut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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