I wanted to play with Flutter PageViews and decided to port to Flutter the image carousel in this post in Uplabs.

The effect is built using two synchronized PageViews, the background PageView using the full page and the foreground PageView a fraction of it.

The image shows the end result with the familiar Flutter “slow mode” banner.

Bhavesh Jabuvani, the original app author, did a great job on the Android part but I wanted to see how Android and Flutter compared in code size to get an approximate idea of the development time spent in each solution.

Looking at the flutter code in github and comparing it with the android counterpart, the following stands out:

Flutter: 1 file and 127 lines (42 lines being empty lines and closing parenthesis and brackets)

Android: 5 source files and 9 resource files (not counting images), 273 lines in source files and 110 in resources.

This is just a sample of how efficient is to build beautiful and responsive UIs with Flutter.

Thanks to the Flutter team and the community for all the effort put in such a powerful and enjoyable framework.