44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import '../../core/theme/design_tokens.dart';
|
||
|
|
|
||
|
|
class LinkButton extends StatelessWidget {
|
||
|
|
const LinkButton({
|
||
|
|
super.key,
|
||
|
|
required this.text,
|
||
|
|
required this.onTap,
|
||
|
|
this.enabled = true,
|
||
|
|
this.textAlign = TextAlign.center,
|
||
|
|
});
|
||
|
|
|
||
|
|
final String text;
|
||
|
|
final VoidCallback? onTap;
|
||
|
|
final bool enabled;
|
||
|
|
final TextAlign textAlign;
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return SizedBox(
|
||
|
|
height: 44,
|
||
|
|
child: TextButton(
|
||
|
|
onPressed: enabled ? onTap : null,
|
||
|
|
style: TextButton.styleFrom(
|
||
|
|
foregroundColor: enabled ? AppColors.slate500 : AppColors.slate300,
|
||
|
|
padding: const EdgeInsets.symmetric(
|
||
|
|
horizontal: AppSpacing.md,
|
||
|
|
vertical: AppSpacing.sm,
|
||
|
|
),
|
||
|
|
shape: RoundedRectangleBorder(
|
||
|
|
borderRadius: BorderRadius.circular(AppRadius.sm),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
child: Text(
|
||
|
|
text,
|
||
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||
|
|
textAlign: textAlign,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|