Skip to content

InputDecorationTheme.isCollapsed doesn't seem to work #133144

Description

@akshdeep-singh

Is there an existing issue for this?

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]

Activity

  1. dam-ease commented on Aug 23, 2023

    @dam-ease

    Hi @akshdeep-singh. Thanks for filing this issue. I am able to reproduce this on the latest master and stable channels.

    stable, master flutter doctor -v

    [✓] Flutter (Channel stable, 3.13.0, on macOS 13.0 22A380 darwin-arm64, locale
        en-NG)
        • Flutter version 3.13.0 on channel stable at
          /Users/damilolaalimi/sdks/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision efbf63d9c6 (7 days ago), 2023-08-15 21:05:06 -0500
        • Engine revision 1ac611c64e
        • Dart version 3.1.0
        • DevTools version 2.25.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/damilolaalimi/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          17.0.6+0-17.0.6b802.4-9586694)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14E300c
        • CocoaPods version 1.12.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build
          17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.81.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.50.0
    
    [✓] Connected device (4 available)
        • Damilola’s iPhone (mobile) • 71c843fa5f3dec767999f36224653c0faa78660e •
          ios            • iOS 16.6 20G75
        • iPhone 8 (mobile)          • 218697C0-911E-4F4E-9568-C387ACB184ED     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-arm64   • macOS 13.0 22A380 darwin-arm64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 116.0.5845.110
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    
    [✓] Flutter (Channel master, 3.14.0-9.0.pre.27, on macOS 13.0 22A380 darwin-arm64, locale en-NG)
        • Flutter version 3.14.0-9.0.pre.27 on channel master at /Users/damilolaalimi/fvm/versions/master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision e085e613c8 (25 hours ago), 2023-08-22 02:58:24 -0400
        • Engine revision e183e8a940
        • Dart version 3.2.0 (build 3.2.0-94.0.dev)
        • DevTools version 2.26.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/damilolaalimi/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14E300c
        • CocoaPods version 1.12.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.81.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.50.0
    
    [✓] Connected device (4 available)
        • Damilola’s iPhone (mobile) • 71c843fa5f3dec767999f36224653c0faa78660e • ios            • iOS 16.6 20G75
        • iPhone 8 (mobile)          • 218697C0-911E-4F4E-9568-C387ACB184ED     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
        • macOS (desktop)            • macos                                    • darwin-arm64   • macOS 13.0 22A380 darwin-arm64
        • Chrome (web)               • chrome                                   • web-javascript • Google Chrome 116.0.5845.110
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    

  2. added
    a: text inputEntering text in a text field or keyboard related problems
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 23, 2023
  3. added a commit that references this issue on Aug 23, 2023
    d08ea0b
  4. opxdelwin commented on Aug 24, 2023

    @opxdelwin
    Contributor

    @dam-ease please do look through the PR

  5. added a commit that references this issue on Aug 31, 2023
    dd1ee24
  6. github-actions commented on Sep 14, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsfound in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesteam-designOwned by Design Languages team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions