From 4d75674e8e68c0321b68694f3b8f09feeb928502 Mon Sep 17 00:00:00 2001 From: juan Date: Fri, 18 Jul 2025 10:57:13 -0400 Subject: [PATCH] instance rather than a new classs --- lib/emailViewWeb.dart | 45 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/lib/emailViewWeb.dart b/lib/emailViewWeb.dart index ae7f624..a73c040 100644 --- a/lib/emailViewWeb.dart +++ b/lib/emailViewWeb.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'dart:ui_web' as ui; import 'augment.dart'; -// import 'dart:js_interop' as js; //eventually for manipulating css import 'collapsableEmails.dart'; import 'api_service.dart'; @@ -35,8 +34,30 @@ class _EmailViewState extends State { late Key iframeKey; late String currentContent; late String viewTypeId; //make this a list too??? - Future>>? _markerPositionsFuture; // TextEditingController _jumpController = TextEditingController(); + late EmailToolbar toolbarInstance = EmailToolbar( + onJumpToNumbering: _handleJumpRequest, + onViewspecs: _handleViewspecsRequest, + onButtonPressed: () => {print("email tool bar pressed")}, + onFiltering: _handleFiltering, + emails: widget.messages, + subject: widget.subject, + rootAugment: localCollapsable.getAugmentRoot(), + ); + + late CollapsableEmails localCollapsable = CollapsableEmails( + //change here + thread: widget.messages, //this wont work in serializable + // threadHTML: widget.emailContent, // old html + threadMarkdown: widget.emailContent, + threadIDs: widget.id, + targetJumpNumbering: _targetJumpNumbering, + targetViewspecs: _targetViewspecs, + targetFiltering: _queryFiltering, + nameOfDocument: widget.subject, + ); + + final hardcodedMarkers = [ {'id': 'marker1', 'x': 50, 'y': 100}, {'id': 'marker2', 'x': 150, 'y': 200}, @@ -78,11 +99,11 @@ class _EmailViewState extends State { }); } - // TODO: void _invisibility(String ) //to make purple numbers not visible @override Widget build(BuildContext context) { ApiService.currThreadID = widget.id; + // AugmentClasses localAugment = AugmentClasses(localCollapsable); return Scaffold( appBar: AppBar( title: Text(widget.name), @@ -91,12 +112,7 @@ class _EmailViewState extends State { children: [ Column( children: [ - EmailToolbar( - onJumpToNumbering: _handleJumpRequest, - onViewspecs: _handleViewspecsRequest, - onButtonPressed: () => {print("email tool bar pressed")}, - onFiltering: _handleFiltering, - ), + toolbarInstance, Row( // title of email children: [ @@ -133,16 +149,7 @@ class _EmailViewState extends State { ], ), Expanded( - child: CollapsableEmails( - //change here - thread: widget.messages, //this wont work in serializable - // threadHTML: widget.emailContent, // old html - threadMarkdown: widget.emailContent, - threadIDs: widget.id, - targetJumpNumbering: _targetJumpNumbering, - targetViewspecs: _targetViewspecs, - targetFiltering: _queryFiltering, - ), + child: localCollapsable, ), ], ),