Remove DEBUG ICON on Flutter

In this tutorials, Learn how to get rid of the DEBUG banner in the Flutter app.

For your Flutter mobile application to appear polished and production-ready, the DEBUG banner must be removed.

Important to keep in mind is that this label may mislead consumers into thinking there is a flaw or problem in the programme.

By following the instructions in this guide, you’ll be able to get rid of the DEBUG label in both debug and release modes, giving your application’s users a seamless and polished user experience.

Debug Banner Removal through Programming :

If you wish to hide the banner just in specific areas of your application, you may wrap those areas in the Builder widget and set the debugShowCheckedModeBanner value to false.

This enables you to selectively conceal the banner while working on specific areas of your application without affecting it overall. It’s critical to remember that even if the DEBUG label has been gone, the debug mode is still active and you can still access all of the tools and features that Flutter offers for debugging.

debugShowCheckedModeBanner: false

If you need to activate the banner for some reason in release mode, you can also set the debugShowCheckedModeBanner property to true instead of setting it to false.

To avoid being unprofessional and detracting from the user experience, always remember to hide the banner in release mode.

This code example should make it simple for you to remove the DEBUG label from your Flutter application while still having access to all the required debugging resources.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false, // Set debugShowCheckedModeBanner to false
      title: 'Debug Remove',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Debug Remove App'),
      ),
      body: Center(
        child: Text('Now, Debug Removed'),
      ),
    );
  }
}

I sincerely hope you found this little tutorial on Flutter to be useful. More tutorials may be found on this website in the Flutter category if you’re interested in learning Flutter. Look at it. There may be more tutorials that you prefer.

If you want to learn basic concept then refer this Flutter Basic Concept

Additionally, you may view the flutter tutorials on our website below.

Rounded Corners Image in Flutter

Example of a checkboxlisttile in flutter

Checkbox Example In Flutter

Rounded Corners Image in Flutter

In this tutorial, we’ll look at just one of Flutter’s numerous image display options.

In particular, we will discover how to produce an image with rounded corners, a preferred design feature in contemporary mobile applications.

It’s crucial to realise that Flutter provides a variety of choices for showing images before moving on to the main topic. There are several widget classes available for each use scenario, and you can decide whether to display an image from a local file or a network URL.

In this tutorial, we’ll concentrate on obtaining a picture from a remote URL.

You may use the ClipRRect widget to clip an image with rounded rectangle corners in Flutter to give it rounded corners.

Additionally, you can utilise that widget as a Container to make handling images with height and width simple.

Here is syntax of the ClipRRect widget

ClipRRect(
  borderRadius: BorderRadius.circular(10.0), // Adjust the value to change the corner radius
  child: Image.network(
    'https://example.com/image.jpg', // Replace with your image URL
    width: 200, // Adjust the width as needed
    height: 200, // Adjust the height as needed
    fit: BoxFit.cover,
  ),
)

The borderRadius parameter in Flutter functions precisely the same way it does in CSS, so long as you are familiar with that language.

You can use shorthand notation to set various values for each corner or set the borderRadius to a specified number.

To begin your Dart file, don’t forget to import the required Flutter packages:

import 'package:flutter/material.dart';

Here it is example of that code.

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var title = 'Main App Images';

    return MaterialApp(
      title: title,
      home: Scaffold(
        appBar: AppBar(
          title: Text(title),
        ),
        body: ClipRRect(
          borderRadius: BorderRadius.circular(10),
          child: Image.network(
          'https://example.com/image.jpg', // Replace with your image URL
          fit: BoxFit.cover,
        ),
        ),
      ),
    );
  }
}

The image will have rounded corners when presented by surrounding the Image widget with ClipRRect.

A checkboxlisttile in Flutter

Flutter comes with a built-in widget called CheckboxListTile. We may describe it as a CheckBox and ListTile combo. As with the CheckBox widget, it has attributes like value, activeColor, and checkColor, whereas the ListTile widget has properties like title, subtitle, and contentPadding.

To Google the checkbox, we may tap anywhere on the CheckBoxListTile. All the attributes of this widget are listed below, along with an illustration.

Below is the Checkboxlisttile’s syntax.

CheckboxListTile(
{Key key,
@required bool value,
@required ValueChanged onChanged,
Color activeColor,
Color checkColor,
Widget title,
Widget subtitle,
bool isThreeLine: false,
bool dense,
Widget secondary,
bool selected: false,
ListTileControlAffinity controlAffinity: ListTileControlAffinity.platform,
bool autofocus: false,
EdgeInsetsGeometry contentPadding,
bool tristate: false}
)

Here is the example of CheckBoxListTile. In this illustration, we create a listview with every checkbox. Make a model for that listview as well. It is a checkbox dynamic listing of data.

CheckBoxListTileDemo.dart

class CheckBoxListTileDemo extends StatefulWidget {
  @override
  CheckBoxListTileDemoState createState() => new CheckBoxListTileDemoState();
}

class CheckBoxListTileDemoState extends State<CheckBoxListTileDemo> {
  List<CheckBoxListTileModel> modelCheckBoxListTile =
      CheckBoxListTileModel.getUsers();

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        backgroundColor: Colors.white,
        centerTitle: true,
        title: new Text(
          'CheckBox ListTile Demo App',
          style: TextStyle(color: Colors.black),
        ),
      ),
      body: new ListView.builder(
          itemCount: modelCheckBoxListTile.length,
          itemBuilder: (BuildContext context, int index) {
            return new Card(
              child: new Container(
                padding: new EdgeInsets.all(10.0),
                child: Column(
                  children: <Widget>[
                    new CheckboxListTile(
                        activeColor: Colors.pink[300],
                        dense: true,
                        //font change
                        title: new Text(
                          modelCheckBoxListTile[index].title,
                          style: TextStyle(
                              fontSize: 14,
                              fontWeight: FontWeight.w600,
                              letterSpacing: 0.5),
                        ),
                        value: modelCheckBoxListTile[index].isCheck,
                        secondary: Container(
                          height: 50,
                          width: 50,
                          child: Image.asset(
                            modelCheckBoxListTile[index].img,
                            fit: BoxFit.cover,
                          ),
                        ),
                        onChanged: (bool? val) {
                          setState(() {
                            modelCheckBoxListTile[index].isCheck = val!;
                          });
                        })
                  ],
                ),
              ),
            );
          }),
    );
  }

  void itemChange(bool val, int index) {
    setState(() {
      modelCheckBoxListTile[index].isCheck = val;
    });
  }
}

class CheckBoxListTileModel {
  int userId;
  String img;
  String title;
  bool isCheck;

  CheckBoxListTileModel(
      {required this.userId,
      required this.img,
      required this.title,
      required this.isCheck});

  static List<CheckBoxListTileModel> getUsers() {
    return <CheckBoxListTileModel>[
      CheckBoxListTileModel(
          userId: 1,
          img: 'assets/images/local1.png', // Need to change here Asset Image Name
          title: "JAVA",
          isCheck: true),
      CheckBoxListTileModel(
          userId: 2,
          img: 'assets/images/local2.jpeg', // Need to change here Asset Image Name
          title: "Angular JS",
          isCheck: false),
      CheckBoxListTileModel(
          userId: 3,
          img: 'assets/images/local3.webp', // Need to change here Asset Image Name
          title: "Flutter ",
          isCheck: false),
      CheckBoxListTileModel(
          userId: 4,
          img: 'assets/images/local4.png', // Need to change here Asset Image Name
          title: "Kotlin",
          isCheck: false),
      CheckBoxListTileModel(
          userId: 5,
          img: 'assets/images/local5.png', // Need to change here Asset Image Name
          title: "PHP",
          isCheck: false),
    ];
  }
}

You may have observed that this Checkbox implementation method uses less code. When this code is executed, a list of alternatives with checkboxes is displayed. A checkbox’s state can be changed by tapping on it, and the modelCheckBoxListTile will be modified as a result.

How can I change a Checkbox’s Color?

Using the activeColor and checkColor parameters of the Checkbox widget, Flutter users can alter the colour of a Checkbox.

The checkbox’s colour while it is checked can be changed using the activeColor property, and the checkmark’s colour can be changed using the checkColor property. Here is an illustration of how to apply these attributes:

Checkbox(
  value: true,
  onChanged: (newValue) {
    // Do something
  },
  activeColor: Colors.blue, // Change the color of the checkbox when it is checked
  checkColor: Colors.white, // Change the color of the checkmark inside the checkbox
)

The checkbox’s colour changes to blue when it is checked in the example above since the activeColor attribute is set to Colors.blue. Like this, the checkmark inside the checkbox transforms to white when the checkColor attribute is set to Colors.white.

Checkbox Example In Flutter

Users can choose several alternatives from a list of possibilities by using checkboxes, which are a key component of user interfaces. We will look at creating checkboxes in Flutter and managing state changes in this blog article. All other widgets, including containers, list views, and others, can use checkboxes.

Using Checkbox class properties, we may change the colors, and also listen to the state changes.

Checkbox Demo

Checkbox(  
  value: this.showvalue,   
  onChanged: (bool value) {  
    setState(() {  
      this.showvalue = value;   
    });  
  },
),

Creating a Checkbox

In Flutter, we can utilise the Checkbox widget to construct a checkbox. Let’s begin by configuring a straightforward Flutter application and making a checkbox:

import 'package:flutter/material.dart';

class CheckboxExample extends StatefulWidget {
  @override
  _CheckboxExampleState createState() =&gt; _CheckboxExampleState();
}

class _CheckboxExampleState extends State<checkboxexample> {
  bool _isChecked = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Checkbox Example'),
      ),
      body: Center(
        child: Checkbox(
          value: _isChecked,
          onChanged: (bool newValue) {
            setState(() {
              _isChecked = newValue;
            });
          },
        ),
      ),
    );
  }
}

Checkboxes are essential elements for enabling users.

Container Tutorial with Examples – Flutter

Container classes in flutter are convenient ways to combine common painting, positioning, and sizing of widgets.

A container can be used to store one or more widgets and position them on the screen according to our convenience. Basically, a container is like a box to hold its contents. A basic container element that stores a widget has a margin, which separates it from other contents.

The total container can have a border of different shapes, for example, rounded rectangles, etc. A container surrounds its child with padding and then applies additional constraints to the padded extent (including the width and height)

Syntax of Container Class given below

Container({Key key,
           AlignmentGeometry alignment, 
           EdgeInsetsGeometry padding, 
           Color color, 
           Decoration decoration, 
           Decoration foregroundDecoration, 
           double width, 
           double height, 
           BoxConstraints constraints, 
           EdgeInsetsGeometry margin, 
           Matrix4 transform, 
           Widget child, 
           Clip clipBehavior: Clip.none});

Here’s an example of using the Container class in Flutter:

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Container Example',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Container Example'),
        ),
        body: Center(
          child: Container(
            width: 200,
            height: 200,
            color: Colors.blue,
            padding: EdgeInsets.all(16),
            margin: EdgeInsets.all(16),
            alignment: Alignment.center,
            child: Text(
              'Hello, World!',
              style: TextStyle(
                color: Colors.white,
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ),
      ),
    );
  }
}

The Container class in Flutter provides a flexible and powerful way to manage the layout and appearance of UI elements.

It allows you to control dimensions, alignment, padding, margin, background color, and more. With its wide range of properties and customization options, the Container class is an essential widget for creating attractive and well-structured Flutter UIs.

Flutter Simple AppBar Tutorial with Examples

The Flutter AppBar class is used to create a material design app bar that can display optional actions in the form of IconButtons. This widget is commonly displayed at the top of the screen with a fixed height.

In addition, the Flutter AppBar widget offers several properties that can be customized to enhance the look and functionality of the AppBar. These properties include actions, backgroundColor, primary, and title, among others.

By leveraging these properties, developers can customize their app bars to create a unique and visually appealing user interface. For example, they can add buttons to the app bar that perform certain actions, set a specific background color to match the overall theme of the app, and determine whether the app bar should be the primary focus of the screen.

Syntax :

AppBar(
   title: /some title/,
   actions: [
     //array of widgets that take some actions
   ],
 ),

In this Flutter application, we will create a basic user interface consisting of an AppBar and a Scaffold. The AppBar will display a simple title, which we will set to “AppBar Tutorial”. This will provide a clear and concise heading for the user and make it easier for them to understand the purpose of the application. The Scaffold will serve as the primary container for our application, providing a convenient layout for the app’s content. By using these two widgets in conjunction, we can create a clean and user-friendly interface for our Flutter application.