How can I change the color of the Alert Box's Input UI Design?

How can I change the color of the Alert Box’s UI / Material Design?

I only want to change the Input Underline Color and the Cursor, not a border.
I want to have a certain color instead of the blue one.

The code of the AlertBox:

return AlertDialog(
                    title: Text(
                      'New ToDo', style: TextStyle(
                      fontSize: 20,
                    ),
                    ),
                    content: TextFormField(
                      controller: _controller,
                      decoration: InputDecoration(
                        hintText: 'Cooking for dinner...'
                      ),
                    ),
                    actions: [
                      FlatButton(
                        child: Text('CANCEL', style: TextStyle(
                          color: Colors.black,
                        ),),
                        onPressed: () {
                          Navigator.pop(context);
                        },
                      ),
                      FlatButton(
                        child: Text('CREATE', style: TextStyle(
                          color: Color(0xFF00E676),
                        ),),
                        onPressed: () {
                          Navigator.pop(context);
                          _addTodo();
                        },
                      )
                    ],
                  ); 

Maybe this :

MaterialApp(
  ...
  theme: ThemeData(
    inputDecorationTheme: InputDecorationTheme(
      focusedBorder: UnderlineInputBorder(
        borderSide: BorderSide(color: Colors.red)
      ),
      enabledBorder: UnderlineInputBorder(
        borderSide: BorderSide(color: Colors.red),
      ),
      border: UnderlineInputBorder(
        borderSide: BorderSide(color: Colors.red),
      ),
    )
  )
)
1 Like

Yeah that works, thanks!

And for the blinking cursor there is probably no way I suppose right?