Skip to content

Commit f4973ba

Browse files
committed
feat(ads): add demo interstitial ad dialog widget
- Create a new dialog widget for displaying a placeholder interstitial ad in demo mode - Mimics a full-screen ad with static text indicating it's a demo - Includes a close button to dismiss the dialog
1 parent eee7bff commit f4973ba

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:go_router/go_router.dart';
3+
import 'package:ui_kit/ui_kit.dart';
4+
5+
/// {@template demo_interstitial_ad_dialog}
6+
/// A dialog widget that displays a placeholder for an interstitial ad in demo mode.
7+
///
8+
/// This dialog mimics a full-screen interstitial ad but contains only static
9+
/// text to indicate it's a demo.
10+
/// {@endtemplate}
11+
class DemoInterstitialAdDialog extends StatelessWidget {
12+
/// {@macro demo_interstitial_ad_dialog}
13+
const DemoInterstitialAdDialog({super.key});
14+
15+
@override
16+
Widget build(BuildContext context) {
17+
final theme = Theme.of(context);
18+
return Dialog.fullscreen(
19+
backgroundColor: theme.colorScheme.surface,
20+
child: Stack(
21+
children: [
22+
Center(
23+
child: SingleChildScrollView(
24+
child: Column(
25+
mainAxisAlignment: MainAxisAlignment.center,
26+
children: [
27+
Text(
28+
'INTERSTITIAL AD (DEMO)',
29+
style: theme.textTheme.titleLarge?.copyWith(
30+
color: theme.colorScheme.onSurface,
31+
),
32+
textAlign: TextAlign.center,
33+
),
34+
const SizedBox(height: AppSpacing.md),
35+
Text(
36+
'This is a full-screen advertisement placeholder.',
37+
style: theme.textTheme.bodyMedium?.copyWith(
38+
color: theme.colorScheme.onSurfaceVariant,
39+
),
40+
textAlign: TextAlign.center,
41+
),
42+
],
43+
),
44+
),
45+
),
46+
Positioned(
47+
top: AppSpacing.lg,
48+
right: AppSpacing.lg,
49+
child: IconButton(
50+
icon: Icon(Icons.close, color: theme.colorScheme.onSurface),
51+
onPressed: () {
52+
// Dismiss the dialog.
53+
Navigator.of(context).pop();
54+
},
55+
),
56+
),
57+
],
58+
),
59+
);
60+
}
61+
}

0 commit comments

Comments
 (0)