build a form with validation in Flutter project

Flutter Forms Forms are an integral part of all modern mobile and web applications. It is mainly used to interact with the app as well as gather information from the users. They can perform many tasks, which depend on the nature of your business requirements and logic, such as authentication of the user, adding user, searching, filtering, ordering, booking, etc. A form can contain text fields, buttons, checkboxes, radio buttons, etc. Creating Form Flutter provides a Form widget to create a form.

Read more

How to Get SHA-1 key in Android Studio for Firebase.

There are two methods of getting SHA-1 key, but First one is not working for Windows user. So, if you are a Windows user then go for 2nd Method. Update:- On Android Studio Latest version(on 24 Sept 2021) 2020.3.1 for Windows 64-bit (912 MiB), Step 2 will not Work. So, go for Step 3. 1. Using Keytool Open a terminal and run the keytool the utility provided with Java to get the SHA-1 fingerprint of the certificate. You should get both the release and debug certificate fingerprints. To get the release certificate

Read more

[SOLVED] Unhandled Exception: Navigator operation requested with a context that does not include a Navigator.

This happens because when you do Navigator.of(context), it will start from the widget associated to the context used. And then go upward in the widget tree until it either find a Navigator or there’s no more widget. So, it throws an Error Navigator operation requested with a context that does not include a Navigator. So, how do I fix it ? First, let’s reproduce this error : This example creates a button that attempts to go to ‘/’ on click but

Read more

How to Check if an application is on its first run or One time Intro Screen with Flutter.

If you wish to show the intro screen only for the first time, you will need to save locally that this user has already seen intro. For such thing you may use Shared Preference. There is a flutter package Shared Preferences which you can use. Please refer to the below complete tested code to understand how to use it: You will need to install the package after_layout .

Read more

[SOLVED] Flutter : NoSuchMethodError: The getter ‘isEmpty’ was called on null.

Problem I’m Calling An API and getting response in Variable Data ($data). When data is coming then there is no Error but when I’m getting null as response then getting this error Unhandled Exception: NoSuchMethodError: The getter ‘isEmpty’ was called on null. When I am using the below code then it is throwing me an error: Solution That is because $data returns null, So I’ve Used if(data?.isEmpty ?? true) ? prevents an error if the previous part of the expression results in null and ?? true results in true if the

Read more

[SOLVED] Flutter Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’ – place_picker.

Error /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/rich_suggestion.dart:35:89: Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’. – ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’ (‘/C:/src/flutter/packages/flutter/lib/src/material/text_theme.dart’). Try correcting the name to the name of an existing getter, or defining a getter or field named ‘body1’. TextSpan(text: boldText, style: style.copyWith(color: Theme.of(context).textTheme.body1!.color)), ^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/search_input.dart:60:65: Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’. – ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’ (‘/C:/src/flutter/packages/flutter/lib/src/material/text_theme.dart’). Try correcting the name to the name of an existing getter, or defining a getter or field named ‘body1’. Icon(Icons.search,

Read more

Scaffold class in Flutter with Examples

Scaffold is a class in flutter which provides many widgets or we can say APIs like Drawer, Snack-Bar, Bottom-Navigation-Bar, Floating-Action-Button, App-Bar, etc. Scaffold will expand or occupy the whole device screen. It will occupy the available space. Scaffold will provide a framework to implement the basic material design layout of the application.  The class Hierarchy is as follows: Object ↳ Diagnosticable ↳ Diagnosticable Tree ↳ Widget ↳ StateFul Widget ↳ Scaffold Constructor of the Scaffold class:  Properties of Scaffold Class:   Example: In this example, we have displayed the text Welcome

Read more

Query builder for beginners in Laravel project

Laravel’s database query builder provides a convenient, fluent interface for creating and running database queries. It can be used to perform most database operations in your application and works perfectly with all of Laravel’s supported database systems. The Laravel query builder uses PDO parameter binding to protect your application against SQL injection attacks. There is no need to clean or sanitize strings passed to the query builder as query bindings. Running Database Queries Retrieving All Rows From A Table You

Read more

failed to open stream: Permission denied in /opt/lampp/htdocs

The error message you provided indicates that there is a permission issue preventing the Laravel application from opening and appending to the specified log file. This error commonly occurs when the web server or the user running the web server process does not have sufficient permissions to write to the file. To resolve this issue, you can follow these steps: This command adds write permissions for the owner of the file, which in this case is the web server user.

Read more

type ‘int’ is not a subtype of type ‘string’ in Flutter

The error message you mentioned, “type ‘int’ is not a subtype of type ‘string’ in Flutter,” typically occurs when you try to assign an integer value to a variable or property that expects a string value. To resolve this issue, you need to ensure that you are assigning a string value instead of an integer value where it is expected. Here are a few common scenarios where this error may occur and their potential solutions: Assigning an integer to a

Read more

Retrive data from laravel API to flutter app

To retrieve data from a Laravel API in a Flutter app, you can follow these general steps: Step: 1 Set up your Flutter project: Create a new Flutter project or use an existing one. Step: 2 Add dependencies: Open the pubspec.yaml file in your Flutter project and add the http package as a dependency. This package allows you to make HTTP requests. Run flutter pub get to fetch the package. Step:3 Make HTTP requests: In your Dart file, import the

Read more

How to use a double cupertino switch on one page in flutter

To use a double Cupertino switch on a page in Flutter, you can follow these steps: Step 1: Add the Cupertino package to your pubspec.yaml file: Import the necessary packages in your Dart file: Create a StatefulWidget for your page. This will allow you to maintain the state of the switches: Define the state class _MyPageState and implement it: Use the CupertinoSwitch widget to display the switches. Each switch should have its own boolean value to store the current state

Read more

How to open Page Route in New Tab in Flutter Web

To open a new tab or browser window in a Flutter application, you can make use of the url_launcher package. This package allows you to launch URLs and open them in the default browser on the device. First, make sure you have added the url_launcher package to your pubspec.yaml file: Then, you can use the url_launcher package to open the URL in a new tab or browser window. Here’s an example of how you can achieve this: In this example,

Read more

How To display an “Incorrect email or password” message when the login response is unauthorized in Flutter

To display an “Incorrect email or password” message when the login response is unauthorized in Flutter, you can follow these steps: Step: 1 Create a variable in your login page’s state to hold the error message. For example: Step: 2 In your login function or login button’s onPressed callback, make the login request to the server using an HTTP client, such as http or dio. Handle the response to determine if it is unauthorized. Step: 3 If the login response

Read more

Email Validation In the Flutter

Before sending the user’s input to the server, email validation is the best practice. We should check the email address to see if it is valid or not and display it to the user. For verifying the email address, we can use a regEx pattern, which is a little more complex to construct. Instead of using the regEx pattern, we can use the coolest package in the pub.dev called email_validator to achieve the same result. In this article, we are going to look at

Read more

Creating First Flutter application in Android studio

In this article, we are going to learn about how to create a Flutter application in Android studio. These are the steps to follow. 3. Select Flutter Application as the project type. Then click Next. 4. Configure the application details as shown below and then click NextProject name: Give your application name.It must be written in lower case & contain underscores. For example, Ex: first_flutter_app Flutter SDK path: Verify the Flutter SDK path specifies the SDK’s location (select Install SDK… if the text field is blank). Project location: Give your

Read more

How to order in Laravel high to low, low to high products – by price with this code?

To order products in Laravel by price in either high to low or low to high, you can use the orderBy the method provided by Laravel’s query builder. Here is an example code snippet that you can use to order products in Laravel by price in descending or ascending order: In the above code snippet, we are using Laravel’s DB facade to perform a database query to fetch products from the products table. We are then using the orderBy method

Read more

how password reset in Flutter with API Laravel in Flutter

I am resetting a password in Flutter with an API built with Laravel. This example assumes that you have already set up the necessary endpoints in your Laravel API and that you are using the Flutter http package to make HTTP requests. Flutter code for sending a password reset request: Laravel code for generating a password reset token: Create a controller that will handle the password reset logic. You can use the php artisan make:controller Auth\ForgotPasswordController command to create the

Read more

failed to open stream: Permission denied in /opt/lampp/htdocs

I am using Linux 16.04 & xampp 5.6.30. I am trying to create a simple login program using file with validation but I am facing problem while putting my data into a file named “login.txt”. Error This error is due to file permissions. The php/apache user does not have the permissions to write in the directory. One way of fixing that is to change the mod byte of the directory with the command chmod. You need super permissions to execute this

Read more
1 4 5 6 7 8 9