In Flutter development, mocking Dependencies is a crucial technique for isolating unit tests and ensuring that your codebase remains stable and efficient with the cross language library Mockito. Any developer with long enough experience has faced challenges of testing and maintaining complex software systems. In this article, we’ll explore the usage of Mockito in Flutter,…
How to format date and time to string in dart
You can use the intl package in Dart to format date and time variables and present them to your users in predefined pattern or in their local pattern. Here’s an example: First, add the intl package to your project by running the following command in your terminal: dart pub add intl Take into account the…
Flutter InkWell vs Button vs Material vs GestureDetector
There are several widgets to code Button behaviour in Flutter, besides the variations of Button, there are InkWell, Material & GestureDetector. 1. Material widgets Material: A widget that provides a material design background, but without actual behaviour MaterialButton: A button with a material design background with present ripple effect. // Material (Material) Material( elevation: 10,…
Internationalizing Flutter app with plain InheritedWidget
In this article I will be Implementing Internationalizing Flutter app from anywhere (within the app) with the help of arb files, plain InheritedWidget. I’ll be taking advantage and building on a previous article Flutter Localization with intl https://programtom.com/dev/2024/10/14/flutter-localization-with-intl/. MaterialApp fields Locale in a Flutter App is set through a locale field present in the Master…
shared_preferences is failing with Flutter 3.27
The update of Flutter to 3.27 is why it is good idea to have wrappers even for the components provided and developed by the Platform providers – in my case failing shared_preferences – especially when the provider is Google. Failing with issues There are several variations of issues: No implementation found for method getAll on…
Flutter HTML
Here are some examples of rendering HTML in Flutter using different packages – depending on the platforms you are going to target your apps. 1. HtmlElementView Class The HtmlElementView widget is build-in component, but it is meant to be used on the Web Platform. It may suite your needs if you only going to target…
How to implement partial commits in a Spring Boot service when using spring repositories
Implementing checkpoint or partial commits within a database transaction in a Spring Boot service can be tricky since Spring transactions are designed to be atomic: they either fully commit or fully roll back. However, you can achieve a similar effect by managing transactions explicitly in your service layer and leveraging Spring’s PlatformTransactionManager or nested transactions…
Flutter 3.27 web – TextFormField – The targeted input element must be the active input element
Upgrading any software aften introduces bugs – alongside the fixes and Flutter 3.27 is no different – introducing issues in TextFormField on the web Platform. The TextFormField web issues https://github.com/flutter/flutter/issues/156842 https://github.com/flutter/flutter/issues/160155 There are probably more. Temp Solution In my experience forcing the Flutter Engine to use WASM as the Web Target silenced the problem. Long…
What is appropate age for app that uses Large Language Models
The appropriate age for an app that usesLarge Language Models (LLMs) depends on the app’s design, content, and intended purpose. Here’s a breakdown of considerations: 1. General Recommendations 13+ (Teenagers and Adults): Many apps require users to be at least 13 years old, as this aligns with COPPA (Children’s Online Privacy Protection Act) regulations in…
how to unzip android-license.zip into the ANDROID_SDK licenses folder – inside a docker image
To unzip android-license.zip into the ANDROID_SDK/licenses folder inside a Docker image, you can follow these steps: Copy the zip file into your Docker container: You’ll need to copy the android-license.zip file from your host machine into your Docker container. You can do this by using the COPY instruction in your Dockerfile. Unzip the file: Once…