⚡️ Simplify test new features in Flutter app with debug_friend
Tags: flutter, dart, ios, android
Published: 2022-02-12 17:28:30

When we are working on a large product, development is carried out in teams. We divide the work into sprints, weeks, functions and periods. Recently, I began to notice such a situation. The first developer deals with the UI part of the new functionality. The second developer writes the logic for this.

![dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e91fjg6zhaym2xdgvoh1.png)

In general, everything is fine in this example. Everyone goes about their business and does not touch their friend. But sometimes the developer dealing with the UI part does not have time to do something by the right time. A logic guy can write unit tests for his code. But he will not be able to call this logic from the application without any crutches.

![teamwork](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z2tbdwp0e5t60d7306c2.png)

I came up with a solution to this problem. Now the developer will be able to call new features from the auxiliary menu. I called this menu **DebugFriend**.

**Let's dive a little deeper.**
The menu presented in this package now has 4 screens:
- Device Info
- App data
- Debug actions
- Custom actions  

**More information about each of them:**

![screens](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezqr0k8woh5nrexutc45.png)

**Device Info**
On this screen, you can view information about the device on which your application is running.

**App data**
On this screen, you can view and manage all the cache data of your application (stored in the root directory of your application )

**Debug actions**
This screen allows you to interact with the Flutter Inspector features directly from the application. In addition, there are several more custom actions. An example is exiting the application.

**Custom actions**
A list of features of your application. You can test them right here. This is a reference to the problem that I described above.

**Quickstart**

If you have read up to this point, then it's time to find out how to use this package in your code.
First of all, [install this package](https://github.com/Frezyx/debug_friend) in your application 

Wrap your **MaterialApp**'s home or builder widget in a **DebugFriendView**.
Like this:
```dart
import 'package:debug_friend/debug_friend.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: DebugFriendView(
        builder: (context) {
          return const Scaffold(
            body: Text('Your app home widget'),
          );
        },
      ),
    ),
  );
}
```
After that, you will see a button to open the debug menu

By default, **you will not see the debug menu and the debug button in the release build**. But if you suddenly want to change this, change the value of the enabled boolean field to the one you want. For more information about the package, see the [github documentation](https://github.com/Frezyx/debug_friend/blob/main/lib/src/widgets/debug_friend_view.dart).

In the end, I would like to say that I already use this package on several of my work projects. I will support and develop it in the near future. If it’s not difficult for you, **put star on [Github](https://github.com/Frezyx/debug_friend)** and participate in the development, if you want.

**I wish you productive work ❤️!**