Skip to content

Instantly share code, notes, and snippets.

@frank06
Created December 19, 2019 18: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 frank06/017aa3e4b7b0ea403de1942bb5fd0472 to your computer and use it in GitHub Desktop.
Save frank06/017aa3e4b7b0ea403de1942bb5fd0472 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
main() => runApp(MinimalStatefulApp());
class MinimalStatefulApp extends StatefulWidget {
@override
_MinimalState createState() => _MinimalState();
}
class _MinimalState extends State<MinimalStatefulApp> {
int _counter = 0;
@override
Widget build(BuildContext context) {
return GestureDetector(
onDoubleTap: () => setState(() => _counter++),
child: Center(
child: Text(
'Counter: $_counter',
textDirection: TextDirection.ltr,
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment