changed fullwidthbutton to include size, borderColor and infillColor attributes
This commit is contained in:
@@ -1,10 +1,19 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:game_tracker/core/custom_theme.dart';
|
|
||||||
|
|
||||||
class FullWidthButton extends StatelessWidget {
|
class FullWidthButton extends StatelessWidget {
|
||||||
const FullWidthButton({super.key, required this.text, this.onPressed});
|
const FullWidthButton({
|
||||||
|
super.key,
|
||||||
|
required this.text,
|
||||||
|
required this.borderColor,
|
||||||
|
required this.infillColor,
|
||||||
|
required this.sizeRelativeToWidth,
|
||||||
|
required this.onPressed,
|
||||||
|
});
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
|
final Color borderColor;
|
||||||
|
final Color infillColor;
|
||||||
|
final double sizeRelativeToWidth;
|
||||||
final VoidCallback? onPressed;
|
final VoidCallback? onPressed;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -12,8 +21,12 @@ class FullWidthButton extends StatelessWidget {
|
|||||||
return ElevatedButton(
|
return ElevatedButton(
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
minimumSize: Size(MediaQuery.sizeOf(context).width * 0.9, 60),
|
minimumSize: Size(
|
||||||
backgroundColor: CustomTheme.primaryColor,
|
MediaQuery.sizeOf(context).width * sizeRelativeToWidth,
|
||||||
|
60,
|
||||||
|
),
|
||||||
|
backgroundColor: infillColor,
|
||||||
|
side: BorderSide(color: borderColor, width: 2),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user