Compare commits
No commits in common. "51c772a2a119852cf62f1f0b97b1af585c054fbf" and "9d6ec2b6bcfc86207a2bc4b5bb9c090638cbf71d" have entirely different histories.
51c772a2a1
...
9d6ec2b6bc
@ -3,7 +3,6 @@ import 'package:markdown/markdown.dart' as md;
|
|||||||
import 'api_service.dart';
|
import 'api_service.dart';
|
||||||
import 'structs.dart';
|
import 'structs.dart';
|
||||||
import 'emailView.dart';
|
import 'emailView.dart';
|
||||||
import 'Compose.dart';
|
|
||||||
|
|
||||||
class EmailListScreen extends StatefulWidget {
|
class EmailListScreen extends StatefulWidget {
|
||||||
final List<GetThreadResponse> emails;
|
final List<GetThreadResponse> emails;
|
||||||
@ -194,10 +193,6 @@ class _EmailListScreenState extends State<EmailListScreen>
|
|||||||
print(email.messages); //email ids of the thread
|
print(email.messages); //email ids of the thread
|
||||||
if (widget.folder == "Drafts") {
|
if (widget.folder == "Drafts") {
|
||||||
print("IN DRAFTS MOVE THE CONTENT TO THE WRITING THING");
|
print("IN DRAFTS MOVE THE CONTENT TO THE WRITING THING");
|
||||||
//open the compose
|
|
||||||
OverlayService _thisInstance = OverlayService();
|
|
||||||
_thisInstance.draftID = email;
|
|
||||||
_thisInstance.showPersistentWidget(context);
|
|
||||||
} else {
|
} else {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:crab_ui/sonicEmailView.dart';
|
import 'package:crab_ui/sonicEmailView.dart';
|
||||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
|
||||||
|
|
||||||
import 'folder_drawer.dart';
|
import 'folder_drawer.dart';
|
||||||
import 'structs.dart';
|
import 'structs.dart';
|
||||||
@ -36,7 +35,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||||||
List<String> _tabs = ['Emails'];
|
List<String> _tabs = ['Emails'];
|
||||||
Map<String, Widget> _tabWidgets = {};
|
Map<String, Widget> _tabWidgets = {};
|
||||||
TabController? _tabController;
|
TabController? _tabController;
|
||||||
OverlayEntry? _overlayEntry;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -417,163 +415,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.mark_email_read_outlined)),
|
Icons.mark_email_read_outlined)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: null,
|
||||||
final overlay = Overlay.of(context);
|
|
||||||
String?
|
|
||||||
selectedFolder; // Variable to store the selected folder
|
|
||||||
|
|
||||||
_overlayEntry = OverlayEntry(
|
|
||||||
builder: (context) => Stack(
|
|
||||||
children: [
|
|
||||||
// Dimmed background
|
|
||||||
Container(
|
|
||||||
color: Colors.black54,
|
|
||||||
width:
|
|
||||||
MediaQuery.of(context)
|
|
||||||
.size
|
|
||||||
.width,
|
|
||||||
height:
|
|
||||||
MediaQuery.of(context)
|
|
||||||
.size
|
|
||||||
.height,
|
|
||||||
),
|
|
||||||
// Focused content window
|
|
||||||
PointerInterceptor(
|
|
||||||
child: Center(
|
|
||||||
child: Material(
|
|
||||||
elevation: 8,
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius
|
|
||||||
.circular(12),
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints:
|
|
||||||
const BoxConstraints(
|
|
||||||
maxWidth: 400,
|
|
||||||
maxHeight: 500,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize
|
|
||||||
.min,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Move email from folder ${ApiService.currFolder} to:',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize:
|
|
||||||
16),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 1),
|
|
||||||
Expanded(
|
|
||||||
child: FutureBuilder<
|
|
||||||
List<
|
|
||||||
String>>(
|
|
||||||
future: ApiService()
|
|
||||||
.fetchFolders(),
|
|
||||||
builder: (context,
|
|
||||||
snapshot) {
|
|
||||||
if (snapshot
|
|
||||||
.connectionState ==
|
|
||||||
ConnectionState
|
|
||||||
.waiting) {
|
|
||||||
return const Center(
|
|
||||||
child:
|
|
||||||
CircularProgressIndicator());
|
|
||||||
} else if (snapshot
|
|
||||||
.hasError) {
|
|
||||||
return Center(
|
|
||||||
child:
|
|
||||||
Text('Error: ${snapshot.error}'));
|
|
||||||
} else if (snapshot
|
|
||||||
.hasData) {
|
|
||||||
return StatefulBuilder(
|
|
||||||
builder:
|
|
||||||
(context,
|
|
||||||
setState) {
|
|
||||||
return ListView(
|
|
||||||
shrinkWrap:
|
|
||||||
true,
|
|
||||||
children:
|
|
||||||
snapshot.data!.map((folder) {
|
|
||||||
return RadioListTile<String>(
|
|
||||||
title: Text(folder),
|
|
||||||
value: folder,
|
|
||||||
groupValue: selectedFolder,
|
|
||||||
onChanged: (String? value) {
|
|
||||||
setState(() {
|
|
||||||
selectedFolder = value; // Update the selected folder
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return const Center(
|
|
||||||
child:
|
|
||||||
Text('No folders found.'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 1),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment
|
|
||||||
.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed:
|
|
||||||
() {
|
|
||||||
// Handle Accept button
|
|
||||||
if (selectedFolder !=
|
|
||||||
null) {
|
|
||||||
print(
|
|
||||||
"Selected folder: $selectedFolder");
|
|
||||||
// Store the selected folder or perform any action
|
|
||||||
// ApiService.currFolder = selectedFolder!;
|
|
||||||
_emailPageKey.currentState! //the one selected
|
|
||||||
.moveSelectedOfFolder(selectedFolder!);
|
|
||||||
_overlayEntry
|
|
||||||
?.remove();
|
|
||||||
} else {
|
|
||||||
print(
|
|
||||||
"No folder selected");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Accept'),
|
|
||||||
),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed:
|
|
||||||
() {
|
|
||||||
// Handle Cancel button
|
|
||||||
_overlayEntry
|
|
||||||
?.remove();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Cancel'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (_overlayEntry != null) {
|
|
||||||
overlay.insert(_overlayEntry!);
|
|
||||||
}
|
|
||||||
// _emailPageKey.currentState! //the one selected
|
|
||||||
// .moveSelectedOfFolder();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.drive_file_move_outlined)),
|
Icons.drive_file_move_outlined)),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user