developer_settings_widget.dart 836 B

123456789101112131415161718192021222324252627
  1. import 'package:flutter/material.dart';
  2. import "package:photos/core/configuration.dart";
  3. import "package:photos/core/constants.dart";
  4. import "package:photos/generated/l10n.dart";
  5. class DeveloperSettingsWidget extends StatelessWidget {
  6. const DeveloperSettingsWidget({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. final endpoint = Configuration.instance.getHttpEndpoint();
  10. if (endpoint != kDefaultProductionEndpoint) {
  11. final endpointURI = Uri.parse(endpoint);
  12. return Padding(
  13. padding: const EdgeInsets.only(bottom: 20),
  14. child: Text(
  15. S.of(context).customEndpoint(
  16. "${endpointURI.host}:${endpointURI.port}",
  17. ),
  18. style: Theme.of(context).textTheme.bodySmall,
  19. ),
  20. );
  21. } else {
  22. return const SizedBox.shrink();
  23. }
  24. }
  25. }