Posts by Devsheet

Read all articles posted by Devsheet programmers and content writers.

Outlined Button Styling in Flutter

In this post, we are going to explain different methods that can be used to style an Outlined Button in Flutter.

Splash screen icon and color in Flutter

In this code example, we are going to show how you can change or add icon and color to the launcher or splash screen in Flutter.

Flutter - Check if Index exist in a List

In this code example, we are going to check if a given index exists in a Flutter List or not. We will be using different methods in order to do that.

How to convert String to Int in Flutter

To convert a string to an integer in Flutter, you can use the int.parse() method or the int.tryParse() method.

Flutter - Trim a String

In Flutter, you can trim a string using the trim() method provided by the Dart programming language. The trim() method removes any leading and trailing whitespace characters from the string.

Flutter - ScrollController not attached to any scroll views

If you are getting error - ScrollController not attached to any scroll views in your Flutter project then you can you can add the check for _scrollController.hasClients before using ScrollController.

TextField Widget Padding in Flutter

In Flutter, if you want to add padding in the TextField Widget you can use the contentPadding property. You can assign EdgeInserts to it to add a padding.

Remove Back Button from Flutter Appbar

In Flutter, the AppBar widget provides a default back button that allows the user to navigate back to the previous screen. However, there may be cases where you don't want to show this back button.

Create Alert Dialog in Flutter

An Alert Dialog in Flutter is a modal dialog box that displays important information to the user and requires their acknowledgment before they can proceed with other actions in the app. It's commonly used to show error messages, confirmations, or to get user input.

Error - Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

If you are getting the above error while building your Flutter project then you can the below commands to remove the error.

Flutter run app in release mode

To run a Flutter app in release mode, you can use the command flutter run --release in the terminal while in the root directory of your app. This will build and run the app in release mode, which is optimized for performance and is typically used for distribution to end users.

Flutter Container Widget

In Flutter, the Container widget is a box that can contain other widgets. It allows you to apply visual styling to the contained widgets, such as padding, background color, and borders.

Set height and width of Button in Flutter

If you're creating a button in Flutter, you may want to know how to set the height and width. This can be done in a few different ways, and we'll cover them here. First, you can use the SizedBox widget to set specific dimensions, or you can use the ConstrainedBox widget to set constraints on the button's size.

Create rounded border button in Flutter

We can create a button with a rounded border using the OutlinedButton widget in Flutter.

Ternary Conditional operator in Flutter(Dart)

One of the best features of the Flutter framework is its support for the ternary conditional operator. This operator allows you to concisely express if-else logic in your Flutter code. In this article, we'll take a look at how to use the ternary conditional operator in Flutter.

Set width and height of a button in Flutter

You can use the code examples explained in this post to set the width and height of a button widget in Flutter.

Round Container with Image in Flutter

This tutorial will show you how to create a round container with an image in Flutter. This is a great way to display a user profile image or list item images.

Define Int type value in class Flutter

In computer programming, an integer is a data type that represents mathematical integers. In the Dart programming language, the int type represents a 64-bit signed integer. This means that it can represent values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Pass Data to Stateless Widget in Flutter

In flutter, Stateless widgets are those widgets that don’t require any change in their state. They are immutable. In order to pass data to a stateless widget, we have to use a constructor. The constructor accepts the data as a parameter and we can use that data in our widget.

How to remove debug banner in Flutter app

The debug banner is a visual indicator that appears in the top right corner of the screen when running a debug build of a Flutter app. While the debug banner can be helpful when developing and debugging an app, it can be annoying when running a release build of the app. This article will show you how to remove the debug banner in a Flutter app.

Prevent device rotation in Flutter

If you've ever used an app on your phone and rotated your device, only to have the app rotate with it, then you know how annoying it can be. Luckily, there is a way to prevent this from happening in Flutter. By using the following code, you can ensure that your app will remain in the orientation that you originally intended it to be in.

Dismiss the mobile screen keyboard in Flutter

The mobile screen keyboard is necessary for many users who need to type on their phone or tablet. However, there are times when the keyboard is just in the way and needs to be dismissed. This can be accomplished in Flutter by using the FocusManager.

Send Form Data in HTTP POST request in Flutter

If you want to send form data in HTTP post request in Flutter or Dart, you can use map and add data to it and pass the map variable to the body parameter of http.post() function.

Send HTTP POST request in Flutter or Dart

If you want to send an HTTP Post request in Flutter or Dart, you can use the code examples explained in this post.

Send HTTP Get request in Flutter or Dart

In this post, we are listing some code examples that can be helpful in sending HTTP Get requests in Flutter or Dart. We use the http package of Dart to send requests.

Send a Map in query parameter of http request in Flutter

To send Map data in query parameters of an HTTP request in Dart or Flutter, you can use the code examples explained here.

Find number of days between two dates in Flutter or Dart

If you are using dates in your dart program and want to get the difference between them in terms of the number of days then you can use the methods explained in this post.

Get current timestamp in flutter or dart

To get the current timestamp in Flutter or dart you can use DateTime.now().millisecondsSinceEpoch.

Center the title in appbar flutter

This code snippet shows how to center a title in appbar. We can use centerTitle property of appBar to do this.

Full width Container in Flutter

If you are building an app for the first time and wondered how to set up a full-width Container with Flutter, then these code examples are for you.

Assign width in percentage to flutter container

We will assign the width in percentage to the Flutter container and make it fluid. This ensures that, no matter what device you’re on, Flutter doesn’t take up more than its fair share of space and the app is easy to use and fast at all times.

String to double conversion in flutter [Dart]

To convert a string to double type in flutter or dart, you can use double.parse() method.

Create 10 container widgets using loop flutter

We can create a list of widgets using for loop in flutter. You can check the below example for that where we are creating 10 container widgets.

Convert a double to an int in Dart or Flutter

to convert a double value to int value you can use .toInt() method.

Add some delay before executing the code in Flutter

If you want to add some delay or want to execute your code after a fixed time you can use Future.delayed in Flutter.

Add launcher or mobile app icon in Fluter

To change default flutter app icons you can use the flutter_launcher_icons package. It will generate and replace default flutter icons of your mobile app.

Change mobile app name in Flutter

If you want to change the app name in flutter you can change that for android and ios separately.

Change click action of left AppBar icon in Flutter

You can change the click action of the left icon in the Flutter AppBar using the leading property of AppBar.

Convert text of Text widget to uppercase or lowercase in Flutter

You can use string methods of toUpperCase() and toLowerCase() to transform Text Widget text.

Add spacing between characters of Text widget Flutter

To add space between characters of words that exist inside a Text widget - the letterSpacing property can be used.

Loading more...
Search all posts...