help.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import 'package:flutter/material.dart';
  2. import '../ui/adaptive.dart' show AppScaffold;
  3. import '../l10n/app_localizations.dart';
  4. class HelpPage extends StatelessWidget {
  5. const HelpPage({super.key});
  6. @override
  7. Widget build(BuildContext context) {
  8. final faqs = [
  9. {
  10. 'question': 'What is PB Authenticator?',
  11. 'answer': 'PB Authenticator is an app for generating time-based one-time passwords (TOTP) to secure your online accounts with two-factor authentication.'
  12. },
  13. {
  14. 'question': 'How do I add a new account?',
  15. 'answer': 'Tap the + button on the home screen and choose to scan a QR code or enter details manually.'
  16. },
  17. {
  18. 'question': 'How can I transfer my accounts to a new device?',
  19. 'answer': 'Use the "Transfer Codes" menu to export your accounts as QR codes and import them on your new device.'
  20. },
  21. {
  22. 'question': 'Are my accounts backed up?',
  23. 'answer': 'Accounts are stored locally on your device. Use the export feature to create a backup.'
  24. },
  25. {
  26. 'question': 'Why are my codes not working?',
  27. 'answer': 'Ensure your device time is correct. TOTP codes depend on accurate time settings.'
  28. },
  29. {
  30. 'question': 'How do I prevent screen capture?',
  31. 'answer': 'Go to Settings and enable the "Prevent screen capture" option to block screenshots and screen recording.'
  32. },
  33. {
  34. 'question': 'Is PB Authenticator open source?',
  35. 'answer': 'Yes! You can view the source code from the menu or on the project’s repository.'
  36. },
  37. ];
  38. return AppScaffold(
  39. title: Text(AppLocalizations.of(context)!.helpTitle),
  40. body: ListView(
  41. padding: const EdgeInsets.all(24.0),
  42. children: [
  43. Text(
  44. AppLocalizations.of(context)!.helpBody,
  45. style: Theme.of(context).textTheme.bodyLarge,
  46. ),
  47. const SizedBox(height: 32),
  48. Text(
  49. 'Frequently Asked Questions',
  50. style: Theme.of(context).textTheme.titleMedium,
  51. ),
  52. const SizedBox(height: 16),
  53. ...faqs.map((faq) => ExpansionTile(
  54. title: Text(faq['question']!),
  55. children: [
  56. Padding(
  57. padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
  58. child: Text(faq['answer']!),
  59. ),
  60. ],
  61. )),
  62. ],
  63. ),
  64. );
  65. }
  66. }