-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14Found to occur in 3.14has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamOwned by Design Languages team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
I want to set TextField default collapsed in ThemeData. However, setting InputDecorationTheme.isCollapsed doesn't work. However, InputDecoration.isCollapsed is working.
Expected results
The TextField should be collapsed when InputDecorationTheme.isCollapsed is set to true.
Actual results
The TextField is not collapsed when InputDecorationTheme.isCollapsed is set to true.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
inputDecorationTheme: const InputDecorationTheme(
isCollapsed: true, // This doesn't work
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(4)),
),
),
),
home: const Scaffold(
body: Center(
child: SizedBox(
width: 200,
child: TextField(
decoration: InputDecoration(
// isCollapsed: true, // <-- This works
hintText: 'Hello, Flutter!',
),
),
),
),
),
);
}
}Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
[Paste your output here]Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14Found to occur in 3.14has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamOwned by Design Languages team