# Stylize in app messages

If you want to specify fonts and colors of the messages displayed you can use the `themeForMessage` function and provide a theme for the specified message. For each message you can specify the following properties:

* **backgroundColor**: the color of the background
* **titleStyle**: the text style for the title of the message
* **bodyStyle**: the text style for the body of the message
* **closeButtonColor**: the color of the close button
* **closeButtonBackgroundColor**: the background color of the close button
* **button1BackgroundColor**: the background color for the first button
* **button1TextStyle**: the text style for the first button.
* **button2BackgroundColor**: the background color for the second button
* **button2BorderColor**: the border color for the second button
* **button2TextStyle**: the text style for the second button

Example:

```dart
...

    MBManager.shared.plugins = [
      MBMessages(
        themeForMessage: (message) => _themeForMessage(message),
      ),
    ];

...

  MBInAppMessageTheme _themeForMessage(MBInAppMessage message) {
    if (message.style == MBInAppMessageStyle.bannerTop) {
      return MBInAppMessageTheme(
        titleStyle: TextStyle(
          fontWeight: FontWeight.bold,
          color: Colors.blue,
        ),
      );
    } else {
      return MBInAppMessageTheme(
        titleStyle: TextStyle(
          fontWeight: FontWeight.normal,
          color: Colors.red,
        ),
      );
    }
  }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ep.mburger.cloud/flutter-docs/messages/stylize-in-app-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
