flutter_not_paid 1.1.0
flutter_not_paid: ^1.1.0 copied to clipboard
Client did not pay? Add this widget into your app and the app will fade away completely on reaching deadline.
example/lib/main.dart
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_not_paid/flutter_not_paid.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return NotPaid(
deadline: 20,
dueDate: DateTime.now().subtract(Duration(days: 6)),
showBanner: true,
child: MaterialApp(
title: 'Flutter Not Paid Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.light,
seedColor: Colors.blue,
),
),
home: MyHomePage(title: 'Flutter Not Paid Home Page'),
),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
log('button clicked');
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Theme.of(context).colorScheme.onPrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Theme.of(context).colorScheme.onPrimary,
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
}