Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

544
Views
¿Cómo puedo configurar el comportamiento de uso automático de mayúsculas en los campos de entrada de texto de Flutter?

Estoy experimentando con el desarrollo de Flutter en Windows. Tengo una aplicación de prueba simple con un InputField. Me gustaría que la primera entrada del teclado fuera una letra mayúscula, pero no puedo ver una forma de lograrlo (por ejemplo, iniciar el teclado con shift presionado) en este momento. ¿Algunas ideas?

El código (un poco simplificado) es:

 import 'package:flutter/material.dart'; void main() { runApp(new MaterialApp( theme: new ThemeData.dark(), home: new MainScreen() )); } class MainScreen extends StatelessWidget { @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( leading: new IconButton( icon: new Icon(Icons.menu), tooltip: 'Navigation menu', onPressed: null, ), title: new Text('Test'), ), body: new NewTest(), ); } } /// Widget class NewTest extends StatefulWidget { @override _NewTestInputState createState() => new _NewTestInputState(); } /// State class _NewTestInputState extends State<NewTest> { InputValue _currentInput; void _handleInputChange(InputValue input) { if (input != _currentInput){ setState(() { _currentInput = input; }); } } void _handleInputSubmitted(InputValue input) { setState(() { _currentInput = const InputValue(); }); } @override Widget build(BuildContext context) { InputField _widget = new InputField( value: _currentInput, hintText: 'Enter text', keyboardType: TextInputType.text, autofocus: true, onChanged: _handleInputChange, onSubmitted: _handleInputSubmitted, style: new TextStyle(fontSize: 20.0), ); Container _container = new Container( child: _widget, decoration: new BoxDecoration( border: new Border.all( color: Colors.green[300], width: 2.0, ), ), padding: new EdgeInsets.all(16.0), ); return _container; } }
about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Flutter tiene una propiedad textCapitalization para campos de texto. Establezca esta propiedad en TextCapitalization.sentences o cualquiera de los valores disponibles, por ejemplo, .characters o .words Así:

 TextField( keyboardType: TextInputType.text, **textCapitalization: TextCapitalization.sentences,** style: TextStyle( fontSize: 30.0, color: Colors.black, fontWeight: FontWeight.bold ), )
about 4 years ago · Santiago Trujillo Report

0

El inicio en minúsculas fue un error en nuestra implementación de iOS de la envoltura de teclado de Flutter, ¡que ya se ha solucionado a partir de hoy!

Presenté un error para hacer esto configurable (para que pueda deshabilitar el comportamiento de las oraciones con mayúsculas automáticas) aquí: https://github.com/flutter/flutter/issues/9363

No dude en comunicarse si esto no resuelve su problema.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!