refactored data providers with centralized cache resolution, unified UI using custom dialogs and bottom sheets, and enhanced network error handling for Dio and TLS errors
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../widget/centered_leading.dart';
|
||||
import '../../../../widget/confirm_dialog.dart';
|
||||
import '../../../../widget/details_bottom_sheet.dart';
|
||||
|
||||
class PrivacyInfo {
|
||||
String providerText;
|
||||
@@ -11,22 +12,29 @@ class PrivacyInfo {
|
||||
PrivacyInfo({required this.providerText, required this.imprintUrl, required this.privacyUrl});
|
||||
|
||||
void showPopup(BuildContext context) {
|
||||
showDialog(context: context, builder: (context) => SimpleDialog(
|
||||
title: Text('Betreiberinformation | $providerText'),
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.person_pin_outlined)),
|
||||
title: const Text('Impressum'),
|
||||
subtitle: Text(imprintUrl),
|
||||
onTap: () => ConfirmDialog.openBrowser(context, imprintUrl),
|
||||
),
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.privacy_tip_outlined)),
|
||||
title: const Text('Datenschutzerklärung'),
|
||||
subtitle: Text(privacyUrl),
|
||||
onTap: () => ConfirmDialog.openBrowser(context, privacyUrl),
|
||||
),
|
||||
],
|
||||
));
|
||||
showDetailsBottomSheet(
|
||||
context,
|
||||
header: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 12),
|
||||
child: Text(
|
||||
'Betreiberinformation | $providerText',
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
children: (sheetCtx) => [
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.person_pin_outlined)),
|
||||
title: const Text('Impressum'),
|
||||
subtitle: Text(imprintUrl),
|
||||
onTap: () => ConfirmDialog.openBrowser(sheetCtx, imprintUrl),
|
||||
),
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.privacy_tip_outlined)),
|
||||
title: const Text('Datenschutzerklärung'),
|
||||
subtitle: Text(privacyUrl),
|
||||
onTap: () => ConfirmDialog.openBrowser(sheetCtx, privacyUrl),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user