flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.18k stars 26.65k forks source link

iOS CupertinoTextField placeholder maxLines styles are not universal #147504

Closed aniealss closed 2 weeks ago

aniealss commented 2 weeks ago

Steps to reproduce

When maxLines is set to 8, the placeholder is displayed in the center instead of the top left corner

Expected results

The placeholder is displayed in the upper left corner

Actual results

image

Code sample

Code sample ```dart import 'package:flutter/cupertino.dart'; /// Flutter code sample for [CupertinoTextField]. void main() => runApp(const CupertinoTextFieldApp()); class CupertinoTextFieldApp extends StatelessWidget { const CupertinoTextFieldApp({super.key}); @override Widget build(BuildContext context) { return const CupertinoApp( theme: CupertinoThemeData(brightness: Brightness.light), home: CupertinoTextFieldExample(), ); } } class CupertinoTextFieldExample extends StatefulWidget { const CupertinoTextFieldExample({super.key}); @override State createState() => _CupertinoTextFieldExampleState(); } class _CupertinoTextFieldExampleState extends State { late TextEditingController _textController; @override void initState() { super.initState(); _textController = TextEditingController(); } @override void dispose() { _textController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar( middle: Text('CupertinoTextField Sample'), ), child: Center( child: CupertinoTextField( controller: _textController, maxLines: 8, placeholder: '123', ), ), ); } } ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here] ![image](https://github.com/flutter/flutter/assets/129574452/aedb26e6-f399-4c71-ab36-b6e390f31edc)

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.19.6, on macOS 14.1.1 23B81 darwin-arm64) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] VS Code (version 1.88.1) ```
darshankawar commented 2 weeks ago

@aniealss I think this is similar to https://github.com/flutter/flutter/issues/138794 so please follow-up in it for further updates. Closing this as duplicate.

github-actions[bot] commented 1 day ago

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.