Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active August 25, 2019 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijoschek/43a6be8dc91f2170df31937471197906 to your computer and use it in GitHub Desktop.
Save ijoschek/43a6be8dc91f2170df31937471197906 to your computer and use it in GitHub Desktop.
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