Tuesday, April 6, 2021
Four Key Stages of The Machine Learning Process
Friday, April 2, 2021
Showcase Your Widget with Flutter Widgets Explorer

Start from now, you can use Flutter Widgets Explorer as a platform to showcase your widget with README, codes and licensing information. The Flutter Widgets Explorer supports Android devices at the moment and will support Web in a week or two (Updated on 16 April 2021: The web version of the Flutter Widgets Explorer just went live @ fluwix.com).
Are you facing any problem with your Flutter development? Please answer the 3 questions Flutter Development Survey as we might have the solution to your problem.
By the way, you can install the Fluwix (formerly Flutter Widgets Explorer) app to your android phone by clicking on the following image link:
Wednesday, March 31, 2021
Flutter Navigation: flutter_modular or stacked?
The current way of Flutter Widgets Explorer using switch statement to construct the main listing screen and navigation no longer sustainable as I foreseen the number of showcases will be double or triple in the coming months.
Hence, I decided to look into new solution. First, I come across an article shared about Flutter Navigation 2.0. In my opinion, it is too complex, we need better abstraction to make it usable to developers. I search again and finally nailed down to two alternatives: flutter_modular and stacked.
Let's look at simple code metrics (line of codes) for both packages:
It is obvious that flutter_modular is the winner here. It has less boilerplate code and code generation is not required. For stacked, it still has more line of codes compared to flutter_modular after excluding the generated app.router.dart and app.locator.dart. Also, flutter_modular using Navigation 2.0 and stacked still using Navigation 1.0 if I'm not wrong (Correct me if I'm wrong).
Lastly, there's one pending issue for Flutter Widgets Explorer to adopt flutter_modular as it's navigation library, the default back button is missing, I opened an issue that still pending for response at the time of writing.
If you interested to dig into the code, feel free to look into the github repo for flutter_modular and stacked implementation.
Happy coding! :)
Tuesday, March 23, 2021
Deploy Serverless Machine Learning Models to AWS Lambda
I just completed the Udemy course with the same title of the blog post.
The course cover three machine learning examples using different library:
- scikit-learn: Using regression model from scikit-learn trained on California housing dataset for house price prediction.
- spacy: Using a small English model from spaCy NLP framework for named entity recognition.
- keras: Using ResNet50 computer vision deep learning model from Keras framework to create for image recognition.
Let's me tell you the following value-added changes of my code from the original source code from the course:
- The examples are using Python 3.8 instead of Python 3.6 in the course and latest version of libraries except the scikit-learn example using earlier version of scikit-learn to align with m2cgen which has the possibility to convert scikit-learn model to native code and C code running in the microcontroller with emlearn.
- To deploy all examples. you only need git, no other installations are required. All examples are setup with continuous deployment pipeline using Github Actions. The following diagram shows how it works from the high-level:

- Developer update changes to repository by sending a git push command.
- The git push command will trigger the Github Actions workflow which run the serverless deploy command based on configurations in serverless.yml file.
- The CloudFormation stack consists of API Gateway, AWS Lambda, S3, ECR, etc. will be created on AWS.
After you forked my repository, you just need to add AWS_KEY and AWS_SECRET to Repository secrets of Settings/Secrets of your github repo like the following image: Then, you can deploy all examples to AWS lambda with a git push command.
- All examples are setup with "warm start" and request throttling limit to 1 to protect your account and your wallet (You don't want to have surprises in your monthly credit card bill for demo projects, right?)
- All examples have a last step "Test Lambda functions" to verify the public API is working post-deployment.
- Spacy and keras example are deploy using Docker container image to AWS Lambda. Thanks to Jan Bauer published the blog post Using container images to run TensorFlow models in AWS Lambda, timing is just right on helping me to get the keras example working.
- For keras example, image uploaded directly to Lambda endpoint and store as temp file instead of upload to S3 bucket.
- Code of each example is located in its own branch.
Please take note of the storage cost of S3 and Elastic Container Registry (ECR), make sure you clean up unnecessary files and Docker image files there.
Lastly, if you look for someone on deploying your machine learning model to AWS lambda, I think I can help here. :)
Oh yeah, here is the github repo URL https://github.com/limcheekin/serverless-ml if you missed it.
I think the scope is broad enough for now, let's go deep.
Stay tuned to the next!
Monday, March 22, 2021
Flutter Multi-modules Support
I wrote this article to inform Flutter developers for a lesser known feature of Flutter: Multi-modules support in a Flutter project. Thanks for inspiration from an article A Flutter BLoC + Clean Architecture journey to release the #1st Idean Flutter app published on Medium.com. It mentioned about “Dart modules”, I not sure whether we are referring to the same thing here.
After gone through the article above, I perform a google search for Flutter module and I found many articles and videos on how to create modular Flutter project, or how to structure Flutter code in modular way, and a library known as flutter_modular. But I’m looking for “real” modules that supported by Flutter and IDEs to define a physical boundary among modules, not a logical one defined by developers. It is an “aha!” moment, out of no way I am thinking of typing flutter create –help command in my terminal window. From the list of options, I found the following option like what I am looking for.
Then, I proceed to flutter.dev website to find out more information about the -t option, not much information found besides a description similar to the above. Hence, I decided to create a Flutter project to test it out. In the flutter project directory, I’m creating two modules such as nested_list and tab_buttons using the following command:
flutter create -t module <module_name>
The following is directory structure of the Flutter project, you can see that the nested_list and tab_buttons module is outside the lib directory (All Flutter code need to be located in the lib directory normally).
The following is the advantages of the “real” Flutter module besides modular structure:
- It has it’s own pubspec.yaml file, you can manage assets, dependencies and other stuff on module-basis.
- It can have it main.dart, you can run the code of a module independent from project and other modules.
- It can have it own test directory, you can write tests to test code of the module.
- A Flutter project can have mix of non-null safety and null safety packages which segregated by modules.
- You can start null safety migration module by module without blocking the release cycle. Flutter Widgets Explorer will adopt this approach.
Once the module is ready, you can link the module to the project by specify the following dependencies configuration in the pubspec.yaml file:
The Flutter project is working in my mobile phone and Google Chrome with the following command:
flutter run -d chrome
Please check out the following github repo and test it out yourself:
https://github.com/limcheekin/flutter-modules
Thanks for reading, I hope the write ups is helpful to you, hear from you soon! :)









