yubioath-flutter/lib/widgets/file_drop_overlay.dart

51 lines
1.5 KiB
Dart
Raw Permalink Normal View History

2024-01-08 16:11:32 +03:00
import 'package:flutter/material.dart';
2024-03-08 11:30:47 +03:00
import 'package:material_symbols_icons/symbols.dart';
2024-01-08 16:11:32 +03:00
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(
2024-03-08 11:30:47 +03:00
Symbols.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
}
}