2023-09-24 01:17:54 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-05-15 16:20:59 +00:00
|
|
|
import 'package:gap/gap.dart';
|
2023-09-24 01:17:54 +00:00
|
|
|
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
|
|
|
|
|
|
|
class EmptyPagePlaceholder extends StatelessWidget {
|
|
|
|
const EmptyPagePlaceholder({
|
|
|
|
required this.title,
|
|
|
|
required this.iconData,
|
|
|
|
required this.description,
|
|
|
|
this.showReadyCard = false,
|
|
|
|
super.key,
|
|
|
|
});
|
|
|
|
|
2024-05-15 16:20:59 +00:00
|
|
|
final bool showReadyCard;
|
|
|
|
final IconData iconData;
|
2023-09-24 01:17:54 +00:00
|
|
|
final String title;
|
|
|
|
final String description;
|
|
|
|
|
|
|
|
@override
|
2024-05-15 16:20:59 +00:00
|
|
|
Widget build(final BuildContext context) => showReadyCard
|
|
|
|
? Column(
|
2023-09-24 01:17:54 +00:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
children: [
|
2024-05-15 16:20:59 +00:00
|
|
|
if (showReadyCard)
|
|
|
|
const Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: 15,
|
|
|
|
horizontal: 15,
|
2023-09-24 01:17:54 +00:00
|
|
|
),
|
2024-05-15 16:20:59 +00:00
|
|
|
child: NotReadyCard(),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: _ContentWidget(
|
|
|
|
iconData: iconData,
|
|
|
|
title: title,
|
|
|
|
description: description,
|
2023-09-24 01:17:54 +00:00
|
|
|
),
|
2023-11-06 13:15:38 +00:00
|
|
|
),
|
2023-09-24 01:17:54 +00:00
|
|
|
],
|
2024-05-15 16:20:59 +00:00
|
|
|
)
|
|
|
|
: _ContentWidget(
|
|
|
|
iconData: iconData,
|
|
|
|
title: title,
|
|
|
|
description: description,
|
2023-09-24 01:17:54 +00:00
|
|
|
);
|
2024-05-15 16:20:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class _ContentWidget extends StatelessWidget {
|
|
|
|
const _ContentWidget({
|
|
|
|
required this.iconData,
|
|
|
|
required this.title,
|
|
|
|
required this.description,
|
|
|
|
});
|
|
|
|
|
|
|
|
final IconData iconData;
|
|
|
|
final String title;
|
|
|
|
final String description;
|
2023-09-24 01:17:54 +00:00
|
|
|
|
2024-05-15 16:20:59 +00:00
|
|
|
@override
|
|
|
|
Widget build(final BuildContext context) => Container(
|
2023-09-24 01:17:54 +00:00
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
2024-05-15 16:20:59 +00:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
2023-09-24 01:17:54 +00:00
|
|
|
children: [
|
|
|
|
Icon(
|
|
|
|
iconData,
|
|
|
|
size: 50,
|
|
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
|
|
),
|
2024-05-15 16:20:59 +00:00
|
|
|
const Gap(16),
|
2023-09-24 01:17:54 +00:00
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
|
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
|
|
),
|
2024-05-15 16:20:59 +00:00
|
|
|
textAlign: TextAlign.center,
|
2023-09-24 01:17:54 +00:00
|
|
|
),
|
2024-05-15 16:20:59 +00:00
|
|
|
const Gap(8),
|
2023-09-24 01:17:54 +00:00
|
|
|
Text(
|
|
|
|
description,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
|
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|