Tags
Flutter
Asked 2 years ago
12 Oct 2021
Views 869
Rebekah

Rebekah posted

Flutter : MaterialColor cant be assigned InputBorder


TextField(   decoration: const InputDecoration(
                 fillColor: Colors.grey,filled: true,
                  border: Colors.grey,
                  hintText: 'Enter a search term'),
            )

I am trying to border-color to white, but not sure what goes wrong and it generates an error :
The argument type 'MaterialColor' can't be assigned to the parameter type 'InputBorder?'.

Error: The argument type 'MaterialColor' can't be assigned to the parameter type 'InputBorder?'.
 - 'MaterialColor' is from 'package:flutter/src/material/colors.dart' ('../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/colors.dart').
 - 'InputBorder' is from 'package:flutter/src/material/input_border.dart' ('../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/input_border.dart').
                  border: Colors.grey,


Post Answer