mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-05-17 13:15:58 +08:00
add custom headers on setup
This commit is contained in:
@ -101,7 +101,7 @@ Future<bool> showCustomHeadersDialog(BuildContext context) async {
|
||||
),
|
||||
TextButton(
|
||||
child: Text("OK", style: context.theme.textTheme.bodyLarge!.copyWith(color: context.theme.colorScheme.primary)),
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
final map = <String, String>{};
|
||||
keyControllers.forEachIndexed((index, element) {
|
||||
final keyController = element;
|
||||
@ -111,7 +111,7 @@ Future<bool> showCustomHeadersDialog(BuildContext context) async {
|
||||
}
|
||||
});
|
||||
ss.settings.customHeaders.value = map;
|
||||
ss.settings.save();
|
||||
await ss.settings.saveOne('customHeaders');
|
||||
http.onInit();
|
||||
Navigator.of(context).pop(true);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class _ServerCredentialsState extends OptimizedState<ServerCredentials> {
|
||||
title: "Server Connection",
|
||||
subtitle: kIsWeb || kIsDesktop
|
||||
? "Enter your server URL and password to access your messages."
|
||||
: "We've created a QR code on your server that you can scan with your phone for easy setup.\n\nAlternatively, you can manually input your URL and password.",
|
||||
: "We've created a QR code on your server that you can scan with your phone for easy setup.\nAlternatively, you can manually input your URL and password.",
|
||||
contentWrapper: (child) => AnimatedSize(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: !showLoginButtons && context.isPhone ? const SizedBox.shrink() : child,
|
||||
@ -187,6 +187,18 @@ class _ServerCredentialsState extends OptimizedState<ServerCredentials> {
|
||||
),
|
||||
),
|
||||
if (token != null) const SizedBox(height: 10),
|
||||
Container(
|
||||
height: 40,
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
await showCustomHeadersDialog(context);
|
||||
},
|
||||
child: Text("Enter Custom Headers",
|
||||
style: context.theme.textTheme.bodyLarge!.apply(color: context.theme.colorScheme.primary)),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (token != null)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
|
Reference in New Issue
Block a user