Add widget that renders the current endpoint app is connecting to
This commit is contained in:
parent
b97839adae
commit
54c4862e71
2 changed files with 29 additions and 0 deletions
27
mobile/lib/ui/settings/developer_settings_widget.dart
Normal file
27
mobile/lib/ui/settings/developer_settings_widget.dart
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Reference in a new issue