34 lines
692 B
Dart
34 lines
692 B
Dart
|
import 'package:flutter/cupertino.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter/widgets.dart';
|
||
|
|
||
|
// ignore: must_be_immutable
|
||
|
class FloatingBtn extends StatefulWidget {
|
||
|
FloatingBtn({
|
||
|
this.height,
|
||
|
this.width,
|
||
|
required this.title,
|
||
|
this.onTap,
|
||
|
required this.icon,
|
||
|
});
|
||
|
|
||
|
double? height;
|
||
|
double? width;
|
||
|
String title;
|
||
|
VoidCallback? onTap;
|
||
|
IconData? icon;
|
||
|
|
||
|
@override
|
||
|
State<FloatingBtn> createState() => _FloatingBtnState();
|
||
|
}
|
||
|
|
||
|
class _FloatingBtnState extends State<FloatingBtn> {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return FloatingActionButton(
|
||
|
onPressed: widget.onTap,
|
||
|
child: Icon(Icons.add),
|
||
|
);
|
||
|
}
|
||
|
}
|