I want my TextField widget to be elevated like Card or NavigationBar widgets. I'm using Material 3 (You).
I've tried using surface color from colors like:
Theme.of(context).colorScheme.surface
but it appears to be the same color as
Theme.of(context).colorScheme.background
CodePudding user response:
You can wrap your text_form_field widget with Card widget and give it elevation as well as boxShadow. It will work for you.
Card(
child: //Your_text_form_field,
elevation: 10,
decoration: BoxDecoration(
boxShadow: [
new BoxShadow(
color: Colors.red,
blurRadius: 20.0,
),
],
),