HyM attachments resolve: #2 #3
					 1 changed files with 48 additions and 41 deletions
				
			
		| 
						 | 
				
			
			@ -1,8 +1,10 @@
 | 
			
		|||
import 'package:crab_ui/api_service.dart';
 | 
			
		||||
import 'package:crab_ui/structs.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
 | 
			
		||||
import 'dart:html' as html;
 | 
			
		||||
import 'dart:js' as js;
 | 
			
		||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
 | 
			
		||||
 | 
			
		||||
class EmailToolbar extends StatefulWidget {
 | 
			
		||||
  final Function(String) onJumpToSpan;
 | 
			
		||||
| 
						 | 
				
			
			@ -228,42 +230,37 @@ class AugmentClasses {
 | 
			
		|||
      builder: (context) => Stack(
 | 
			
		||||
        children: [
 | 
			
		||||
          // Dimmed background
 | 
			
		||||
          GestureDetector(
 | 
			
		||||
            onTap: () => _overlayEntry?.remove(),
 | 
			
		||||
            child: Container(
 | 
			
		||||
              color: Colors.black54,
 | 
			
		||||
              width: MediaQuery.of(context).size.width,
 | 
			
		||||
              height: MediaQuery.of(context).size.height,
 | 
			
		||||
            ),
 | 
			
		||||
          Container(
 | 
			
		||||
            color: Colors.black54,
 | 
			
		||||
            width: MediaQuery.of(context).size.width,
 | 
			
		||||
            height: MediaQuery.of(context).size.height,
 | 
			
		||||
          ),
 | 
			
		||||
          // Focused content window
 | 
			
		||||
          Center(
 | 
			
		||||
            child: Positioned(
 | 
			
		||||
              left: offset.dx + 500,
 | 
			
		||||
              top: offset.dy + renderBox.size.height + 100,
 | 
			
		||||
              child: Material(
 | 
			
		||||
                elevation: 8,
 | 
			
		||||
                borderRadius: BorderRadius.circular(12),
 | 
			
		||||
                child: ConstrainedBox(
 | 
			
		||||
                  constraints: const BoxConstraints(
 | 
			
		||||
                    maxWidth: 400,
 | 
			
		||||
                    maxHeight: 500,
 | 
			
		||||
                  ),
 | 
			
		||||
                  child: Column(
 | 
			
		||||
                    children: [
 | 
			
		||||
                      _buildHeader(),
 | 
			
		||||
                      const Divider(height: 1),
 | 
			
		||||
                      Expanded(
 | 
			
		||||
                        child: ListView(
 | 
			
		||||
                          children: _buildMenuItem(),
 | 
			
		||||
          PointerInterceptor(
 | 
			
		||||
            child: Center(
 | 
			
		||||
                child: Material(
 | 
			
		||||
                  elevation: 8,
 | 
			
		||||
                  borderRadius: BorderRadius.circular(12),
 | 
			
		||||
                  child: ConstrainedBox(
 | 
			
		||||
                    constraints: const BoxConstraints(
 | 
			
		||||
                      maxWidth: 400,
 | 
			
		||||
                      maxHeight: 500,
 | 
			
		||||
                    ),
 | 
			
		||||
                    child: Column(
 | 
			
		||||
                      children: [
 | 
			
		||||
                        _buildHeader(context),
 | 
			
		||||
                        const Divider(height: 1),
 | 
			
		||||
                        Expanded(
 | 
			
		||||
                          child: ListView(
 | 
			
		||||
                            children: _buildMenuItem(),
 | 
			
		||||
                          ),
 | 
			
		||||
                        ),
 | 
			
		||||
                      ),
 | 
			
		||||
                    ],
 | 
			
		||||
                      ],
 | 
			
		||||
                    ),
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
          )
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
| 
						 | 
				
			
			@ -273,17 +270,25 @@ class AugmentClasses {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  // Add missing widget builder methods
 | 
			
		||||
  static Widget _buildHeader() {
 | 
			
		||||
    return const Padding(
 | 
			
		||||
      padding: EdgeInsets.all(16.0),
 | 
			
		||||
      child: Text(
 | 
			
		||||
        'Thread Attachments',
 | 
			
		||||
        style: TextStyle(
 | 
			
		||||
          fontSize: 20,
 | 
			
		||||
          fontWeight: FontWeight.bold,
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  static Widget _buildHeader(BuildContext context) {
 | 
			
		||||
    return Padding(
 | 
			
		||||
        padding: EdgeInsets.all(16.0),
 | 
			
		||||
        child:
 | 
			
		||||
            Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
 | 
			
		||||
            Text(
 | 
			
		||||
              'Thread Attachments',
 | 
			
		||||
              style: TextStyle(
 | 
			
		||||
                fontSize: 20,
 | 
			
		||||
                fontWeight: FontWeight.bold,
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
          CloseButton(
 | 
			
		||||
            onPressed: () {
 | 
			
		||||
              _overlayEntry?.remove();
 | 
			
		||||
            },
 | 
			
		||||
          ),
 | 
			
		||||
        ]
 | 
			
		||||
                ));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static List<Widget> _buildMenuItem() {
 | 
			
		||||
| 
						 | 
				
			
			@ -293,7 +298,9 @@ class AugmentClasses {
 | 
			
		|||
          leading: Icon(Icons.file_present),
 | 
			
		||||
          title: Text(file.name.toString()),
 | 
			
		||||
          onTap: () {
 | 
			
		||||
            _overlayEntry?.remove();
 | 
			
		||||
            print("rick rolled");
 | 
			
		||||
            html.window
 | 
			
		||||
                .open("https://www.youtube.com/watch?v=xvFZjo5PgG0", "testing");
 | 
			
		||||
          }));
 | 
			
		||||
    }
 | 
			
		||||
    return listOfFiles;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue