From 29f18b6876c5f84c65288d0993d27a870cbfa711 Mon Sep 17 00:00:00 2001 From: juan Date: Mon, 19 May 2025 19:02:51 -0400 Subject: [PATCH] cleaned and commented out useless viewtype registry siunce using collapsable --- lib/api_service.dart | 54 +++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/lib/api_service.dart b/lib/api_service.dart index a9b6b20..aa05b99 100644 --- a/lib/api_service.dart +++ b/lib/api_service.dart @@ -7,7 +7,6 @@ import 'dart:typed_data'; import 'package:pointer_interceptor/pointer_interceptor.dart'; import 'collapsableEmails.dart'; - import 'structs.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; @@ -156,6 +155,7 @@ class ApiService { Future> threadsInSerializable( String thread_id) async { + //actually a number // grab all of the emails in thread anyways, for the future it'll come in handy var url = Uri.http('$ip:$port', 'get_thread_messages', {'id': thread_id}); try { @@ -462,44 +462,40 @@ class _EmailViewState extends State { {'id': 'marker2', 'x': 150, 'y': 200}, {'id': 'marker3', 'x': 250, 'y': 300}, ]; - ApiService _apiService = ApiService(); @override void initState() { super.initState(); + print("thread id? ${widget.id}"); List currentContent = widget .emailContent; //html of the email/ actually entire thread, gives me little space to play in between // i wonder if the other attributes change? because if so i have to add like some zooms in and out of the emails, as in collapse - // viewTypeId = "iframe-${DateTime.now().millisecondsSinceEpoch}"; - _registerViewFactory(currentContent); - // _markerPositionsFuture = ApiService().getMarkerPosition(); + // _registerViewFactory(currentContent); } - void _registerViewFactory(List currentContent) { - setState(() { //update to do item per item - // each item to have itsviewtype ID - // is this necessarey here?? + // void _registerViewFactory(List currentContent) { // i think this doesnt work anymore + // setState(() { //update to do item per item + // // each item to have itsviewtype ID + // // is this necessarey here?? - //could just move to collapsable + // //could just move to collapsable + // viewTypeId = 'iframe-${DateTime.now().millisecondsSinceEpoch}'; + // final emailHTML = web.document.createElement('div') as web.HTMLDivElement + // ..id = viewTypeId + // ..innerHTML = currentContent[0].toJS; // temporarily index because it has to do all of them + // emailHTML.style + // ..width = '100%' + // ..height = '100%' + // ..overflow = 'auto' + // ..scrollBehavior = 'smooth'; - - viewTypeId = 'iframe-${DateTime.now().millisecondsSinceEpoch}'; - final emailHTML = web.document.createElement('div') as web.HTMLDivElement - ..id = viewTypeId - ..innerHTML = currentContent[0].toJS; // temporarily index because it has to do all of them - emailHTML.style - ..width = '100%' - ..height = '100%' - ..overflow = 'auto' - ..scrollBehavior = 'smooth'; - - ui.platformViewRegistry.registerViewFactory( - viewTypeId, - (int viewId) => emailHTML, - ); - }); - } + // ui.platformViewRegistry.registerViewFactory( + // viewTypeId, + // (int viewId) => emailHTML, + // ); + // }); + // } void _scrollToNumber(String spanId) { AugmentClasses.handleJump(spanId); @@ -508,7 +504,7 @@ class _EmailViewState extends State { // TODO: void _invisibility(String ) //to make purple numbers not visible @override - Widget build(BuildContext context) { + Widget build(BuildContext context) { // print("thread id ${widget.id}"); ApiService.currThreadID = widget.id; return Scaffold( @@ -580,8 +576,10 @@ class _EmailViewState extends State { ), Expanded( child: CollapsableEmails( + //change here thread: widget.messages, threadHTML: widget.emailContent, + threadIDs: widget.id, ), ), // Expanded(