50 lines
1.3 KiB
Dart
50 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class HomePageButton extends StatelessWidget {
|
|
const HomePageButton({
|
|
Key? key,
|
|
this.label,
|
|
required this.text,
|
|
this.onPressed,
|
|
}) : super(key: key);
|
|
|
|
final String? label;
|
|
final String text;
|
|
final VoidCallback? onPressed;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Expanded(
|
|
flex: 1,
|
|
child: Padding(
|
|
padding: const EdgeInsets.fromLTRB(12, 24, 12, 24),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Center(
|
|
child: Text(
|
|
label?.toUpperCase() ?? '',
|
|
style: Theme.of(context)
|
|
.textTheme
|
|
.titleSmall
|
|
?.copyWith(color: Colors.white),
|
|
),
|
|
),
|
|
ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
|
foregroundColor: Theme.of(context).colorScheme.onSurface,
|
|
),
|
|
onPressed: onPressed,
|
|
child: Padding(
|
|
padding: const EdgeInsets.fromLTRB(0, 16, 0, 16),
|
|
child: Text(text),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|