Monday, May 27, 2019

Flutter - Pragmatic state management using provider.

As we know, we have to make a hierarchy of widgets to design a screen in Flutter with help of Stateless and Stateful widgets. As the names suggest, the Stateless widget has no internal state which means once built and can never be modified. On the other side, the Stateful widgets are dynamic and have a state, which we can be modified easily throughout their life-cycle without re-initiation.
flutter-pragmatic-state-management-provider-flowThe state of widget is the information that can be read synchronously when the widget is built and change during the lifetime of the widget.  In order to change widget, you need to update the state object which can be update by using setState() function of Stateful widgets.

Share:

Sunday, May 26, 2019

Flutter - how to architect projects with BLOC pattern.

Today, whenever we start a new project. We have to focus on building a solid structure or architecture of the project. An application leads readable, maintainable and testable if you have made a clean and good architecture of an application.
Flutter framework provides us a lot of flexibility to organize and architect applications code-base. So, if you not following the proper and good architecture of the project. It may be lead to applications with large classes, inconsistent naming schemes, scary architectures.
Share:

Saturday, April 20, 2019

Flutter - Important properties of Textfield.

Whenever we start designing a login and sign-up form of any application. We always need an input field to take input from end users that are a primary way for them.

flutter textfield  properties
In Flutter, we have a TextField widget to take input from the end users. A text field lets the user enter text, either with a hardware keyboard or with an on-screen keyboard. It is defined as a stateful widget in the framework. It's having many important properties that can be set to customize the behavior.

Share:

Friday, April 5, 2019

Flutter - Google map widget plugin example.

When I was started working with Flutter framework. I found lots of third-party plugins to create application screen. The google map plugin was one of them that is still under construction. By using this plugin, we have written the following post.

Flutter - Google map plugin.
Flutter - How can draw route on google map between markers.

If you have read and worked on them. You will see, it has some limitations to work on UI design of google map.

Flutter team has rolled out their own google map widget. This is a widget that is very helpful to design inline google map screen in the application. We can perform all the actions that we do with a normal widget. This plugin is also under construction and they breaking the changes in this widget.

Share:

Saturday, March 30, 2019

Flutter - Custom red error widget screen.

When you started work on Flutter application screen design. You definitely face a red screen that shows UI error. It is most irritating and makes us unhappy when you are a beginner.

In Flutter, it’s important to understand how your user experiences these bugs and where those bugs occur. How we can find the bugs with the highest impact and work to fix them. Sometimes, it's necessary to show a meaningful message to make it more sensible for the tester and developer. Flutter framework provides us customization feature to handle these error widget. According to the docs, Flutter shows red screen error whenever a widget fails to build. There is a performRebuild() method inside of StatefulWidget.dart class that invoke to build the widget.
performRebuild
@override void performRebuild() { //..// try { built = build(); debugWidgetBuilderValue(widget, built); } catch (e, stack) { built = ErrorWidget.builder(_debugReportException('building $this', e, stack)); } //..// }
As we can see, the red screen error is nothing but a widget named ErrorWidget provided by the framework. The ErrorWidget will be invoked only when a widget building fails. When widget building fails, Error Widget replaces with your widget. That’s why it's visible only in the area occupied by the widget that has failed to build.

Share:

Sunday, March 24, 2019

Flutter - Localization or Multi Language support with Examples.

If you have created a mobile application and you want to increase users of the mobile application. So, we need to support multiple languages in our application. In mobile, with the help of localization, you can change the language of application labels and we can render the content of the app into other languages. We can customize the app for each target market and user.

We can display dates, times, and numbers in particular user readable formats. Android and iOS is the most popular mobile operating system and it runs on millions of devices in many regions. So, if we implement an app which is localized for all the regions, then it will reach most of the users. 

Share:

Friday, March 15, 2019

Android - SMS & Call Log permissions are removed.

Sms and call logs are one of the most sensitive information in the smartphone. They hold lots of information like your phone number, conversation history, and the personal information of other people in your phone. 

Google is day by day updating their policy to protect them. Google's Play Store policy has changed for SMS and call. Google has denied the request permission for SMS and call log. Google removing all the apps that require SMS and Call Logs permissions from the Play Store.  

Google published new guidelines regarding SMS and Call Permissions. According to their new policies, only an app that has been selected as a user’s default app for making calls or text messages will be able to access call logs and SMS, respectively. To read more about their announcement, please see the following link: Security and performance 

Android app developers who have such apps on the Play Store have been notified through e-mail and their apps will be removed unless they have submitted a permissions declaration form. Google has stated that only those apps that require access to call logs and SMS for their functionality will stay put on the Play Store, while all others requiring these permissions will be removed.
Now you should be removing it from the AndroidManifest file and should update the app in play store.


Share:

Sunday, February 17, 2019

Android - GPS Location and Address with new google map API in kotlin.

Today, mobile phones are more powerful that offers GPS Location to users in mobile applications. To use GPS location and google map, the Android SDK offers the location API that is updated by the Android SDK development team day by day for optimizing mobile battery life and other aspects. Android location APIs make a location-aware application, without needing to focus on the details of the location technology.


GPS location tracker works with the help of Google Play services, which facilitates adding location awareness to an application with automated location tracking, geofencing, and activity recognition that returns a location object. The location object represents a geographic location which consists of latitude, longitude, timestamp, and other information.

Share:

Saturday, February 9, 2019

Flutter - No connected devices.

flutter no device connected
To develop a mobile application, we always need a testing real device or Android Emulator device to test developed features. In this post, we going to share some tips to connect a device with a development IDE. Maybe this is very useful for those people facing device connectivity problem. So here, we have some tips that you can use to resolve it.

Share:

Sunday, February 3, 2019

Flutter - Equivalent of RelativeLayout in Flutter

If you have worked with native Android application development. Then you definitely know about the Relative Layout. The Relative Layout is a very flexible layout that used for custom layout designing. It gives us the flexibility to position a view based on the relative or sibling component’s position.
flutter relative layout alternative widget
In Flutter, we can design a screen with the help of StatelessWidget and StateFulWidget. So, if you are thinking such kind of layout in Flutter Application. Then you can use Column, Row and Stack widgets to design your application screen in Flutter. Flutter layouts are usually built using a tree of these widgets. These widgets take constructor arguments that specify rules for how the children are laid out relative to the parent, and you can also influence the layout of individual children by wrapping them in Expanded, Flexible, Positioned, Align, or Center widgets that are explained here

Share:

Get it on Google Play

React Native - Start Development with Typescript

React Native is a popular framework for building mobile apps for both Android and iOS. It allows developers to write JavaScript code that ca...