flutter_click_more_counter 1.0.1
flutter_click_more_counter: ^1.0.1 copied to clipboard
A Flutter plugin for handle the click action, you can hidden something content in your app for debug, tracking issue
import 'package:flutter/material.dart';
import 'package:flutter_click_more_counter/flutter_click_more_counter.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Click More Counter'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final _clickCounter = ClickMoreCounter();
void onClick() {
_clickCounter.run(() {
showDialog(
useSafeArea: false,
context: context,
builder: (BuildContext context) => const AlertDialog(
title: Text("Flutter Click More Counter"),
content: Text("Hello there"),
));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Click the button more than 5 times',
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: onClick,
tooltip: 'Click',
child: const Icon(Icons.add),
),
);
}
}