This repository has been archived on 2024-06-08. You can view files and clone it, but cannot push or open issues or pull requests.
SolarAgent/lib/screens/application.dart

37 lines
1.0 KiB
Dart
Raw Normal View History

2024-02-08 08:34:33 +00:00
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
2024-02-10 12:08:25 +00:00
class ApplicationScreen extends StatelessWidget {
2024-02-08 08:34:33 +00:00
final Uri link;
2024-02-10 12:08:25 +00:00
final String title;
2024-02-08 08:34:33 +00:00
2024-02-10 12:08:25 +00:00
const ApplicationScreen({super.key, required this.link, required this.title});
2024-02-08 08:34:33 +00:00
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
2024-02-12 09:50:06 +00:00
bottom: false,
2024-02-10 12:55:46 +00:00
child: Stack(
children: [
WebViewWidget(
controller: WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(Colors.white)
2024-02-12 09:50:06 +00:00
..setNavigationDelegate(NavigationDelegate(
onPageStarted: (_) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text("Swipe from left to back to dashboard."),
));
}
))
2024-02-10 12:55:46 +00:00
..loadRequest(link)
..clearCache(),
),
],
2024-02-08 08:34:33 +00:00
),
),
);
}
}