Show configured endpoint on OnboardingPage
This commit is contained in:
parent
7bb65af482
commit
293246ce92
2 changed files with 27 additions and 2 deletions
|
@ -414,5 +414,6 @@
|
|||
"serverEndpoint": "Server endpoint",
|
||||
"invalidEndpoint": "Invalid endpoint",
|
||||
"invalidEndpointMessage": "Sorry, the endpoint you entered is invalid. Please enter a valid endpoint and try again.",
|
||||
"endpointUpdatedMessage": "Endpoint updated successfully"
|
||||
"endpointUpdatedMessage": "Endpoint updated successfully",
|
||||
"customEndpoint": "Connecting to {endpoint}"
|
||||
}
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
|
||||
import 'package:ente_auth/app/view/app.dart';
|
||||
import 'package:ente_auth/core/configuration.dart';
|
||||
import 'package:ente_auth/core/constants.dart';
|
||||
import 'package:ente_auth/core/event_bus.dart';
|
||||
import 'package:ente_auth/ente_theme_data.dart';
|
||||
import 'package:ente_auth/events/trigger_logout_event.dart';
|
||||
|
@ -74,13 +75,14 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
|||
isDismissible: false,
|
||||
);
|
||||
if (result?.action == ButtonAction.first) {
|
||||
Navigator.of(context).push(
|
||||
await Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const DeveloperSettingsPage();
|
||||
},
|
||||
),
|
||||
);
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -193,6 +195,28 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
|||
),
|
||||
),
|
||||
),
|
||||
Configuration.instance.getHttpEndpoint() ==
|
||||
kDefaultProductionEndpoint
|
||||
? const SizedBox.shrink()
|
||||
: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.only(top: 20, bottom: 20),
|
||||
child: GestureDetector(
|
||||
onTap: _optForOfflineMode,
|
||||
child: Center(
|
||||
child: Text(
|
||||
context.l10n.customEndpoint(
|
||||
Configuration.instance.getHttpEndpoint(),
|
||||
),
|
||||
style: body.copyWith(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.subTextColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue