first commit

This commit is contained in:
2025-04-05 11:47:40 +02:00
commit 1fb8c28c2e
99 changed files with 7656 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class CalendarScreen extends StatefulWidget {
const CalendarScreen({super.key});
@override
State<CalendarScreen> createState() => _CalendarScreenState();
}
class _CalendarScreenState extends State<CalendarScreen> {
late final WebViewController _controller;
bool _isLoading = true;
bool _hasError = false;
@override
void initState() {
super.initState();
_controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(
NavigationDelegate(
onPageStarted: (_) => setState(() {
_isLoading = true;
_hasError = false;
}),
onPageFinished: (_) => setState(() => _isLoading = false),
onWebResourceError: (error) => setState(() {
_hasError = true;
_isLoading = false;
}),
),
)
..loadRequest(Uri.parse(
'https://calendar.google.com/calendar/u/0/embed?src=b9c267252d5be63d5cdc880be499885a88421eefd0e34e1392890daba0d8471e@group.calendar.google.com&ctz=Europe/Belgrade'));
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
WebViewWidget(controller: _controller),
if (_isLoading)
const Center(child: CircularProgressIndicator()),
if (_hasError)
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Failed to load Google Calendar.",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
ElevatedButton(
onPressed: () => _controller.reload(),
child: const Text("Retry"),
),
],
),
),
],
),
);
}
}