Khalti’s Journey to Flutter, A Peek Into the Minds of Khalti’s Developer Team

Khalti has unveiled the beta launch of its app made with Flutter. To mark the launch, the Facebook community Flutter Nepal organized a session titled “Khalti’s Journey to Flutter” in collaboration with Khalti. In the event, the Khalti team shared their success story and the journey to this new technology.

About Flutter

Flutter is an open-source UI software development kit created by Google. It is used to develop cross-platform applications for Android, iOS, Linux, Mac, Windows, Google Fuchsia, and the web from a single codebase.

According to Statista, around one-third of developers use cross-platform technologies or frameworks. Cross-platform application development is about building a single application that can run on various operating systems, instead of developing different app versions for each platform. Flutter is the primary choice of developers for cross-platform app building.

The search engine giant Google itself released Flutter in the market with the sole purpose of speeding up as well as provide hassle-free development of applications.

About Khalti

Khalti is a mobile wallet, payment gateway & service provider in Nepal. Launched in January 2017, Khalti is an emerging online payment solution in Nepal. It allows users to pay for a range of services like basic utility payments, hotel bookings, movie and domestic flight tickets, events, and many more. It is operated and owned by Sparrow Pay Pvt. Ltd.

Khalti was declared the global winner of the Google Business Group Storytelling Contest 2017. The company has also partnered with The Asia Foundation to provide digital and financial literacy information to all Nepali migrant workers through the Shuvayatra app, which is funded by Department for International Development (DFID).

Most Khalti users perform the majority of their transactions from its app, which is why the Khalti app itself can be considered Khalti’s biggest product.

Khalti’s Journey to Flutter

Amit Agrawal is the co-founder of Khalti. In the event, Agrawal stated that some features have yet to be introduced in the beta launch: Khalti quiz, movies, events, offers, voting, for example. The beta app has been launched with the basic features and the company expects to deal with bugs in the first Flutter app launch.

Agrawal was thankful for the overwhelming response to the event. 426 eager Flutter community members from Nepal had registered for the session. While android users could test the beta app on their devices during the session, their iOS version was sent for review for the moment, and Agrawal expected to have it approved in a couple of days.

Agrawal hoped that the session inspires other startup companies to share their own development stories and experience, hence boosting the overall growth of the startup ecosystem.

Suman Gautam from Flutter Nepal was elated to organize the session. With 4,300 members in the Flutter Nepal group, Gautam was certain that Khalti’s move will further motivate developers working with Flutter and also encourage others to pursue the new technology.

The BODs of Khalti were the hosts of the program:

1) Amit Agrawal, Co-Founder
2) Manish Modi, MD
3) Dhruba Adhikari, Co-Founder
4) Arvind Sah, Co-Founder

Developer Team

1) Ishwor Shrestha, Principal Software Engineer, Mobile Lead
2) Bibek Maharjan, Principal Software Engineer
3) Sarbagya Dhaubanjar, Senior Software Engineer
4) Ravikant Poudel, Senior Software Engineer
5) Bikas Giri, Khalti’s Developer Team

Start of Developers’ Talk

Bibek Maharjan, Principal Software Engineer

Bibek Maharjan has been working at Khalti for more than 4 years. He is into mobile development since 2014. He previously worked at Rupaiya, a payment gateway company. With an interest to work in mobile development, he joined Khalti in android development, about a month after Khalti had unveiled the first version of its mobile app.

This is the excerpt from his talk at the session:

1) Compared to Khalti’s Java version of the app, the Flutter version’s navigation is a lot easier for developers and app users.
2) Cross-platform being an emergent technology, the Khalti team was led into research that concluded that Flutter was the best cross-development technology.
3) Flutter has made it a lot easier for Khalti’s developer team to sync the iOS and Android versions of their app.
4) The boilerplate code in the Java/ Kotlin version has been eliminated by the Flutter version. This has also changed their old imperative programming procedure to declarative programming, hence facilitating code creation, optimization, and performance.
5) Hot restart and hot reload are a lot faster with Flutter. As Khalti kept adding more and more features, hot reload was taking a tediously long time in the native versions. Maharjan added that users may witness an increased performance and added features in Khalti’s Flutter version compared to other Android apps, or the company’s own old, native version.

Bikas Giri, Khalti’s Developer Team

Bikas Giri confessed that like with any new programming language, the unique syntax made learning Dart tough in the early days. Dart is the programming language used in Flutter App Development. It is an object-oriented, class-based, garbage-collected language with C-style syntax, also developed by Google.

The declarative style of UI programming, although considered a better alternative to the imperative style, was initially challenging to make sense of, Giri stated. Giri thinks the widgets system of Flutter is the easiest among all app development platforms, including native development technologies. Everything is a widget in Flutter. The central idea is that you build your UI out of widgets. Widgets describe what their view should look like given their current configuration and state.

However, Giri opined that debugging may be fast and simpler in the native platform itself. Giri stressed the fact that Flutter helps develop releasable apps with efficient UI at a faster pace.

Ishwor Shrestha, Principal Software Engineer, Mobile Lead

Ishwor Shrestha has worked at Janaki Technology, Khalti’s parent company, for almost 7 years. He was a colleague with Bibek Maharjan at Rupaiya too. While he initially worked on Janaki Technology’s in-house projects, he has now worked at Khalti for 5 years.

His talk revolved around the surface-level exploration of the database, app architecture, and packages used in Khalti’s Flutter version.

1) The Khalti team has used Sembast for the database.
2) The developer team used monorepo for version control. This made testing, maintenance, and navigation efficient. Nonetheless, the team had a challenge of updating packages in each directory since pubspec.yaml does all package updating in Flutter, and the updates are only made in the particular directory. The team wrote a project management strip to partially automate this.
3) The Khalti team used Flutter Bloc for state management, considering its efficacy on large-scale state management. Nonetheless, the team has added its own abstraction on all packages it used to improve communication between packages and make switching between them easier.
4) The team stayed in Flutter’s dev channel, hence being able to make use of features before they were stable.
5) Code creation is Flutter’s best trait. Code generation was better and eliminated a lot of code duplication. He also confessed that the team took help from Flutter’s The Boring Flutter Development Show on Youtube.

6) Sound Null Safety in Dart differs from null safety on Kotlin. Null safety was enabled in Khalti’s older version too. The null pointer exception is a programmer’s nightmare. Thus, enabling null safety was a must for Khalti, and Flutter got the job done.
7) The team vowed to avoid third-party packages during development, and rather stick to their own code. The form-controlling package is one such example of Khalti’s self-made packages, and Khalti hasn’t made this package open-source.

Sarbagya Dhaubanjar, Senior Software Engineer

Sarbagya Dhaubanjar has been working at Khalti for almost 1.5 years. His talk revolved around the challenges faced by the developer team during the course of migrating Khalti’s app to Flutter and the solutions that the team came up with.

1) Null safety was the hot topic when the team started. Although Dart had freshly introduced null safety, Flutter had not fully migrated. Khalti’s team was using the Flutter dev channel, which enabled them to use the null safety feature earlier.
2) During Flutter framework migration, Khalti’s developer team faced migration issues, including breakage in code and functionalities. Note that Flutter’s developer team itself was facing such issues, since Flutter is a big framework, and migrating the entire platform to null safety was a gargantuan task.

Note that Dhaubanjar went to great depth about the specific issues encountered. The details are omitted here to prevent this informative article from being too technical. Nonetheless, the full video can be found here.

Ravikant Paudel, Senior Software Engineer

Ravikant Poudel has been working at Khalti for more than 2 years. He previously worked as an Android Developer at Ekbana Solutions. His talk revolved around the learning and recommendations of Khalti’s team during the course of app development.

1) The team prioritized testing from the very beginning of development. This helped the team to replicate any development issues and solve them at the earliest. Testing on multiple devices also helped the team identify UI overflow issues and handle them at the very instant.
2) The Khalti team has added abstraction to dependencies added to the app so that new updates do not break the app. He gave the example of the Image Picker package that crashed in multiple places after a minor update. Nonetheless, he mentioned that abstraction should not be overdone.
3) He highlighted the importance of peer code review. As a programmer, it is natural to think that what we do is always the better way. Peer review helps identify judgment flaws in code development. At the same time, peer code review may delay updates to the code, however.
4) The Khalti team was extra careful to minimize the use of the set state method in stateful widgets. Although the method is powerful, excessive use may hamper the app build.

End of Developers’ Talk

After the end of the talk session, the team took questions from participants. Do you think I should also transcribe the questionnaire session? Kindly comment down below.

I transcribed the session out of a sheer passion for what the team had accomplished. I hope this article stays on the internet as evidence of what our country has achieved in Flutter Development so far.

I am a non-IT student, and I recently started my Flutter journey from scratch. Coding had the most distant of relationships with me. Nonetheless, Flutter’s convenient learning curve enabled me to publish a really, really, really simplistic app on the Play Store. Check it out for no reason.

Leave a Comment

Your email address will not be published.