Flutter provider is always a nice solution for state management with Flutter. Provider is great for API request management, and also useful for plenty of other state management scenarios as well.
If we need to access the same data from two or more screens, I always recommend you to create a separate provider class to hold the data and functionalities you want. It will lead you to a maintainable, clean code.
For the package installation you can refer to my article below.
If you know how to install the package, we can move to our simple demo. Here is…
When creating amazing UI screens with flutter, Container Widget plays a major role. I really like to add the Container widget in many places as it really helps me to create the desired UI easily and quickly.
I hope this article will be really helpful for the beginners.
Let’s see what we can do with Containers to make our UI more attractive.
To create a simple square or a rectangle we can create a Container for a given width and a height (you can see that this example has also avoid the use of an additional child widget).
Sometimes we have to send emails through our mobile applications. If the application backend doesn’t support for email sending, we need to support sending emails directly through the device. flutter_email_sender is a good plugin which allows send emails from flutter using native platform functionality.
In android it opens default mail app via intent. In iOS
MFMailComposeViewController is used to compose an email. Let’s create a small email sending screen for your app. If you need to add image attachments add image_picker package as well.
Get packages with your editor or terminal
flutter pub get
State management is very important when we work with flutter. Flutter provider is much better way to handle state in Flutter. The
provider package is easy to understand and it doesn’t use much code. It also uses concepts that are applicable in every other approach.
We don’t have to keep so many files to use provider and the implementation is really easy and simple.
Let’s get started. I will explain the api handling with a get request.
Let’s install the package. Always install the latest version of the package. Add the package in to your pubspec.yaml file.
Since app localization is very common with mobile app development I thought to write about one of my favorite flutter plugins. App internationalization is really fast and easy with easy_localization plugin. Specially with the latest update. I will guide you to create a simple app page with change language functionality.
To get started add the plugin dependency to your pubspec.yaml file and run packages get command.
I used the above version. Always make sure you got the latest version of the plugin. Import the plugin to your dart file.
In the main method add the…
When your are building a mobile app you may be need to create a detail view that doesn’t fit your device size. In such cases you can use a pdf to view your details. Let’s see how to generate a pdf view with your data in flutter.
We can use packages that created by the flutter community to make things easier.
To Get started install following packages in latest versions. These are the versions that I used.
Using flutter_full_pdf_viewer create a PdfViewerPage for a given path as follows.
Next you can create your…
Sometimes Handling form validation in react can be really annoying and time consuming. But formik is a small library that helps you with the 3 most annoying parts:
This article will help you to manage your form validation in a simple way. This is just a example form created with Material UI to give you a clear idea on validating your material text fields.
You can simply install formik and yup libraries with npm or yarn. yup will make validation more easier with formik.
Flutter is Google’s mobile app Software development kit for creating high quality native interfaces on iOS and android in record time. Flutter works with existing code which used by developers and organizations around the world. Flutter is free and open source. Flutter’s hot reload and modern reactive framework helps you to develop your app much faster and compose app UIs easily. Flutter lets you to reuse existing Java, Swift, ObjC code and access native features and SDKs on iOS and android.
Flutter has the tools and libraries to help you easily bring your ideas to life on iOS and Android…