diff --git a/mobile/lib/ui/settings/developer_settings_widget.dart b/mobile/lib/ui/settings/developer_settings_widget.dart new file mode 100644 index 000000000..ce4d81446 --- /dev/null +++ b/mobile/lib/ui/settings/developer_settings_widget.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import "package:photos/core/configuration.dart"; +import "package:photos/core/constants.dart"; +import "package:photos/generated/l10n.dart"; + +class DeveloperSettingsWidget extends StatelessWidget { + const DeveloperSettingsWidget({super.key}); + + @override + Widget build(BuildContext context) { + final endpoint = Configuration.instance.getHttpEndpoint(); + if (endpoint != kDefaultProductionEndpoint) { + final endpointURI = Uri.parse(endpoint); + return Padding( + padding: const EdgeInsets.only(bottom: 20), + child: Text( + S.of(context).customEndpoint( + "${endpointURI.host}:${endpointURI.port}", + ), + style: Theme.of(context).textTheme.bodySmall, + ), + ); + } else { + return const SizedBox.shrink(); + } + } +} diff --git a/mobile/lib/ui/settings_page.dart b/mobile/lib/ui/settings_page.dart index 85ce16afb..51db27595 100644 --- a/mobile/lib/ui/settings_page.dart +++ b/mobile/lib/ui/settings_page.dart @@ -18,6 +18,7 @@ import 'package:photos/ui/settings/account_section_widget.dart'; import 'package:photos/ui/settings/app_version_widget.dart'; import 'package:photos/ui/settings/backup/backup_section_widget.dart'; import 'package:photos/ui/settings/debug_section_widget.dart'; +import "package:photos/ui/settings/developer_settings_widget.dart"; import 'package:photos/ui/settings/general_section_widget.dart'; import 'package:photos/ui/settings/inherited_settings_state.dart'; import 'package:photos/ui/settings/security_section_widget.dart'; @@ -144,6 +145,7 @@ class SettingsPage extends StatelessWidget { contents.addAll([sectionSpacing, const DebugSectionWidget()]); } contents.add(const AppVersionWidget()); + contents.add(const DeveloperSettingsWidget()); contents.add( const Padding( padding: EdgeInsets.only(bottom: 60),