Sunday, September 30, 2018

Flutter - Back press in a Flutter Application.

back press event
As we know, mobile having a small screen to display content. That why most apps contain several screens to display different types of information. 

Example: We might have a screen that shows products. Our users could then tap on a product to get more information about it on a new screen. In that case, a user will move on another screen of the app.  When a user navigates to application screens. Sometimes we need to handle device back press event like:

1. We want to show a pop-up before the close app or close some connection that app using.
2. You can ask the user to confirm that they want to discard their changes when they tap the back button or back navigation arrow.  

Share:

Flutter - How can send and receive data between screens.

In Flutter, the user interface is displayed through widgets. The widget is used to represent the data to the user and allows user interaction.
In a mobile application, we can have multiple widgets(Screen) and that can interact with each other. During widget interaction, we might be required to pass data from one widget to other.

Example: If you are developing an application for news feed reader, you may require having at least two screens. While the first screen displaying the list of news feeds and other displaying the feed details. Sometimes we need to send data to another screen and after some calculation, we need it back.

How can send data to another screen?
To send data, we have to use Navigator to push a new MaterialPageRoute onto the stack with our data.
Send data
String userName = "www.developerlibs.com"; Navigator.push( context, new MaterialPageRoute( builder: (BuildContext context) => new Screen5(userName)));

How can get back data?  
We can send data back to the previous screen with the help of the pop method.

Get back data.
Navigator.pop(context, "www.developerlibs.com"
 

In this post, we going to create a Flutter application. Where we'll send some data to another screen and we'll receive updated data. To create this app, we have to use navigator and route that we have explained in our post: Screen push and pop with Navigator.


Share:

Saturday, September 29, 2018

P2P Kit is a better way to use Bluetooth in mobility.

Bluetooth is a way to exchange data with other devices wirelessly. Android and Ios provide Bluetooth API to perform several tasks such as:

1. Scan Bluetooth devices.
2. Connect and transfer data between devices.
3. Manage multiple connections etc.

In this post, I'm going to explain the power of P2pkit that is a better way to use Bluetooth in Android and Ios device. It is a Software Development Kit (SDK) which enables application developers to integrate proximity-based features into their apps.
The p2pkit discover nearby devices and estimate their range and seamlessly broadcast content to them.

P2pkit is cross-platform SDK. It's compatible with iOS, macOS, Android and supports several radio technologies (BLE, WiFi Direct). It is very lightweight and hardly consumes any battery.

Nearby devices are notified when a proximity event takes place and receive the identifier, discovery info and range estimation. Your app can respond to this event in any way it chooses. 

Share:

Flutter- Screen push and pop with Navigator.

Flutter SDK provides us lot of widgets to create a beautiful screen. Building a user interface with Flutter is pretty simple. To create a big application, we need to create a multi-screen application. We will be required to move around the application or send data back to the screens. 

navigator, push, pop We need to create a multi-screen application that shows all feature of the application in a specific manner. So, users can constantly be navigating between different screens. For example, from a list to a detail screen of product, from a shopping cart to a checkout screen, from a menu into a form, and many other cases.

Flutter provides us navigation and route to manage multi-screen apps. Navigator creates a stack of route object. A Route tells to navigation where to go from now. The stack of navigator keeps track of where all we went from the beginning and how can we come back to the initial state. Flutter uses both Stack and Route to show a new screen of the application. The route tells which page to load and stack makes sure that it’s loaded on top of existing one. To show and hide a screen, navigator provides us Navigator.push and Navigator.pop methods. By using this, a mobile app can reveal their full-content on another screen.


Share:

Saturday, September 15, 2018

Flutter - Calendar and Date Format in Flutter.

As we know, Flutter has its own UI components, along with an engine to render them on both the Android and iOS platforms.

Calendar in Flutter
To Display date, time and calendar. Flutter providing us some useful widgets like showDatePicker, DateTime, and DateFormat.

In this post, we are going to learn about the above widget. We'll create a flutter Application and we'll see, how we can use above widget in the Flutter Application for display date and time in a specific format. We'll discuss some use case like UTC date conversion.

Share:

Sunday, September 2, 2018

Flutter - Form Validation in Flutter.

Flutter is a mobile UI open source framework to build high-quality native interfaces for iOS and Android apps with the unified codebase. Flutter has its own UI components, along with an engine to render them on both the Android and iOS platforms. You can compose your whole application UI with widgets that contain other widgets.

In this post, we going to discuss form widget. We can use the form to design sign-up and login screen of Application. The best thing about the form is that we can validate each field in the same field. If we creating sign-up and login form of mobile application. Then form validation is an essential part of the app. It saves server computing time because we can validate param at the client side. We can ask the user to a enter valid phone number and we can smartly validate the entered mobile number and other data itself.

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...