Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #1022 - tap to switch to search card ("Welcome to Open Food Facts") #1502

Merged

Conversation

cli1005
Copy link
Contributor

@cli1005 cli1005 commented Apr 6, 2022

What

  • Tapping on the scan button while on the scan screen should return the scan view to its initial state ("Welcome to Open Food Facts")

Screenshot

rpreplay-final1649246863_pA2IhwoI.mp4

Fixes bug(s)

Part of

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heyy, the code looks good, thanks for this feature @cli1005. just some small comments but feel free to ignore them.

@@ -60,7 +60,7 @@ class ContinuousScanModel with ChangeNotifier {
_states.clear();
_latestScannedBarcode = null;
await refreshProductList();
for (final String barcode in _productList.barcodes.reversed) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that fix #1139

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it fixs partially #1139, the reordering issue is ok, but we still switch to the last card when returning from ranking page and product page, I will handled it in the scope of #1139

@@ -34,6 +35,7 @@ class PageManagerState extends State<PageManager> {
};

BottomNavigationTab _currentPage = BottomNavigationTab.Scan;
List<Widget> _tabs = <Widget>[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything stopping you from directly adding all the _buildOffstageNavigator's up here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be frank, I don't have a MUST reason to put it here😄

}
}

class _InheritedDataManagerProvider extends InheritedWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using Provider for state managment, what about using it to keep the code consistent

Copy link
Contributor Author

@cli1005 cli1005 Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to pass a flag from page_manager to scan_carousel, InheritedWidget might be a better approach to prevent adding params to constructors or rebuilding the whole tree

@cli1005 cli1005 merged commit 7bf48b0 into openfoodfacts:develop Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tapping on the scan button while on the scan screen should return the scan view to its initial state
2 participants