WIP: android/ios-adaption feature, markdown, and augment #6

Draft
Juan wants to merge 35 commits from android-adaption into main
Showing only changes of commit 072f8274c0 - Show all commits

View File

@ -229,6 +229,7 @@ class _CollapsableEmailsState extends State<CollapsableEmails> {
if (!_isLoaded) { if (!_isLoaded) {
return const Center(child: CircularProgressIndicator()); // loading screen return const Center(child: CircularProgressIndicator()); // loading screen
} }
// final List<AugmentTree> nodesToDisplay;
final AugmentTree final AugmentTree
currentZoomNodeForThisEmail = //each index is an email in the thread currentZoomNodeForThisEmail = //each index is an email in the thread
@ -237,18 +238,20 @@ class _CollapsableEmailsState extends State<CollapsableEmails> {
print(currentZoomNodeForThisEmail.children); print(currentZoomNodeForThisEmail.children);
print(currentZoomNodeForThisEmail.parent); print(currentZoomNodeForThisEmail.parent);
// if (_isFilteringActive) {
// nodesToDisplay = queryResults;
// } else {
// nodesToDisplay = currentZoomNodeForThisEmail.children;
// }
final canZoomOut = currentZoomNodeForThisEmail.parent != null; final canZoomOut = currentZoomNodeForThisEmail.parent != null;
if (currentZoomNodeForThisEmail.children.isEmpty) {
if (_isFilteringActive) {
return ListView.builder( return ListView.builder(
itemCount: 1, itemCount: queryResults.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final childNode = currentZoomNodeForThisEmail; AugmentTree childNode = queryResults[index];
// final childNode = currentZoomNodeForThisEmail.children[index];
final canZoomIn = childNode.children.isNotEmpty;
// currentZoomNodeForThisEmail.addNumbering();
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 6.0), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: Material( child: Material(
elevation: 1, elevation: 1,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@ -263,14 +266,11 @@ class _CollapsableEmailsState extends State<CollapsableEmails> {
spacing: 4.0, spacing: 4.0,
children: [ children: [
OutlinedButton( OutlinedButton(
onPressed: onPressed: null,
canZoomOut ? () => _goToParent(indexThread) : null,
child: Icon(Icons.north_west_sharp), child: Icon(Icons.north_west_sharp),
), ),
OutlinedButton( OutlinedButton(
onPressed: canZoomIn onPressed: null,
? () => _goToChildren(indexThread, index)
: null,
child: Icon(Icons.south_east_sharp), child: Icon(Icons.south_east_sharp),
), ),
], ],
@ -306,8 +306,7 @@ class _CollapsableEmailsState extends State<CollapsableEmails> {
), ),
), ),
); );
}, });
);
} }
return ListView.builder( return ListView.builder(
@ -315,7 +314,6 @@ class _CollapsableEmailsState extends State<CollapsableEmails> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final childNode = currentZoomNodeForThisEmail.children[index]; final childNode = currentZoomNodeForThisEmail.children[index];
final canZoomIn = childNode.children.isNotEmpty; final canZoomIn = childNode.children.isNotEmpty;
// currentZoomNodeForThisEmail.addNumbering();
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 6.0), padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 6.0),
child: Material( child: Material(
@ -479,8 +477,10 @@ class _CollapsableEmailsState extends State<CollapsableEmails> {
} }
if (results.isNotEmpty) { if (results.isNotEmpty) {
setState(() { setState(() {
currentZoomTree[targetEmailIndex] = results.first; // Update the state queryResults = results;
// currentZoomTree[targetEmailIndex] = results.first; // Update the state
_isFilteringActive = true; _isFilteringActive = true;
currentZoomTree[targetEmailIndex] = root;
}); });
print(currentZoomTree); print(currentZoomTree);
} }