The TextField widget doesn't seem to have a "limit" attribute to limit the number of characters that can be typed. How I can enforce that only a certain number of characters can be provided as input in a TextField Widget. I tried looking at the decoration property and potentially setting the limit there somehow but that didn't seem to work either. Is there a different widget I should be using?
Use inputFormatters property
example:
TextFormField(
inputFormatters: [
LengthLimitingTextInputFormatter(10),
]
)
namespace
import 'package:flutter/services.dart';