yubioath-flutter/lib/widgets/file_drop_overlay.dart

50 lines
1.4 KiB
Dart
Raw Normal View History

2024-01-08 16:11:32 +03:00
import 'package:flutter/material.dart';
class FileDropOverlay extends StatelessWidget {
final Widget? graphic;
final String? title;
final String? subtitle;
2024-01-08 16:11:32 +03:00
const FileDropOverlay({super.key, this.graphic, this.title, this.subtitle});
2024-01-08 16:11:32 +03:00
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Theme.of(context)
.colorScheme
.secondaryContainer
.withOpacity(0.95),
border: Border.all(color: Theme.of(context).colorScheme.primary),
borderRadius: const BorderRadius.all(Radius.circular(20.0))),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
graphic ??
Icon(
Icons.upload_file,
size: 120,
color: Theme.of(context).colorScheme.primary,
),
if (title != null) ...[
const SizedBox(height: 16.0),
Text(
title!,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleLarge,
)
2024-01-08 16:11:32 +03:00
],
if (subtitle != null) ...[
const SizedBox(height: 12.0),
Text(
subtitle!,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall,
)
]
],
2024-01-08 16:11:32 +03:00
),
);
2024-01-08 16:11:32 +03:00
}
}