mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-28 12:09:57 +00:00
37 lines
933 B
Dart
Executable file
37 lines
933 B
Dart
Executable file
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class MyTextButton extends StatelessWidget {
|
|
const MyTextButton({
|
|
super.key,
|
|
required this.buttonName,
|
|
required this.onPressed,
|
|
this.height = 50.0,
|
|
});
|
|
|
|
final String buttonName;
|
|
final VoidCallback? onPressed;
|
|
final double height;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
height: height,
|
|
width: double.infinity,
|
|
child: ElevatedButton(
|
|
style: _buildButtonStyle(context),
|
|
onPressed: onPressed,
|
|
child: Text(buttonName, style: context.textTheme.titleMedium),
|
|
),
|
|
);
|
|
}
|
|
|
|
ButtonStyle _buildButtonStyle(BuildContext context) {
|
|
return ButtonStyle(
|
|
shadowColor: const WidgetStatePropertyAll(Colors.transparent),
|
|
backgroundColor: WidgetStatePropertyAll(
|
|
context.theme.colorScheme.secondaryContainer.withAlpha(80),
|
|
),
|
|
);
|
|
}
|
|
}
|