viewspecs handling callback function added
This commit is contained in:
		
							parent
							
								
									edec45669d
								
							
						
					
					
						commit
						361a3add39
					
				
					 1 changed files with 13 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,6 @@ import 'augment.dart';
 | 
			
		|||
import 'collapsableEmails.dart';
 | 
			
		||||
import 'api_service.dart';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class EmailView extends StatefulWidget {
 | 
			
		||||
  final List<String> emailContent;
 | 
			
		||||
  final String from;
 | 
			
		||||
| 
						 | 
				
			
			@ -44,6 +43,7 @@ class _EmailViewState extends State<EmailView> {
 | 
			
		|||
    {'id': 'marker3', 'x': 250, 'y': 300},
 | 
			
		||||
  ];
 | 
			
		||||
  String? _targetJumpNumbering;
 | 
			
		||||
  String? _targetViewspecs;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void initState() {
 | 
			
		||||
| 
						 | 
				
			
			@ -58,12 +58,19 @@ class _EmailViewState extends State<EmailView> {
 | 
			
		|||
  void _scrollToNumber(String spanId) {
 | 
			
		||||
    AugmentClasses.handleJump(spanId);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void _handleJumpRequest(String numbering) {
 | 
			
		||||
    setState(() {
 | 
			
		||||
      _targetJumpNumbering = numbering;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void _handleViewspecsRequest(String viewspecsCommand) {
 | 
			
		||||
    setState(() {
 | 
			
		||||
      _targetViewspecs = viewspecsCommand;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // TODO: void _invisibility(String )  //to make purple numbers not visible
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
| 
						 | 
				
			
			@ -78,10 +85,9 @@ class _EmailViewState extends State<EmailView> {
 | 
			
		|||
            Column(
 | 
			
		||||
              children: [
 | 
			
		||||
                EmailToolbar(
 | 
			
		||||
                  onJumpToSpan: _handleJumpRequest,
 | 
			
		||||
                  onButtonPressed: () => {
 | 
			
		||||
                    print("email tool bar pressed")
 | 
			
		||||
                  },
 | 
			
		||||
                  onJumpToNumbering: _handleJumpRequest,
 | 
			
		||||
                  onViewspecs: _handleViewspecsRequest,
 | 
			
		||||
                  onButtonPressed: () => {print("email tool bar pressed")},
 | 
			
		||||
                ),
 | 
			
		||||
                Row(
 | 
			
		||||
                  // title of email
 | 
			
		||||
| 
						 | 
				
			
			@ -125,6 +131,7 @@ class _EmailViewState extends State<EmailView> {
 | 
			
		|||
                    threadHTML: widget.emailContent,
 | 
			
		||||
                    threadIDs: widget.id,
 | 
			
		||||
                    targetJumpNumbering: _targetJumpNumbering,
 | 
			
		||||
                    targetViewspecs: _targetViewspecs,
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
              ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue