Files
syncrow-app/lib/features/shared_widgets/default_text_button.dart
2024-02-17 16:27:27 +03:00

38 lines
972 B
Dart

import 'package:flutter/material.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class DefaultTextButton extends StatelessWidget {
const DefaultTextButton({
super.key,
this.onPressed,
required this.text,
this.isSecondary = false,
});
final void Function()? onPressed;
final String text;
final bool isSecondary;
@override
Widget build(BuildContext context) {
return TextButton(
onPressed: onPressed,
style: isSecondary
? null
: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(ColorsManager.primaryColor),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
child: Text(
text,
style: TextStyle(color: isSecondary ? Colors.black : Colors.white),
),
);
}
}