Reviewed-on: #2 Co-authored-by: Felipe M. <me@fmartingr.com> Co-committed-by: Felipe M. <me@fmartingr.com>
74 lines
2.5 KiB
Dart
74 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:worldhopper/l10n/app_localizations.dart';
|
|
import 'package:worldhopper/helpers/snackbar_helper.dart';
|
|
import 'package:worldhopper/widgets/worldhopper_app_bar.dart';
|
|
|
|
/// Developer test screen for previewing UI components
|
|
class DevTestsScreen extends StatelessWidget {
|
|
const DevTestsScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context);
|
|
|
|
return Scaffold(
|
|
appBar: WorldhopperAppBar(
|
|
title: Text(l10n.devTestsTitle),
|
|
),
|
|
body: ListView(
|
|
children: [
|
|
_buildSectionHeader(context, l10n.devTestsSnackBars),
|
|
Card(
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
child: Column(
|
|
children: [
|
|
ListTile(
|
|
leading: const Icon(Icons.check_circle, color: Colors.green),
|
|
title: Text(l10n.devTestsSuccess),
|
|
onTap: () =>
|
|
context.showSuccessSnackBar(l10n.devTestsSuccessMessage),
|
|
),
|
|
const Divider(height: 1),
|
|
ListTile(
|
|
leading: Icon(Icons.error,
|
|
color: Theme.of(context).colorScheme.error),
|
|
title: Text(l10n.devTestsError),
|
|
onTap: () =>
|
|
context.showErrorSnackBar(l10n.devTestsErrorMessage),
|
|
),
|
|
const Divider(height: 1),
|
|
ListTile(
|
|
leading: const Icon(Icons.warning, color: Colors.orange),
|
|
title: Text(l10n.devTestsWarning),
|
|
onTap: () =>
|
|
context.showWarningSnackBar(l10n.devTestsWarningMessage),
|
|
),
|
|
const Divider(height: 1),
|
|
ListTile(
|
|
leading: const Icon(Icons.info_outline),
|
|
title: Text(l10n.devTestsInfo),
|
|
onTap: () =>
|
|
context.showInfoSnackBar(l10n.devTestsInfoMessage),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildSectionHeader(BuildContext context, String title) {
|
|
return Padding(
|
|
padding: const EdgeInsets.fromLTRB(32, 24, 16, 8),
|
|
child: Text(
|
|
title,
|
|
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
|
color: Theme.of(context).colorScheme.primary,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|