Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text overflowing in physical Android device #19

Open
yuriescl opened this issue Apr 10, 2021 · 5 comments
Open

Text overflowing in physical Android device #19

yuriescl opened this issue Apr 10, 2021 · 5 comments
Labels
wontfix This will not be worked on

Comments

@yuriescl
Copy link

yuriescl commented Apr 10, 2021

This code makes the text overflow the widget in physical Android devices:

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:auto_size_text_field/auto_size_text_field.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _inputController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    _inputController.text = 'test';
    return Scaffold(
        body: Container(
            alignment: Alignment.center,
            width: double.maxFinite,
            child: AutoSizeTextField(
              controller: _inputController,
              maxLines: 1,
              decoration: InputDecoration(
                border: InputBorder.none,
                contentPadding: EdgeInsets.all(0),
                hintText: '0',
              ),
              keyboardType: TextInputType.numberWithOptions(decimal: true),
              textAlignVertical: TextAlignVertical.center,
              style: TextStyle(color: Color(0xff1c278e), fontSize: 55),
              textAlign: TextAlign.left,
            )));
  }
}

Screenshot of physical Android screen (Android 10) running the above code:
Screenshot_20210410-014315

The same code works in Android Emulator (tested on Pixel 4 XL API 28), there's no overflow there:
2021-04-10_01-40

Version tested:
auto_size_text_field: ^0.1.7

$ flutter doctor -v
[✓] Flutter (Channel beta, 2.1.0-12.2.pre, on Linux, locale en_US.UTF-8)
    • Flutter version 2.1.0-12.2.pre at /home/yuri/Programs/flutter
    • Framework revision 5bedb7b1d5 (3 weeks ago), 2021-03-17 17:06:30 -0700
    • Engine revision 711ab3fda0
    • Dart version 2.13.0 (build 2.13.0-116.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/yuri/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /home/yuri/Android/Sdk
    • Java binary at:
      /home/yuri/Programs/android-studio-ide-201.7042882-linux/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /home/yuri/Programs/android-studio-ide-201.7042882-linux
    • Flutter plugin version 55.0.1
    • Dart plugin version 201.9335
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.52.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.20.0
@MisaGu
Copy link

MisaGu commented May 24, 2021

i have similar problem - the plugin doesn't account for cursor width and contentPadding paraps and so part of a content hidden ( overflow | runs out of the view bounady ) . . . 😥

value: 123
image
-- the space on the right is 10px cursor ( it will look the the same if padding is provided)

@lzhuor
Copy link
Owner

lzhuor commented Aug 18, 2021

@yuriescl @MisaGu May I ask was the text configured to scale in the Android settings on the physical device? Thank you!

@yuriescl
Copy link
Author

@lzhuor If you mean accessibility scale, it's disabled and the size is at the default (middle):

photo4974714113783605667

The system font settings are also in default:

photo4974714113783605668

@antb123
Copy link

antb123 commented Aug 27, 2021

I also get this issue running the code on a stock Huawei P30 lite with a flutter based app...

@lzhuor
Copy link
Owner

lzhuor commented Dec 15, 2021

Hi @antb123 and @yuriescl may I ask did you manage to figure out the root cause? Could you please also try auto_size_text package and see if it works for displaying static texts?

Repository owner deleted a comment from rayhansumon121 Feb 23, 2024
@lzhuor lzhuor added the wontfix This will not be worked on label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants
@MisaGu @lzhuor @antb123 @yuriescl and others