The lower bound of “sdk: ‘>=2.1.0 <3.0.0′” must be 2.12.0 or higher to enable null safety

You must update your flutter/dart version like this (in your pubspec.yaml): In order to enable null safety, the lower bound of the SDK version should be 2.12.0 or higher. The provided requirement, “sdk: ‘>=2.1.0 <3.0.0′”, does not meet this criteria, as the minimum required version is 2.12.0. To enable null safety, you should update the SDK version to at least 2.12.0. environment: sdk: “>=2.7.0 <3.0.0” You must update your flutter/dart version like this (in your pubspec.yaml): Be prepared to make

Read more

How to add images to the Flutter project

Create an image folder inside an assets folder, create assets if not exist. Flutter Image_directory This should be in your root folder, in that same root directory you will find a pubspec.yaml file , pubspec.yaml your need to make some changes on this file open it in your vscode editor, and change some lines like shown below. To this after this just use your images in your code after including child image function.

Read more

No version of NDK matched the requested version in Flutter>> Solved.

The SHA1 key to integrate firebase in my flutter app.After updating to Android Gradle plugin 3.6.0 (released Feb 24, 2020), several project independently started failing with: and i got this error It’s quite simple to “fix” this locally by installing the older expected ndk version: However, my question is: Where and how is this older version specified? And how do I update it so it matches the latest version 21.0.6113669? After some Research I found the solution.. I am assuming the machine you are using

Read more

Data type conversion in Dart or Flutter project

Convert double to int Convert int to double How to convert List to int type in flutter Dart convert int variable to string use For loop using split to data type convertion Convert double to int To convert a double to int in Dart, we can use one of the built-in methods depending on your need: toInt( ) or truncate( ): these 2 methods are equivalent, they both truncate the fractional/decimal part and return the integer part. round( ): return

Read more

version code 13 has already been used. try another version code in play.google.com/console.

If version code 19 has already been used in your Flutter project, you need to choose a different version code for the next release. The version code is an integer value that is used by Android devices to determine the relative version of an application. To select a new version code, you typically increment the value from the previous version code. Here are a few suggestions for a new version code: If you are currently using version “1.0.1+1.9” in your

Read more

How to fix “Android license status unknown” in Flutter

SOLUTION: None of the above works when setting up a Windows 10 Flutter 1.17.1 environment for mobile development. The quickest and easiest solve is to download android-studio-ide-193.6514223-windows (Android 4.0) from https://developer.android.com/studio/archive. To check the status of your Android licenses and accept them using Flutter, you can run the following command in your terminal: This command will prompt you to review and accept the Android SDK licenses that are required for Flutter development. You will be presented with a list of licenses, and

Read more

Failed to launch Pixel XL API 30: Error: Emulator didn’t connect within 60 seconds

The error message you encountered suggests that there was a problem launching the Pixel XL emulator with API level 30. The emulator failed to establish a connection within the specified time limit of 60 seconds. To troubleshoot this issue, you can try the following steps: By following these steps, you should be able to troubleshoot and resolve the “Failed to launch Pixel XL API 30: Error: Emulator didn’t connect within 60 seconds” issue.

Read more

How to Change Background Color, Size, Border Radius of Elevated Button in Flutter

Previously, there was the provision of property on RaisedButton to change background color, but it is deprecated now. So, you have to use ElevatedButton instead of RaisedButton. On ElevatedButton, there is the provision of style property that is used to style the button. See the example below to know more about it.  To change Background Color, Broder Radius, Border, Elevation, and Padding of Button. Use style property of ElevatedButton and implement ElevatedButton.styleFrom() on it. To change the size of Elevated Button Wrap ElevatedButton() widget with SizedBox() widget to change height

Read more

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
1 2 3 4