You've already forked flutter-rp-example
First commit
This commit is contained in:
44
lib/widgets/components/reflex_button.dart
Normal file
44
lib/widgets/components/reflex_button.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../globals.dart';
|
||||
|
||||
class ReflexButton extends StatelessWidget implements PreferredSizeWidget {
|
||||
final Function()? onPressed;
|
||||
final String text;
|
||||
final bool? isFullWidth;
|
||||
final Color? color;
|
||||
final Color? textColor;
|
||||
|
||||
const ReflexButton(
|
||||
{Key? key,
|
||||
this.onPressed,
|
||||
required this.text,
|
||||
this.isFullWidth,
|
||||
this.color,
|
||||
this.textColor})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: isFullWidth == true
|
||||
? const Size.fromHeight(36)
|
||||
: const Size(0, 36),
|
||||
backgroundColor: color ?? Globals.RP_PRIMARY_COLOR,
|
||||
foregroundColor: textColor ?? Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(text),
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
||||
}
|
||||
Reference in New Issue
Block a user