You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
2.1 KiB
107 lines
2.1 KiB
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:webview_flutter/webview_flutter.dart';
|
|
|
|
import '../controllers/meeting_details_controller.dart';
|
|
|
|
class MindMapTab extends StatefulWidget {
|
|
const MindMapTab({super.key});
|
|
|
|
@override
|
|
State<MindMapTab> createState() => _MindMapTabState();
|
|
}
|
|
|
|
class _MindMapTabState extends State<MindMapTab>
|
|
with AutomaticKeepAliveClientMixin {
|
|
late final WebViewController _controller;
|
|
final _meetingDetailsController = Get.find<MeetingDetailsController>();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
String html = '''
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>MindMap</title>
|
|
<script>
|
|
window.markmap = {
|
|
autoLoader: {
|
|
toolbar: true,
|
|
},
|
|
};
|
|
</script>
|
|
<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@latest"></script>
|
|
<style>
|
|
html,
|
|
body {
|
|
width: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.markmap {
|
|
width: 100%;
|
|
height: 100%;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.markmap>svg {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.markmap>.mm-toolbar {
|
|
top: 20px !important;
|
|
bottom: initial !important;
|
|
}
|
|
|
|
.markmap>.mm-toolbar>.mm-toolbar-brand {
|
|
display: none;
|
|
}
|
|
|
|
.markmap>.mm-toolbar>.mm-toolbar-item:nth-child(2) {
|
|
margin-left: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="markmap">
|
|
<script type="text/template">
|
|
---
|
|
markmap:
|
|
maxWidth: 300
|
|
colorFreezeLevel: 2
|
|
initialExpandLevel: 3
|
|
---
|
|
${_meetingDetailsController.meetingDetails.value.summary}
|
|
</script>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|
|
''';
|
|
_controller = WebViewController()
|
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
|
..setBackgroundColor(Colors.transparent)
|
|
..loadHtmlString(html);
|
|
}
|
|
|
|
@override
|
|
bool get wantKeepAlive => true;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
super.build(context);
|
|
return WebViewWidget(
|
|
controller: _controller,
|
|
);
|
|
}
|
|
}
|
|
|