mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-14 08:25:16 +00:00
feat(macos): enable same window webview support
This commit is contained in:
parent
2a317397ee
commit
70bbb4af5a
@ -19,7 +19,7 @@ Future<void> Function() useLoginCallback(WidgetRef ref) {
|
|||||||
final authNotifier = ref.read(authenticationProvider.notifier);
|
final authNotifier = ref.read(authenticationProvider.notifier);
|
||||||
|
|
||||||
return useCallback(() async {
|
return useCallback(() async {
|
||||||
if (kIsMobile) {
|
if (kIsMobile || kIsMacOS) {
|
||||||
context.pushNamed(WebViewLogin.name);
|
context.pushNamed(WebViewLogin.name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:spotube/components/titlebar/titlebar.dart';
|
||||||
|
|
||||||
import 'package:spotube/provider/authentication/authentication.dart';
|
import 'package:spotube/provider/authentication/authentication.dart';
|
||||||
import 'package:spotube/utils/platform.dart';
|
import 'package:spotube/utils/platform.dart';
|
||||||
@ -23,8 +24,12 @@ class WebViewLogin extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SafeArea(
|
appBar: const PageWindowTitleBar(
|
||||||
child: InAppWebView(
|
leading: BackButton(color: Colors.white),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
),
|
||||||
|
extendBodyBehindAppBar: true,
|
||||||
|
body: InAppWebView(
|
||||||
initialSettings: InAppWebViewSettings(
|
initialSettings: InAppWebViewSettings(
|
||||||
userAgent:
|
userAgent:
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 safari/537.36",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 safari/537.36",
|
||||||
@ -61,7 +66,6 @@ class WebViewLogin extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user