37 lines
1.0 KiB
Dart
37 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:webview_flutter/webview_flutter.dart';
|
|
|
|
class ApplicationScreen extends StatelessWidget {
|
|
final Uri link;
|
|
final String title;
|
|
|
|
const ApplicationScreen({super.key, required this.link, required this.title});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
bottom: false,
|
|
child: Stack(
|
|
children: [
|
|
WebViewWidget(
|
|
controller: WebViewController()
|
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
|
..setBackgroundColor(Colors.white)
|
|
..setNavigationDelegate(NavigationDelegate(
|
|
onPageStarted: (_) {
|
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
|
content: Text("Swipe from left to back to dashboard."),
|
|
));
|
|
}
|
|
))
|
|
..loadRequest(link)
|
|
..clearCache(),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|