2024-01-08 16:11:32 +03:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class FileDropOverlay extends StatelessWidget {
|
|
|
|
final Widget? graphic;
|
|
|
|
final String? title;
|
2024-01-09 14:17:37 +03:00
|
|
|
final String? subtitle;
|
2024-01-08 16:11:32 +03:00
|
|
|
|
2024-01-09 14:17:37 +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) {
|
2024-01-09 14:17:37 +03:00
|
|
|
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
|
|
|
],
|
2024-01-09 14:17:37 +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-09 14:17:37 +03:00
|
|
|
);
|
2024-01-08 16:11:32 +03:00
|
|
|
}
|
|
|
|
}
|