Question: I have like this code to build youtube player thumbnail with icon:

```
Stack(
  children: <Widget>[
    Container(
      decoration: BoxDecoration(
        image: DecorationImage(
            image: NetworkImage(
                "https://img.youtube.com/vi/_uOgXpEHNbc/0.jpg"),
            fit: BoxFit.fitHeight),
      ),
    ),
    Container(
      color: Colors.black.withOpacity(0.7),
    ),
    Container(
      alignment: Alignment.center,
      child: Center(
        child: Icon(
          Icons.smart_display,
          color: Colors.red,
          size: 100.0,
        ),
      ),
    ),
  ],
),

```

This is result of code:

[![enter image description here](https://i.stack.imgur.com/KXLYS.png)](https://i.stack.imgur.com/KXLYS.png)

How to make sure that the transparent background of the picture does not affect the central icon? I just need the icon to stay light.

Answer: 
You can add a `catch` block to get errors thrown by the promise:

```js
this.myPromise.then(async (module: any) => {
module.myMethod();
 // ...other methods and logic
 }).catch(error => {alert(error)});

```
Try to use this syntax :

```
const myPromise = new Promise((resolve, reject) => {
  const test = true;
  test? 
       resolve(test):  //resolve it return the good value
       reject('Error'); //reject return the error
});

```