quickgui/lib/src/widgets/home_page/downloader_page_button.dart

55 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
class DownloaderPageButton extends StatelessWidget {
const DownloaderPageButton({
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, 0, 12, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Text(
label?.toUpperCase() ?? '',
style: Theme.of(context)
.textTheme
.titleSmall
?.copyWith(color: Colors.white),
),
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Theme.of(context).brightness == Brightness.dark
? Colors.white70
: Theme.of(context).colorScheme.primary,
backgroundColor: Theme.of(context).canvasColor,
),
onPressed: onPressed,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 16, 0, 16),
child: Text(text),
),
),
],
),
),
);
}
}