android/ios-adaption feature, markdown, and augment #6
					 1 changed files with 87 additions and 39 deletions
				
			
		| 
						 | 
					@ -29,6 +29,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
  bool _checkboxState = false;
 | 
					  bool _checkboxState = false;
 | 
				
			||||||
  bool bulkOptionsState = false;
 | 
					  bool bulkOptionsState = false;
 | 
				
			||||||
 | 
					  List<GetThreadResponse> selectedThreads =
 | 
				
			||||||
 | 
					      []; //this should store the emails that are being stored downstream too
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  List<String> _tabs = ['Emails'];
 | 
					  List<String> _tabs = ['Emails'];
 | 
				
			||||||
  Map<String, Widget> _tabWidgets = {};
 | 
					  Map<String, Widget> _tabWidgets = {};
 | 
				
			||||||
| 
						 | 
					@ -40,6 +42,11 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
    _tabController = TabController(length: _tabs.length, vsync: this);
 | 
					    _tabController = TabController(length: _tabs.length, vsync: this);
 | 
				
			||||||
    _tabWidgets['Emails'] = EmailPage(
 | 
					    _tabWidgets['Emails'] = EmailPage(
 | 
				
			||||||
      key: _emailPageKey,
 | 
					      key: _emailPageKey,
 | 
				
			||||||
 | 
					      onSelectionChanged: (updatedList) {
 | 
				
			||||||
 | 
					        setState(() {
 | 
				
			||||||
 | 
					          selectedThreads = updatedList;
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -354,24 +361,45 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                          Icons.arrow_drop_down_outlined),
 | 
					                                          Icons.arrow_drop_down_outlined),
 | 
				
			||||||
                                      itemBuilder: (BuildContext context) =>
 | 
					                                      itemBuilder: (BuildContext context) =>
 | 
				
			||||||
                                          <PopupMenuEntry<String>>[
 | 
					                                          <PopupMenuEntry<String>>[
 | 
				
			||||||
                                        const PopupMenuItem<String>(
 | 
					                                        PopupMenuItem<String>(
 | 
				
			||||||
                                            child: Text("All")),
 | 
					                                          //select all
 | 
				
			||||||
                                        const PopupMenuItem<String>(
 | 
					                                          child: Text("All"),
 | 
				
			||||||
                                            child: Text("None")),
 | 
					                                          onTap: () {
 | 
				
			||||||
                                        const PopupMenuItem<String>(
 | 
					                                            _emailPageKey.currentState!
 | 
				
			||||||
                                            child: Text("Read")),
 | 
					                                                .selectAllEmails(true);
 | 
				
			||||||
                                        const PopupMenuItem<String>(
 | 
					                                          },
 | 
				
			||||||
                                            child: Text("Unread")),
 | 
					                                        ),
 | 
				
			||||||
                                        const PopupMenuItem<String>(
 | 
					                                        PopupMenuItem<String>(
 | 
				
			||||||
 | 
					                                          child: Text("None"),
 | 
				
			||||||
 | 
					                                          onTap: () {
 | 
				
			||||||
 | 
					                                            _emailPageKey.currentState!
 | 
				
			||||||
 | 
					                                                .selectAllEmails(false);
 | 
				
			||||||
 | 
					                                          },
 | 
				
			||||||
 | 
					                                        ),
 | 
				
			||||||
 | 
					                                        PopupMenuItem<String>(
 | 
				
			||||||
 | 
					                                          child: Text("Read"),
 | 
				
			||||||
 | 
					                                          onTap: () {
 | 
				
			||||||
 | 
					                                            //select the read
 | 
				
			||||||
 | 
					                                          },
 | 
				
			||||||
 | 
					                                        ),
 | 
				
			||||||
 | 
					                                        PopupMenuItem<String>(
 | 
				
			||||||
 | 
					                                          //select the unread
 | 
				
			||||||
 | 
					                                          child: Text("Unread"),
 | 
				
			||||||
 | 
					                                          onTap: () {
 | 
				
			||||||
 | 
					                                            //select the unread
 | 
				
			||||||
 | 
					                                          },
 | 
				
			||||||
 | 
					                                        ),
 | 
				
			||||||
 | 
					                                        PopupMenuItem<String>(
 | 
				
			||||||
                                            child: Text("Starred")),
 | 
					                                            child: Text("Starred")),
 | 
				
			||||||
                                        const PopupMenuItem<String>(
 | 
					                                        PopupMenuItem<String>(
 | 
				
			||||||
                                            child: Text("Unstarred")),
 | 
					                                            child: Text("Unstarred")),
 | 
				
			||||||
                                      ],
 | 
					                                      ],
 | 
				
			||||||
                                      onSelected: (String result) {
 | 
					                                      onSelected: (String result) {
 | 
				
			||||||
                                        print("result $result");
 | 
					                                        print("result $result");
 | 
				
			||||||
                                      },
 | 
					                                      },
 | 
				
			||||||
                                    ),
 | 
					                                    ),
 | 
				
			||||||
                                    if (bulkOptionsState) ...<Widget>[
 | 
					                                    if (selectedThreads.isNotEmpty) ...<Widget>[
 | 
				
			||||||
 | 
					                                      //this needs to know if anything got selected,
 | 
				
			||||||
                                      IconButton(
 | 
					                                      IconButton(
 | 
				
			||||||
                                          onPressed: null,
 | 
					                                          onPressed: null,
 | 
				
			||||||
                                          icon: Icon(Icons.archive_outlined)),
 | 
					                                          icon: Icon(Icons.archive_outlined)),
 | 
				
			||||||
| 
						 | 
					@ -379,7 +407,11 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                          onPressed: null,
 | 
					                                          onPressed: null,
 | 
				
			||||||
                                          icon: Icon(Icons.delete_outlined)),
 | 
					                                          icon: Icon(Icons.delete_outlined)),
 | 
				
			||||||
                                      IconButton(
 | 
					                                      IconButton(
 | 
				
			||||||
                                          onPressed: null,
 | 
					                                          onPressed: () {
 | 
				
			||||||
 | 
					                                            _emailPageKey.currentState!
 | 
				
			||||||
 | 
					                                                .markSelectedAsRead(
 | 
				
			||||||
 | 
					                                                    true); //mark as read
 | 
				
			||||||
 | 
					                                          },
 | 
				
			||||||
                                          icon: Icon(
 | 
					                                          icon: Icon(
 | 
				
			||||||
                                              Icons.mark_email_read_outlined)),
 | 
					                                              Icons.mark_email_read_outlined)),
 | 
				
			||||||
                                      IconButton(
 | 
					                                      IconButton(
 | 
				
			||||||
| 
						 | 
					@ -390,9 +422,10 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                    PopupMenuButton<String>(
 | 
					                                    PopupMenuButton<String>(
 | 
				
			||||||
                                        icon: const Icon(Icons.more_vert),
 | 
					                                        icon: const Icon(Icons.more_vert),
 | 
				
			||||||
                                        itemBuilder: (BuildContext context) {
 | 
					                                        itemBuilder: (BuildContext context) {
 | 
				
			||||||
                                          if (!bulkOptionsState) {
 | 
					                                          if (selectedThreads.isEmpty) {
 | 
				
			||||||
 | 
					                                            //why tf?
 | 
				
			||||||
                                            return <PopupMenuEntry<String>>[
 | 
					                                            return <PopupMenuEntry<String>>[
 | 
				
			||||||
                                              const PopupMenuItem<String>(
 | 
					                                              PopupMenuItem<String>(
 | 
				
			||||||
                                                child: Row(
 | 
					                                                child: Row(
 | 
				
			||||||
                                                  children: [
 | 
					                                                  children: [
 | 
				
			||||||
                                                    Icon(Icons
 | 
					                                                    Icon(Icons
 | 
				
			||||||
| 
						 | 
					@ -403,6 +436,14 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                                    Text("Mark all as read")
 | 
					                                                    Text("Mark all as read")
 | 
				
			||||||
                                                  ],
 | 
					                                                  ],
 | 
				
			||||||
                                                ),
 | 
					                                                ),
 | 
				
			||||||
 | 
					                                                onTap: () {
 | 
				
			||||||
 | 
					                                                  _emailPageKey.currentState!
 | 
				
			||||||
 | 
					                                                      .selectAllEmails(true);
 | 
				
			||||||
 | 
					                                                  _emailPageKey.currentState!
 | 
				
			||||||
 | 
					                                                      .markSelectedAsRead(true);
 | 
				
			||||||
 | 
					                                                   _emailPageKey.currentState!
 | 
				
			||||||
 | 
					                                                      .selectAllEmails(false);
 | 
				
			||||||
 | 
					                                                },
 | 
				
			||||||
                                              ),
 | 
					                                              ),
 | 
				
			||||||
                                              const PopupMenuDivider(),
 | 
					                                              const PopupMenuDivider(),
 | 
				
			||||||
                                              PopupMenuItem(
 | 
					                                              PopupMenuItem(
 | 
				
			||||||
| 
						 | 
					@ -411,11 +452,12 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                                  style: TextStyle(
 | 
					                                                  style: TextStyle(
 | 
				
			||||||
                                                      color: Colors
 | 
					                                                      color: Colors
 | 
				
			||||||
                                                          .blueGrey.shade300),
 | 
					                                                          .blueGrey.shade300),
 | 
				
			||||||
                                              ))
 | 
					                                                ),
 | 
				
			||||||
 | 
					                                              )
 | 
				
			||||||
                                            ];
 | 
					                                            ];
 | 
				
			||||||
                                          } else {
 | 
					                                          } else {
 | 
				
			||||||
                                            return <PopupMenuEntry<String>>[
 | 
					                                            return <PopupMenuEntry<String>>[
 | 
				
			||||||
                                              const PopupMenuItem<String>(
 | 
					                                              PopupMenuItem<String>(
 | 
				
			||||||
                                                child: Row(
 | 
					                                                child: Row(
 | 
				
			||||||
                                                  children: [
 | 
					                                                  children: [
 | 
				
			||||||
                                                    Icon(Icons
 | 
					                                                    Icon(Icons
 | 
				
			||||||
| 
						 | 
					@ -426,6 +468,11 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                                    Text("Mark as unread")
 | 
					                                                    Text("Mark as unread")
 | 
				
			||||||
                                                  ],
 | 
					                                                  ],
 | 
				
			||||||
                                                ),
 | 
					                                                ),
 | 
				
			||||||
 | 
					                                                onTap: () {
 | 
				
			||||||
 | 
					                                                  _emailPageKey.currentState!
 | 
				
			||||||
 | 
					                                                      .markSelectedAsRead(
 | 
				
			||||||
 | 
					                                                          false);
 | 
				
			||||||
 | 
					                                                },
 | 
				
			||||||
                                              ),
 | 
					                                              ),
 | 
				
			||||||
                                              const PopupMenuItem<String>(
 | 
					                                              const PopupMenuItem<String>(
 | 
				
			||||||
                                                child: Row(
 | 
					                                                child: Row(
 | 
				
			||||||
| 
						 | 
					@ -441,7 +488,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
 | 
				
			||||||
                                              const PopupMenuItem<String>(
 | 
					                                              const PopupMenuItem<String>(
 | 
				
			||||||
                                                child: Row(
 | 
					                                                child: Row(
 | 
				
			||||||
                                                  children: [
 | 
					                                                  children: [
 | 
				
			||||||
                                                      Icon(Icons.star_border_outlined),
 | 
					                                                    Icon(Icons
 | 
				
			||||||
 | 
					                                                        .star_border_outlined),
 | 
				
			||||||
                                                    const SizedBox(
 | 
					                                                    const SizedBox(
 | 
				
			||||||
                                                      width: 4.0,
 | 
					                                                      width: 4.0,
 | 
				
			||||||
                                                    ),
 | 
					                                                    ),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue