Question: [The argument type 'String?' can't be assigned to the parameter type 'String](https://i.stack.imgur.com/dLh9s.png)

code is here.kindly please solve my problem sir

```
 class IconContent extends StatelessWidget {
      IconContent({this.icon,this.label});
      final IconData? icon;
       final String? label;
      @override
      Widget build(BuildContext context) {
        return Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Icon(
              icon,
              size: 80.0,
            ),
            SizedBox(
             height: 15.0,
            ),
            Text(
              label,
              style: TextStyle(
                fontSize: 18.0,
                color: Color(0xFFB2B58E),
              ),
            )
          ],
        );
      }
    }

```

Answer: 
`String?` is a `nullable String` which is not equal to `String`

More about `null-safety`: <https://dart.dev/null-safety>

Change,

```dart
IconContent({this.icon,this.label});
      final IconData? icon;
       final String? label;

```

To,

```dart
IconContent({this.icon, required this.label});
      final IconData? icon;
       final String label;

```

Or,

Change,

```dart
Text(
              label,
              style: TextStyle(
                fontSize: 18.0,
                color: Color(0xFFB2B58E),
              ),
            )

```

To,

```dart
if(label != null)
    Text(
        label!,
        style: TextStyle(
            fontSize: 18.0,
            color: Color(0xFFB2B58E),
        ),
    )

```

`!` indicates the `label` is not null. Make sure the `label` is never null if you use `!`

Or,

```dart
Text(
              label ?? 'default label incase label is null',
              style: TextStyle(
                fontSize: 18.0,
                color: Color(0xFFB2B58E),
              ),
            )

```
[`Text`](https://api.flutter.dev/flutter/widgets/Text/Text.html) widget doesn't take null value and in your snippet `label` is defined as nullable `final String? label`. It is possible to have `null` for `label` which violet the `Text` widget requirement.

```dart
const Text(
  String this.data, {
....})

```

@NirmalCode answer is ok, but I'm explaining to it why you need it.

You can provide default value while it will be null like
`Text(label ?? 'default',)`

Or avoid rendering while `label` is null.

`if(label!=null) Text(label!)`

As you can see, I'm using bang`!` operator when I'm sure it will never get `null`. And you can also do it directly when you are certain about not getting `null`. I would say, in that case, don't make nullable `label`.

More about [null-safety](https://dart.dev/null-safety)