instance rather than a new classs
This commit is contained in:
		
							parent
							
								
									bde05197ae
								
							
						
					
					
						commit
						4d75674e8e
					
				
					 1 changed files with 26 additions and 19 deletions
				
			
		| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
import 'package:flutter/material.dart';
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
import 'dart:ui_web' as ui;
 | 
					import 'dart:ui_web' as ui;
 | 
				
			||||||
import 'augment.dart';
 | 
					import 'augment.dart';
 | 
				
			||||||
// import 'dart:js_interop' as js; //eventually for manipulating css
 | 
					 | 
				
			||||||
import 'collapsableEmails.dart';
 | 
					import 'collapsableEmails.dart';
 | 
				
			||||||
import 'api_service.dart';
 | 
					import 'api_service.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,8 +34,30 @@ class _EmailViewState extends State<EmailView> {
 | 
				
			||||||
  late Key iframeKey;
 | 
					  late Key iframeKey;
 | 
				
			||||||
  late String currentContent;
 | 
					  late String currentContent;
 | 
				
			||||||
  late String viewTypeId; //make this a list too???
 | 
					  late String viewTypeId; //make this a list too???
 | 
				
			||||||
  Future<List<Map<String, dynamic>>>? _markerPositionsFuture;
 | 
					 | 
				
			||||||
  // TextEditingController _jumpController = TextEditingController();
 | 
					  // 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 = [
 | 
					  final hardcodedMarkers = [
 | 
				
			||||||
    {'id': 'marker1', 'x': 50, 'y': 100},
 | 
					    {'id': 'marker1', 'x': 50, 'y': 100},
 | 
				
			||||||
    {'id': 'marker2', 'x': 150, 'y': 200},
 | 
					    {'id': 'marker2', 'x': 150, 'y': 200},
 | 
				
			||||||
| 
						 | 
					@ -78,11 +99,11 @@ class _EmailViewState extends State<EmailView> {
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: void _invisibility(String )  //to make purple numbers not visible
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @override
 | 
					  @override
 | 
				
			||||||
  Widget build(BuildContext context) {
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
    ApiService.currThreadID = widget.id;
 | 
					    ApiService.currThreadID = widget.id;
 | 
				
			||||||
 | 
					    // AugmentClasses localAugment = AugmentClasses(localCollapsable);
 | 
				
			||||||
    return Scaffold(
 | 
					    return Scaffold(
 | 
				
			||||||
        appBar: AppBar(
 | 
					        appBar: AppBar(
 | 
				
			||||||
          title: Text(widget.name),
 | 
					          title: Text(widget.name),
 | 
				
			||||||
| 
						 | 
					@ -91,12 +112,7 @@ class _EmailViewState extends State<EmailView> {
 | 
				
			||||||
          children: [
 | 
					          children: [
 | 
				
			||||||
            Column(
 | 
					            Column(
 | 
				
			||||||
              children: [
 | 
					              children: [
 | 
				
			||||||
                EmailToolbar(
 | 
					                toolbarInstance,
 | 
				
			||||||
                  onJumpToNumbering: _handleJumpRequest,
 | 
					 | 
				
			||||||
                  onViewspecs: _handleViewspecsRequest,
 | 
					 | 
				
			||||||
                  onButtonPressed: () => {print("email tool bar pressed")},
 | 
					 | 
				
			||||||
                  onFiltering: _handleFiltering,
 | 
					 | 
				
			||||||
                ),
 | 
					 | 
				
			||||||
                Row(
 | 
					                Row(
 | 
				
			||||||
                  // title of email
 | 
					                  // title of email
 | 
				
			||||||
                  children: [
 | 
					                  children: [
 | 
				
			||||||
| 
						 | 
					@ -133,16 +149,7 @@ class _EmailViewState extends State<EmailView> {
 | 
				
			||||||
                  ],
 | 
					                  ],
 | 
				
			||||||
                ),
 | 
					                ),
 | 
				
			||||||
                Expanded(
 | 
					                Expanded(
 | 
				
			||||||
                  child: CollapsableEmails(
 | 
					                  child: localCollapsable,
 | 
				
			||||||
                    //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,
 | 
					 | 
				
			||||||
                  ),
 | 
					 | 
				
			||||||
                ),
 | 
					                ),
 | 
				
			||||||
              ],
 | 
					              ],
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue