Giter Site home page Giter Site logo

simc / auto_size_text Goto Github PK

View Code? Open in Web Editor NEW
2.0K 25.0 231.0 5.94 MB

Flutter widget that automatically resizes text to fit perfectly within its bounds.

Home Page: https://pub.dev/packages/auto_size_text

License: MIT License

Dart 100.00%
flutter ios android text

auto_size_text's Introduction

AutoSizeText

GitHub Workflow Status codecov Version GitHub license

Flutter widget that automatically resizes text to fit perfectly within its bounds.

Show some ❤️ and star the repo to support the project

Resources:

Also check out the blazing fast key-value store hive.

Contents

Usage

AutoSizeText behaves exactly like a Text. The only difference is that it resizes text to fit within its bounds.

AutoSizeText(
  'The text to display',
  style: TextStyle(fontSize: 20),
  maxLines: 2,
)

Note: AutoSizeText needs bounded constraints to resize the text. More info here.

maxLines

The maxLines parameter works like you are used to with the Text widget. If there is no maxLines parameter specified, the AutoSizeText only fits the text according to the available width and height.

AutoSizeText(
  'A really long String',
  style: TextStyle(fontSize: 30),
  maxLines: 2,
)

Sample above

minFontSize & maxFontSize

The AutoSizeText starts with TextStyle.fontSize. It measures the resulting text and rescales it to fit within its bonds. You can however set the allowed range of the resulting font size.

With minFontSize you can specify the smallest possible font size. If the text still doesn't fit, it will be handled according to overflow. The default minFontSize is 12.

maxFontSize sets the largest possible font size. This is useful if the TextStyle inherits the font size and you want to constrain it.

AutoSizeText(
  'A really long String',
  style: TextStyle(fontSize: 30),
  minFontSize: 18,
  maxLines: 4,
  overflow: TextOverflow.ellipsis,
)

group

You can synchronize the font size of multiple AutoSizeText. They will fit their boundaries and all AutoSizeText in the same group have the same size. That means they adjust their font size to the group member with the smallest effective font size.

Note: If a AutoSizeText cannot adjust because of constraints like minFontSize, it won't have the same size as the other group members.

An instance of AutoSizeGroup represents one group. Pass this instance to all AutoSizeText you want to add to that group. You don't have to care about disposing the group if it is no longer needed.

Important: Please don't pass a new instance of AutoSizeGroup every build. In other words, save the AutoSizeGroup instance in a StatefulWidget, or use AutoSizeGroupBuilder.

var myGroup = AutoSizeGroup();

AutoSizeText(
  'Text 1',
  group: myGroup,
);

AutoSizeText(
  'Text 2',
  group: myGroup,
);

stepGranularity

The AutoSizeText will try each font size, starting with TextStyle.fontSize until the text fits within its bounds.
stepGranularity specifies how much the font size is decreased each step. Usually, this value should not be below 1 for best performance.

AutoSizeText(
  'A really long String',
  style: TextStyle(fontSize: 40),
  minFontSize: 10,
  stepGranularity: 10,
  maxLines: 4,
  overflow: TextOverflow.ellipsis,
)

presetFontSizes

If you want to allow only specific font sizes, you can set them with presetFontSizes. If presetFontSizes is set, minFontSize, maxFontSize and stepGranularity will be ignored.

AutoSizeText(
  'A really long String',
  presetFontSizes: [40, 20, 14],
  maxLines: 4,
)

overflowReplacement

If the text is overflowing and does not fit its bounds, this widget is displayed instead. This can be useful to prevent text being too small to read.

AutoSizeText(
  'A String tool long to display without extreme scaling or overflow.',
  maxLines: 1,
  overflowReplacement: Text('Sorry String too long'),
)

Rich Text

You can also use Rich Text (like different text styles or links) with AutoSizeText. Just use the AutoSizeText.rich() constructor (which works exactly like the Text.rich() constructor).

The only thing you have to be aware of is how the font size calculation works: The fontSize in the style parameter of AutoSizeText (or the inherited fontSize if none is set) is used as reference.

For example:

AutoSizeText.rich(
  TextSpan(text: 'A really long String'),
  style: TextStyle(fontSize: 20),
  minFontSize: 5,
)

The text will be at least 1/4 of its original size (5 / 20 = 1/4).
But it does not mean that all TextSpans have at least font size 5.

Parameters

Parameter Description
key* Controls how one widget replaces another widget in the tree.
textKey Sets the key for the resulting Text widget
style* If non-null, the style to use for this text
minFontSize The minimum text size constraint to be used when auto-sizing text.
Is being ignored if presetFontSizes is set.
maxFontSize The maximum text size constraint to be used when auto-sizing text.
Is being ignored if presetFontSizes is set.
stepGranularity The step size in which the font size is being adapted to constraints.
presetFontSizes Predefines all the possible font sizes.
Important: presetFontSizes have to be in descending order.
group Synchronizes the size of multiple AutoSizeTexts
textAlign* How the text should be aligned horizontally.
textDirection* The directionality of the text. This decides how textAlign values like TextAlign.start and TextAlign.end are interpreted.
locale* Used to select a font when the same Unicode character can be rendered differently, depending on the locale.
softWrap* Whether the text should break at soft line breaks.
wrapWords Whether words which don't fit in one line should be wrapped. Defaults to true to behave like Text.
overflow* How visual overflow should be handled.
overflowReplacement If the text is overflowing and does not fit its bounds, this widget is displayed instead.
textScaleFactor* The number of font pixels for each logical pixel. Also affects minFontSize, maxFontSize and presetFontSizes.
maxLines An optional maximum number of lines for the text to span.
semanticsLabel* An alternative semantics label for this text.

Parameters marked with * behave exactly the same as in Text

Performance

AutoSizeText is really fast. In fact, you can replace all your Text widgets with AutoSizeText.
Nevertheless you should not use an unreasonable high fontSize in your TextStyle. E.g. don't set the fontSize to 1000 if you know, that the text will never be larger than 30.

If your font size has a very large range, consider increasing stepGranularity.

Troubleshooting

Missing bounds

If AutoSizeText overflows or does not resize the text, you should check if it has constrained width and height.

Wrong code:

Row(
  children: <Widget>[
    AutoSizeText(
      'Here is a very long text, which should be resized',
      maxLines: 1,
    ),
  ],
)

Because Row and other widgets like Container, Column or ListView do not constrain their children, the text will overflow.
You can fix this by constraining the AutoSizeText. Wrap it with Expanded in case of Row and Column or use a SizedBox or another widget with fixed width (and height).

Correct code:

Row(
  children: <Widget>[
    Expanded( // Constrains AutoSizeText to the width of the Row
      child: AutoSizeText(
        'Here is a very long text, which should be resized',
        maxLines: 1,
      )
    ),
  ],
)
}

Further explanation can be found here. If you still have problems, please open an issue.

MinFontSize too large

AutoSizeText does not resize text below the minFontSize which defaults to 12. This can happen very easily if you use AutoSizeText.rich():

Wrong code:

AutoSizeText.rich(
  TextSpan(
    text: 'Text that will not be resized correctly in some cases',
    style: TextStyle(fontSize: 200),
  ),
)

This rich text does not have a style so it will fall back to the default style (probably fontSize = 14). It has an implicit minFontSize of 12 that means it can be resized to 86% of its original size at the most (14 -> 12). Just set minFontSize = 0 or add style: TextStyle(fontSize: 200) to the AutoSizeText.

Note: If you use the first option, you should also consider lowering stepGranularity. Otherwise the steps of resizing will be very large.

Correct code:

AutoSizeText.rich(
  TextSpan(
    text: 'Text that will be resized correctly',
    style: TextStyle(fontSize: 200),
  ),
  minFontSize: 0,
  stepGranularity: 0.1,
)

MIT License

Copyright (c) 2018 Simon Leier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

auto_size_text's People

Contributors

kavantix avatar kentcb avatar leisim avatar nohli avatar pdblasi-google avatar ravenblackx avatar simc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto_size_text's Issues

Text flickering

Steps to Reproduce
The bug is caused by the inability to set a text size, when two AutoSizeText with the same AutoSizeTextGroup with certain parameters (as in sample code) are horizontally next to each other. Depending on the screen size, this results in a sort of text size flickering (in reality this flickering is much much faster, but the GIF has a low FPS).

The sample code is an app, to reproduce the bug just run it.

As mentioned above, to reproduce the bug on a specific screen size, the text length of the longest line in one of the AutoSizeTexts may need to be changed.

Code sample

import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @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> {

  AutoSizeGroup group;

  @override
  void initState() {
    group = AutoSizeGroup();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Expanded(
                child: Card(
                    child: AutoSizeText(
                      'You have\npushed the\nbutton this\nmanyn times:aa',
                      group: group,
                      style: TextStyle(fontSize: 50),
                      maxLines: 4,
                    )
                )
            ),
            Card(
                child: AutoSizeText(
                    'Abd Abd\nAbd Abd\nAbd Abd\nAbd Abd',
                    group: group,
                  style: TextStyle(fontSize: 50),
                  maxLines: 4,
                )
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots
Peek 2020-01-22 00-06

Version

  • Flutter version: 1.12.13+hotfix.5
  • auto_size_text version: 2.1.0

Incorrect styling when using a theme switching toggle

I'm writing an app for my workplace that has a light theme/dark theme toggle switch in a scaffold drawer. I've wrapped most of the text in the app with this widget for string length differences when localizing to other languages. Its been very helpful, but I'm finding that when i use the theme toggle the text colors aren't changing correctly. When loading a page in the app, the text is correctly contrasting against the background (black text on white BG and white text on grey BG) but once the theme toggle is activated the text then matches the background (black text on grey BG and white text on white BG). For reference, I've tried using this widget with two different theme toggling examples I've found online as a way to check if my implementation was causing the issue but its consistent with both of them. The two examples I used can be found at the following github repos

https://github.com/jorgecoca/theme_switcher/tree/theme-switcher-tutorial-1
https://github.com/iampawan/Flutter-Dynamic-Theming

if i need to provide anymore information, please let me know.

AutoSize TextField

Hello,
Thanks for your AutoSizeText, it works really well.
Is it possible to have the same auto sizing feature for a TextField.
The Textfield would adjust the fontsize based on the input.
It would be really nice.

Use of `AutoSizeText.group` leads to assertion failure when running widget tests

Steps to Reproduce
Please tell me exactly how to reproduce the problem you are running into.

  1. Use an AutoSizeText
  2. Make sure it has group set to a non-null value
  3. Use the widget from a widget test

On tear-down you'll see:

Repro - failing:

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
A Timer is still pending even after the widget tree was disposed.
'package:flutter_test/src/binding.dart':
Failed assertion: line 1056 pos 7: '_currentFakeAsync.nonPeriodicTimerCount == 0'

Code sample

void main() {
  testWidgets('Repro - working', (tester) async {
    final widget = MaterialApp(
      home: AutoSizeText('whatever'),
    );
    await tester.pumpWidget(widget);
  });

  testWidgets('Repro - failing', (tester) async {
    final widget = MaterialApp(
      home: AutoSizeText(
        'whatever',
        group: AutoSizeGroup(),
      ),
    );
    await tester.pumpWidget(widget);
  });
}

Version

  • Flutter version: 1.7.8+hotfix.4
  • auto_size_text version: 2.1.0

Does not work inside an IntrinsicHeight and row

Hi!

Steps to Reproduce
Create a listview and add an item that looks like the following code block from here https://stackoverflow.com/a/51157072/8213910

Here is a minimal example

class ExampleWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView.builder(
        itemCount: 3,
        itemBuilder: (context, _) {
          return Card(
            child: IntrinsicHeight(
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  Container(
                    height: 40,
                    width: 20.0,
                    color: Colors.amber,
                  ),
                  Expanded(
                    child: AutoSizeText('hello'),
                  ),
                ],
              ),
            ),
          );
        },
      ),
    );
  }
}

It throws this:

The following assertion was thrown during performLayout():
LayoutBuilder does not support returning intrinsic dimensions.

Calculating the intrinsic dimensions would require running the layout callback speculatively, which might mutate the live render object tree.
User-created ancestor of the error-causing widget was
    Card 
lib\pages\home.dart:28
When the exception was thrown, this was the stack
#0      _RenderLayoutBuilder._debugThrowIfNotCheckingIntrinsics.<anonymous closure> 
package:flutter/…/widgets/layout_builder.dart:263
#1      _RenderLayoutBuilder._debugThrowIfNotCheckingIntrinsics 
package:flutter/…/widgets/layout_builder.dart:270
#2      _RenderLayoutBuilder.computeMaxIntrinsicHeight 
package:flutter/…/widgets/layout_builder.dart:234
#3      RenderBox._computeIntrinsicDimension.<anonymous closure> 
package:flutter/…/rendering/box.dart:1290
#4      _LinkedHashMapMixin.putIfAbsent  (dart:collection-patch/compact_hash.dart:291:23)
...
The following RenderObject was being processed when the exception was fired: RenderIntrinsicHeight#dd578 relayoutBoundary=up11 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
RenderObject: RenderIntrinsicHeight#dd578 relayoutBoundary=up11 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
    parentData: <none> (can use size)
    constraints: BoxConstraints(w=675.4, 0.0<=h<=Infinity)
    size: Size(675.4, 40.0)
    child: RenderFlex#ef52d NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
        parentData: <none> (can use size)
        constraints: BoxConstraints(w=675.4, h=40.0)
        size: Size(675.4, 40.0)
        direction: horizontal
        mainAxisAlignment: start
        mainAxisSize: max
        crossAxisAlignment: stretch
        textDirection: ltr
        verticalDirection: down
        child 1: RenderConstrainedBox#34546 relayoutBoundary=up1 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
            parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)
            constraints: BoxConstraints(0.0<=w<=Infinity, h=40.0)
            size: Size(20.0, 40.0)
            additionalConstraints: BoxConstraints(w=20.0, h=40.0)
            child: RenderDecoratedBox#f84cb NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
                parentData: <none> (can use size)
                constraints: BoxConstraints(w=20.0, h=40.0)
                size: Size(20.0, 40.0)
                decoration: BoxDecoration
                    color: MaterialColor(primary value: Color(0xffffc107))
                configuration: ImageConfiguration(bundle: PlatformAssetBundle#f4e9c(), devicePixelRatio: 2.6, locale: en_US, textDirection: TextDirection.ltr, platform: android)
        child 2: _RenderLayoutBuilder#14596 NEEDS-LAYOUT NEEDS-PAINT
            parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight
            constraints: MISSING
            size: MISSING
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
LayoutBuilder does not support returning intrinsic dimensions.
User-created ancestor of the error-causing widget was
    Card 
lib\pages\home.dart:28
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
LayoutBuilder does not support returning intrinsic dimensions.
User-created ancestor of the error-causing widget was
    Card 
lib\pages\home.dart:28
════════════════════════════════════════════════════════════════════════════════

Screenshots
I want to create a card with date text on the left that will scale and content on the right. I don't want to use a FittedBox solution as the text grows too much on landscape and looks ugly.

card_screenshot

Version

Flutter 1.9.1+hotfix.1 • channel beta • https://github.com/flutter/flutter.git
Framework • revision a1fb3fabec (2 days ago) • 2019-09-03 18:07:52 -0700
Engine • revision cc88fa45db
Tools • Dart 2.5.0
  • auto_size_text version: 2.1.0

Tiny mistake on doc

Small error here :
AutoSizeText("The text to display", style: TextStyle(fontSize:20.0), maxlines: 2, )

maxlines should be maxLines

Great package, works perfectly and save me a lot of trouble.

Don't wrap long words

Problem
When trying to display text that contains long words using the AutoSizeText widget, it can get wrapped if the available space is small. Perhaps there are some places where this is the intended effect, but in most cases, it's not. Design-wise, this is very dangerous because often, apps display data that's unknown at compile-time, so most developers probably aren't even aware of this behavior.
That's why I propose to present an option to the developer (perhaps a wrapWords in the constructor) that lets the user opt-in to word-wrapping, making not wrapping words the default.

The technical side
So how is it possible to not wrap words?
Let's suppose you calculated a seemingly fitting text size. The following is one possible way of making sure the text doesn't wrap:

  1. Break the text into separate lines by replacing every section of whitespaces with newlines (\n).
  2. Create a TextPainter for the text, setting the maxLines property to the number of words.
  3. Measure the text again with the incoming width.
  4. If the text didExceedMaxLines, a word got wrapped! Otherwise, we're good.
  5. If a word got wrapped, try the same for a smaller text.

Possible concerns
The only possible contra argument that comes to my mind is that the widget is less performing. But as the widget isn't heavily optimized for performance yet (i.e. linear search for the text size is used instead of binary search), and the decision making for the text size doesn't happen often, I'm sure it's a trade-off worth making.

Implementation
So, how do you feel about this proposal?
If you do agree that this would be a nice feature to have, would you like to implement it or should I do so and then, file a pull request? (Could take some time, I'm currently quite busy.)

OnOverflow callback

Is your feature request related to a problem? Please describe.
I want to display a Widget with some text (AutoSizeText) at a standard size. If the text overflows, then I want to add a "Read More" button which expands the Widget and shows the full text.

Describe the solution you'd like
A way to branch on the overflow condition. E.g.

AutoSizeText(
  'A String tool long to display without extreme scaling or overflow.',
  maxLines: 1,
  onOverflow: () => print('Text overflowed'),
)

Describe alternatives you've considered
overflowReplacement parameter is not ideal for this situation, since AutoSizeText is almost always a child of some container (e.g. Card).

Also, the proposed solutions in this StackOverflow question seem messy.

Version

  • Flutter version: 1.17.0
  • auto_size_text version: 2.1.0

PS
Would love to contribute and make a PR if this seems like a valid use case, and we can agree upon an API ahead of time :)

Integration Tests do not work with AutoSizeText.rich(..) constructor

Steps to Reproduce
Thanks to #27 I wanted to now check strings in my integration tests with driver.getText(myTextKeyFinder). Unfortunately, it does not seem to work with AutoSizeText.rich(..) constructed AutoSizeText widgets.

If I look at the tree with the Dart DevTools, the tree looks the following:

  • AutoSizeText
    • LayoutBuilder
      • Text [myTextKey]
        • RichText (this one has no key)
          • text: Here is my text

Obviously, if I then do the following:

String myElementText = await driver.getText(myTextKeyFinder);
expect(myElementText , 'My Text');

it fails because the Text widget with the key has no text and the RichText with my text has no key.

So in this case I would expect the RichText widget to have receive the key. Then I guess it would work.

Code sample

AutoSizeText.rich(
        TextSpan(
          style: _style,
          children: getStyledSpans( //getStyledSpans is a List<TextSpan>
            _text,
            _style,
          ),
        ),
        textAlign: _textAlign,
        maxLines: _maxLines,
        textKey: _textKey,
      ),

Screenshots
N/A

Version

  • Flutter version: 1.7.8+hotfix.4
  • auto_size_text version: 2.1.0

Options for ways to use TextOverflow

Description
When there is a TextOverflow option set, truncation happens in places where there is a space (or linebreak I guess). This is fine, but if we have a very long word at the end of the string, then that long word will be cut altogether which may cause the text to look weird (considering there is no resizing happening).
For example, if I have this string "Hello Jack, hello Pauline, and finally Hello Fredrikhteshkesteandermastionisk", then if the truncation happens, the last long word will be all replaced with ellipses. This makes the text look weird in some places. In my specific use case, I have a container around the text which is sized with extra space in this case!

Proposed Solution
The solution would have two parts:
First of all, it would be great to put a wrapping setting, to determine what kind of truncation would happen if the overflow symbol is used. One option in the beforementioned example would replace the whole "Fredrikhteshkesteandermastionisk" with ellipses and the other option would use a part of the word in the final string with ellipses at the end, like "Fredrikhteshkestean...".
The other part of the solution which I think could be also reported as a separate bug is regarding the size of the final Text. In the example above, considering the last word is replaced, the size of the Container around the text is not set based on the actual rendered text and seems to consider having a part of that last long word in there. So although the final result is shown as "Hello Jack, hello Pauline, and finally Hello ...", the Container around the text which should wrap around the text is sized bigger like if the text is "Hello Jack, hello Pauline, and finally Hello Fredrikhteshkeste...".

Alternatives
I have not considered anything and for now, I'm living with it hoping that the text our users enter won't have a very long word where truncation happens.

Version

  • Flutter version: 1.12.13+hotfix.5
  • auto_size_text version: 2.1.0

How we used this with Row & column

as we used in our project and insert the text into a row and then column then put this AutoSizeText
nothing will happen and yellow lines still show

FontSize has to be multiples of stepGranularity

I've had this error after I upgraded the package to 2.0.0+2. Also, I've never changed my code. This one used to work in the previous version:

Code sample

AutoSizeText(
     "Here is a long text.",
     textAlign: TextAlign.center,
     minFontSize: 16.0,
     maxLines: 4, 
     overflow: TextOverflow.ellipsis,
),
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building LayoutBuilder:
flutter: FontSize has to be multiples of stepGranularity.
flutter: 'package:auto_size_text/src/auto_size_text.dart': Failed assertion: line 296 pos 14: 'style.fontSize
flutter: / widget.stepGranularity % 1 == 0'
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2      _AutoSizeTextState._sanityCheck (package:auto_size_text/src/auto_size_text.dart:296:14)
flutter: #3      _AutoSizeTextState.build.<anonymous closure> (package:auto_size_text/src/auto_size_text.dart:253:7)
flutter: #4      _LayoutBuilderElement._layout.<anonymous closure> (package:flutter/src/widgets/layout_builder.dart:113:26)
flutter: #5      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2258:19)
flutter: #6      _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:109:11)
flutter: #7      RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1740:58)
flutter: #8      PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:797:15)
flutter: #9      RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1740:13)
flutter: #10     _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:207:5)
flutter: #11     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #12     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #13     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #14     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:385:13)
flutter: #15     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #16     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
flutter: #17     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #18     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
flutter: #19     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #20     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:385:13)
flutter: #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #22     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
flutter: #23     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:431:7)
flutter: #24     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
flutter: #25     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
flutter: #26     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #27     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #28     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #29     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #30     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1206:11)
flutter: #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #32     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #33     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #34     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #35     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #36     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #37     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #38     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
flutter: #39     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #40     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #41     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #42     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #43     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #44     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #45     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #46     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #47     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #48     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #49     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #50     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #51     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3015:13)
flutter: #52     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #53     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
flutter: #54     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #55     __RenderTheatre&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #56     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #57     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #58     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #59     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #60     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #61     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #62     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #63     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
flutter: #64     RenderObject.layout (package:flutter/src/rendering/object.dart:1644:7)
flutter: #65     RenderView.performLayout (package:flutter/src/rendering/view.dart:151:13)
flutter: #66     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1519:7)
flutter: #67     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:766:18)
flutter: #68     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:347:19)
flutter: #69     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:701:13)
flutter: #70     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:286:5)
flutter: #71     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1012:15)
flutter: #72     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:952:9)
flutter: #73     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:773:7)
flutter: #82     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
flutter: #83     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
flutter: #84     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
flutter: (elided 10 frames from class _AssertionError, package dart:async, and package dart:async-patch)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════

Version

  • Flutter version: 1.5.4
  • auto_size_text version: 2.0.0+2

AutoSizeGroup text gone

Hello again! This is a piece of code pulled out of my application, the essence of the problem is that if you call a hot reload or by any other means rebuilding the MyGrivView widget, then all the text disappears. if MyGridView, make the stfl widget everything will work, there is also an interesting point, run this code, press hot reload, then change lvl + 1 to lvl + 2, and we will see an effect on some widgets, the text will return, then next hot relaod text all disappear again. Also note that if you change to lvl + 2, the fonts are not aligned to minFontSize.
if you scroll through the list to the end and back texts are returned.
Any idea why this is?

void main() {
  BlocSupervisor().delegate = SimpleBlocDelegate();
  runApp(MyTestApp());
}

class MyTestApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyGridView(),
    );
  }
}

class MyGridView extends StatelessWidget {
  final AutoSizeGroup group = AutoSizeGroup();

  @override
  Widget build(BuildContext context) {
    print('build');
    return Scaffold(
      body: GridView.count(
        crossAxisCount: 5,
        children: _buildList(),
      ),
    );
  }

  _buildList() {
    return List.generate(100, (i) => LvlIcon.passed(i, group: group));
  }
}

enum LvlIconType { open, passed, lock }

class LvlIcon extends StatelessWidget {
  final LvlIconType type;
  final int lvl;
  final void Function() onTap;
  final AutoSizeGroup group;

  const LvlIcon.lock(
    this.lvl, {
    this.onTap,
    this.group,
  }) : type = LvlIconType.lock;

  const LvlIcon.passed(
    this.lvl, {
    this.onTap,
    this.group,
  }) : type = LvlIconType.passed;

  const LvlIcon.open(
    this.lvl, {
    this.onTap,
    this.group,
  }) : type = LvlIconType.open;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        margin: const EdgeInsets.all(8),
        color: Colors.blue,
        child: Stack(
          alignment: AlignmentDirectional.center,
          children: [
            //This background Image => Image.asset(_getPathIcon()),
            type == LvlIconType.lock
                ? Container()
                : Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 10),
                    child: SizedBox(
                      width: 50,
                      height: 50,
                      child: AutoSizeText(
                        (lvl + 1).toString(),
                        group: group,
                        style: _getTextStyle(),
                        textAlign: TextAlign.center,
                        maxLines: 1,
                      ),
                    ),
                  )
          ],
        ),
      ),
    );
  }

  TextStyle _getTextStyle() {
    switch (type) {
      case LvlIconType.open:
        return TextStyle(
          fontFamily: 'Days',
          fontSize: 100,
          color: Colors.white,
        );

      case LvlIconType.passed:
        return TextStyle(
          fontFamily: 'Days',
          fontSize: 100,
          color: Colors.white,
        );
      default:
        return TextStyle();
    }
  }

//  String _getPathIcon() {
//    switch (type) {
//      case LvlIconType.open:
//        return MyImage.blueRing;
//
//      case LvlIconType.passed:
//        return MyImage.greenRing;
//
//      case LvlIconType.lock:
//        return MyImage.lock;
//
//      default:
//        return '';
//    }
//  }
}

Option to make text selectable?

Awesome package!! One thing I would like if you could is to make the text selectable in my browser, such as if I use it to show text like an email address that they may want to cut and paste.

What I'm doing wrong?

Question
I can't force plugin to change font size. see screenshot attached.

Code sample

AspectRatio(
      aspectRatio: 1.8,
      child: Stack(
        overflow: Overflow.clip,
        children: [
          FractionallySizedBox(
            widthFactor: 0.5,
            heightFactor: 1,
            child: Column(
              mainAxisSize: MainAxisSize.max,
              children: <Widget>[
                Expanded(
                  child: AutoSizeText(
                    '${entity.doubleState}${widget.unit}',
                    style: TextStyle(fontWeight: FontWeight.bold, fontSize: Sizes.stateFontSize),
                  ),
                ),
                Expanded(
                  child: AutoSizeText(
                      '${entity.displayName}',
                      style: TextStyle(fontSize: Sizes.stateFontSize)
                  ),
                ),
              ],
            ),
          ),
        ]),
    )

Screenshot_20190907-133725

Version

  • Flutter version: 1.7.8
  • auto_size_text version: 2.1.0

Allow for individual scale factor in a group

I am having a problem were I am using two different font families that I would like to automatically resize together, so I put them both in the same group. However, one of the fonts looks smaller than the other, using the same font size.
I would like to be able to set a scale factor for one that wouldn't affect the other. Both of them would still resize at the same time but they would always maintain the same ratio.
I tried using textScaleFactor, however this doesn't seem to be independent: the second widget seems to use the same textScaleFactor as the first.

Unexpected wrapping with text height style and maxLines > 1

Thanks for making this widget, I've been a grateful user of it in pretty much every Flutter app I've made so far 👍

I saw a weird text wrapping case in an app I was working on which uses auto_size_text 1.1.2 and thought I'd report it in case this was something the text fitting detection could handle, or if the cause is something users should avoid doing.

I noticed a number of cases where certain single word text was having its last letter wrapped, like so:

studio64_AECas57Jjb

I was able to make it resize as expected by setting maxLines to 1 or by omitting the text height styling (the workaround I ended using was only setting maxLines to 2 if the text contains a space).

7PbxWXPDjo

Other version info:

Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (4 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

Crash with PaginatedDataTable

Steps to Reproduce

  1. Create a PaginatedDataTable Widget. Insert anywhere (header, columns, rows) an AutoSizeText Widget

  2. Try to render/run your App

Code sample

SingleChildScrollView(
            child: PaginatedDataTable(
              header: AutoSizeText(
                  Localizations.of(context)
                      .trans('TABLE_HEADER'),
                  maxLines: 1,
                  style: TextStyle(
                      fontSize: 22, color: Colors.black.withOpacity(.7))),
              columns: _buildDataTableColumns(),
              source: _buildTableSource(),
              rowsPerPage: 10,
            ),
          ),

Error

════════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during performLayout():
LayoutBuilder does not support returning intrinsic dimensions.

Calculating the intrinsic dimensions would require running the layout callback speculatively, which might mutate the live render object tree.

Version

  • Flutter version: 1.10.6.pre97
  • auto_size_text version: ^1.1.2

Does not auto size the text with bounded constraints

Hi, I've tried the wrong and right code section to add constraints to the text widget, but it doesn't work, the font size is not scaled down, but just missing the later part of the text not shown.

      Widget _buildRepayRow() {
        return Row(
          children: <Widget>[
            Expanded(
              child: TextWidget(
                '${StringUtils.formatAmount(LoanUtils.equalPrincipalAndInterest(
                  creditTrialAmount,
                  vm.response.rateAnnualMin,
                  creditTrialTerm,
                ))} - ${StringUtils.formatAmount(LoanUtils.equalPrincipalAndInterest(
                  creditTrialAmount,
                  vm.response.rateAnnualMax,
                  creditTrialTerm,
                ))}',
                style: L.tsNumberHeaderDark,
                maxLines: 1,
                presetFontSizes: [L.f32, L.f24, L.f16, L.f14, L.f12],
              ),
            ),
          ],
        );
      }
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.3.8, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.2)
[✓] Android Studio (version 3.3)
[✓] IntelliJ IDEA Community Edition (version 2017.2.5)
[✓] VS Code (version 1.33.1)
[✓] Connected device (2 available)

Facing issue while adding the library as a dependency

Steps to Reproduce
I have added the auto_size_text: ^2.1.0 in dependencies and facing the issue

Code sample

Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

Screenshots
Uploading Screen Shot 2019-12-16 at 1.44.31 AM.png…

Version

  • Flutter version: Flutter 1.12.13+hotfix.6 • channel beta • https://github.com/flutter/flutter.git
    Framework • revision 18cd7a3601 (5 days ago) • 2019-12-11 06:35:39 -0800
    Engine • revision 2994f7e1e6
    Tools • Dart 2.7.0

  • auto_size_text version: 2.1.0

AutoSizeText cannot be properly tested in Integration tests

Is your feature request related to a problem? Please describe.
AutoSizeText has a key, but using the key we cannot get text in Integration test. As await driver.getText(finder) can get text from a Text type widget and not from custom widget which is not a subtype of text.

Though we can do await driver.waitFor(find.text("text")); but this is not appropriate as a page can have multiple places with same text and it is best to find text using a key finder.

Describe the solution you'd like
Passing a separate key parameter in AutoSizeText widget for the Text widget defined inside AutoSizeText library can let us find the text from the key for Text widget.

Version

  • Flutter version: v1.7.4
  • auto_size_text version: 2.0.2+1

Error:

DriverError: Error in Flutter application: Uncaught extension error while executing get_text: type 'AutoSizeText' is not a subtype of type 'Text'
  #0      FlutterDriverExtension._getText (package:flutter_driver/src/extension/extension.dart:446:16)
  <asynchronous suspension>
  #1      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:188:53)
  <asynchronous suspension>
  #2      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:512:32)
  <asynchronous suspension>
  #3      _runExtension (dart:developer-patch/developer.dart:84:23)

  Original error: null
  Original stack trace:
  null

AutoSizeText.rich not working well with maxLines

The parameter maxLines doesn't work correctly with AutoSizeText.rich, it seems that the widget chose a size that would fit for the maximum number of lines in the space available, but then the result overflows if the maxLines parameter is lesser than this.

Text with more lines than maxLines results in the font size being the minFontSize

Steps to Reproduce
Trying to resize a text that has more lines in itself more than the allowed maxLines results in the font size to be the minFontSize and the displayed lines to be only maxLines, leaving an empty space bellow.
Expected result - Either:
1 - Cap the input text to maxLines lines first and then apply the rest of the resizing algorithm; or
2 - Apply the maximum possible lines possible when reaching the minFontSize.

The first option would be more consistent with the behaviour of Text(), which caps the lines to maxLines.

Code sample

Row(
      children: <Widget>[
        SizedBox(
          width: 100,
          height: 100,
          child: Text("1\n2\n3\n4\n5", maxLines: 4),
        ),
        SizedBox(
          width: 100,
          height: 100,
          child: AutoSizeText("1\n2\n3\n4\n5", maxLines: 4, minFontSize: 5),
        ),
      ],
    )

Screenshots
Screenshot for the example above:
image

Version

  • Flutter version: 1.17.1
  • auto_size_text version: ^2.1.0

Android bug what is it?

Container(
                        height: 50,
                        width: 40,
                        alignment: Alignment.center,
                        child: AutoSizeText(
                          '999',
                          style: TextStyle(fontSize: 100),
                          textAlign: TextAlign.center,
                          maxLines: 1,
                        ),
                      ),

This code works fine in any IOS device, but on Android, the last letter goes to the next line, if you slightly increase the height you will see why this happens?
But FittedBox help this

Controller.

I want to add to list that entering data in text. Does this widget have controller like in TextField ?

Exceedingly long single word text, like folder paths.

Is your feature request related to a problem? Please describe.
I'm showing folder paths in a ListTile and using AutoSizeText to fit them nicely on two lines.
Long folders with no spaces in them didn't really work that well.

Describe the solution you'd like
A parameter to adjust the algorithm to accomodate super long folder paths. i.e. isFolder:true

Describe alternatives you've considered
I got around this with
"C:\\\\Super\\long\\folder\\doesnt\\wrap\\nicely\\which\\is\\a\\shame".split('\\').join('\u200A\\')

Basicaly i found a super short space character in unicode from https://www.compart.com/en/unicode/category/Zs so the existing AutoSizeText layout algorithm would just work.

Version

  • Flutter version: [e.g. 1.5.4]
  • auto_size_text version: [e.g. 1.2.1]

Auto size text does not auto-size text in the Flutter stable v1.2.1

I was on Flutter Beta 1.0 for the longest time in one of my machines.
Today I upgraded to Flutter Stable v1.2.1, and seems that this plugin has lost its functionality.
Text is not being auto-sized properly, even with maxLines and minFontSize specified.

plugin version: 1.1.1

code snippet:

        Card(
          margin: EdgeInsets.only(top: 12.0),
          elevation: 4.0,
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: AutoSizeText(
              "this is a very very very very very very very very very very long string",
              maxLines: 1,
              minFontSize: 2.0,
            ),
          ),
        ),

flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.648],
    locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.3)
[√] IntelliJ IDEA Community Edition (version 2018.1)
[√] Connected device (1 available)

Can't import this package ver 0.2.2

I'm using flutter 0.11.7 and in the main.dart
import 'package:auto_size_text/auto_size_text.dart';
i got this error

[dart] Target of URI doesn't exist: 'package:auto_size_text/auto_size_text.dart'. [uri_does_not_exist]

How do I read the current text font size while updated?

I need a way to update the state with the current text size (when it resizes I want to update an internal double variable so that I can use it on other areas (that are not auto resized) later on.
Is there like an "onchange" method or something I can use?

Option to add text by the end of the overflowed text and an action

Many times a text overflows, I would still want to show the entire text either by opening it in a modal or another page.

Would be nice to have a three dots (or a custom text) by the end of the cut off text and an action (maybe a widget, maybe just a custom text with a custom onTap action). For example:

"This text is way too long because it will only take up to 64 le ... more"

The three dots by the end can be a custom text or icon and the "more" text can have an action to maybe open up some screen that can show the entire text. As mentioned above the "more" can also be a Widget, for possibly an Icon or custom Text.

An alternative for me was to add a button below the trimmed text for the user to open the entire text in a modal.

Version

  • Flutter version: [e.g. 1.5.4]
  • auto_size_text version: [e.g. 1.2.1]

wrapWords not working

Even with wrapWords = false, autoSizeText still breaks up a single word - see screenshot.

Steps to Reproduce
Set wrapWords = false, maxFontSize = 200, minFontSize = 20, data="BECAUSE I'M LOVIN' IT!"

Screenshots
If applicable, add screenshots to help explain your problem.
image

Version

  • Flutter version: [e.g. 1.7.2]
  • auto_size_text version: [2.0.0+2]

Support for Flutter Web

Is your feature request related to a problem? Please describe.
Package doesn't work for flutter web. It's not compatible for flutter web projects.

Describe the solution you'd like
Provide support for flutter web :)

Describe alternatives you've considered
Decouple auto_size_text from flutter sdk.

Version

  • Flutter version: v1.7.8+hotfix.3
  • auto_size_text version: ^1.1.2

Error calculating dimensions in SimpleDialog

Steps to Reproduce

  • Create a SimpleDialog being shown in the showDialog call.
  • In the title add a row with an expanded widget which holds the AutoSizeText widget

Code sample

Container(
            color: Colors.black12,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Expanded(
                  child: Padding(
                    padding:
                        const EdgeInsets.only(left: 10, top: 10, bottom: 5),
                    child: AutoSizeText(
                       "Big long huge title here to shrink",
                      style: Theme.of(context).textTheme.title,
                      minFontSize: 14,
                      maxLines: 1,         
                    ),
                  ),
                ),
                IconButton(
                  alignment: Alignment.topRight,
                  icon: Icon(Icons.close),
                  onPressed: () => Navigator.of(context).pop(),
                )
              ],
            ),
          ),

Screenshots
If applicable, add screenshots to help explain your problem.

Version

  • Flutter version: [1.5.4]
  • auto_size_text version: [2.0.1]

Start with 1 line and move to 2?

Question
Is it possible to fit the text to one line at a specified font size and only if the text doesn't fix at a predetermined size is the font increased and the number of lines increased to two?

Code sample

AutoSizeText(
            Utility.capitalize(product.name),
            style: Theme.of(context).textTheme.title,
            maxFontSize: 18.0,
            minFontSize: 10.0,
            minLines: 1,
            maxLines: 2,
          ),

Version

  • Flutter version: 1.5.4
  • auto_size_text version: 1.2.1

MaxLines make text disappear with hebrew

Hello,
I tried using this package with Hebrew.
When I type the string "שם משפחה" with fontsize 27, and as Bold withing a container with width 144, the last word disappeared.
If I entered this string - "שם משפחההה", the whole sentence was shown.

this is my Code

class RegistrationScreen1 extends StatelessWidget {
  Color hexToColor(String code) {
    return Color(int.parse(code.substring(1, 7), radix: 16) + 0xFF000000);
  }

  AutoSizeGroup textGroup = AutoSizeGroup();
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        width: 144,
        child: AutoSizeText(
          "שם משפחה",
          maxLines: 1,
          minFontSize: 2,
          style: TextStyle(fontSize: 27, fontWeight: FontWeight.bold),
        ),
      ),
    );
  }
}

Screenshots
image

Version

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.18362.592], locale en-IL)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.41.1)
[√] Connected device (2 available)

• No issues found!

  • auto_size_text version: 2.1.0

I couldn't reproduce that bug with english :(

Thank you very much!

Does not work correctly with large fonts setting

Android devices (and I assume iOS devices as well) have a setting to control font sizing so that if you have trouble seeing you can scale fonts up across the entire device. When this is enabled on a device, it is not taken into account in this library so that this library determines the font size that will fit but then it gets scaled up from there.

You can read about this setting from a flutter perspective in this article in the section on Large Fonts: https://medium.com/flutter-community/a-deep-dive-into-flutters-accessibility-widgets-eb0ef9455bc

Not getting expected maxFontSize when I change the device font size to largest.

Steps to Reproduce
I have a TabBar with some tabs. AutoSizeText is used as Tab. I've used maxFontSize here. Then I changed the device font size to the largest. At that time, I expected the fontsize to be the given maxFontSize which is 20.0, but it is not. Font size crosses maxFontSize limit when I change the device font size to the largest.

Code sample

return DefaultTabController(
      length: 4,
      child: Scaffold(
          bottom: TabBar(
            tabs: <Widget>[
              AutoSizeText(
                "TAB ONE",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
              AutoSizeText(
                "TAB TWO",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
              AutoSizeText(
                "TAB THREE",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
              AutoSizeText(
                "TAB FOUR",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
            ],
          ),
        ),
      ),
    );

Themedata for tabs :

tabBarTheme: TabBarTheme(
          labelPadding: EdgeInsets.symmetric(vertical: 10.0),
          labelColor: Colors.blue,
          labelStyle: TextStyle(
            color: Colors.blue,
            fontSize: 15.0,
            fontWeight: FontWeight.bold,
          ),
          unselectedLabelColor: Colors.grey,
          unselectedLabelStyle: TextStyle(
            color: Colors.grey,
            fontSize: 15.0,
          ),
        ),

Version

  • Flutter version: 1.12.13+hotfix.5 • channel stable
  • auto_size_text version: auto_size_text: ^2.1.0

Dry-Run of `_calculateFontSize`?

Question

Is it possible to do a dry-run of _calculateFontSize without having to use AutoSizeText widget?

My use case requires calculating maximum number of lines and use the output value as a parameter for AutoSizeText widget.

What I'm trying to do is pass width and height with a maximum int for maxLines, in addition to the usual style and size parameters of AutoSizeText. In return I'd get fontSize from _calculateFontSize. All of this would be done without having to actually use AutoSizeText widget.

Version

  • Flutter version: 1.12.13+hotfix.5 (latest stable)
  • auto_size_text version: 2.1.0 (latest version)

Option to revert to Text() behavior

Hey, thanks for your work here-- AutoSizeText is really great!

I'd like to give the user an option to turn it off or on, and it would be nice if there were a boolean parameter to revert to Text() behavior.

I realize I could just have an conditional and pass all the same values to Text(), but it's not very elegant. Would another workaround be to set minFontSize and maxFontSize to the same value?

Not working when i wrap it with Expanded() inside a Row

Version

  • Flutter version: [1.5.4-hotfix.2]
  • auto_size_text version: [latest]

Code sample

Row(
   mainAxisAlignment: MainAxisAlignment.start,
   children: <Widget>[
        Expanded(
             flex: 1,
             child: Icon(
                 Icons.camera,
                  color: Colors.black,
                ),
             ),
             Expanded(
                 flex: 6,
                 child: Container(
                    padding: EdgeInsets.only(left: 10),
                    child: AutoSizeText(
                      "Product Image",
                      maxLines: 2,
                      style: TextStyle(
                        color: Colors.white,
                        fontWeight: FontWeight.bold,
                      ),
                      minFontSize: 12,
                      maxFontSize: double.infinity,
                      ),
                    ),
                  )
                ],
              ),

I/flutter (11414): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (11414): The following assertion was thrown during performLayout():
I/flutter (11414): LayoutBuilder does not support returning intrinsic dimensions.
I/flutter (11414): Calculating the intrinsic dimensions would require running the layout callback speculatively, which
I/flutter (11414): might mutate the live render object tree.
I/flutter (11414):
I/flutter (11414): When the exception was thrown, this was the stack:
I/org.webrtc.Logging(11414): EglRenderer: Duration: 4001 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging(11414): EglRenderer: Duration: 4005 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
�[38;5;244mI/flutter (11414): #0 _RenderLayoutBuilder._debugThrowIfNotCheckingIntrinsics.�[39;49m
�[38;5;244mI/flutter (11414): #1 _RenderLayoutBuilder._debugThrowIfNotCheckingIntrinsics�[39;49m
�[38;5;244mI/flutter (11414): #2 _RenderLayoutBuilder.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #3 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #4 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #5 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #6 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #7 RenderPadding.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #8 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #9 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #10 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #11 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #12 RenderFlex.computeMaxIntrinsicWidth.�[39;49m
�[38;5;244mI/flutter (11414): #13 RenderFlex._getIntrinsicSize�[39;49m
�[38;5;244mI/flutter (11414): #14 RenderFlex.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #15 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #16 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #17 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #18 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #19 RenderShiftedBox.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #20 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #21 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #22 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #23 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #24 RenderPadding.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #25 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #26 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #27 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #28 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #29 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #30 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #31 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #32 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #33 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #34 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #35 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #36 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #37 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #38 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #39 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #40 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #41 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #42 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #43 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #44 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #45 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #46 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #47 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #48 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #49 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #50 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #51 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #52 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #53 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #54 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #55 RenderConstrainedBox.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #56 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #57 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #58 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #59 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #60 _RenderInputPadding.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #61 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #62 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #63 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #64 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #65 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #66 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #67 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #68 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #69 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #70 RenderPadding.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #71 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #72 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #73 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #74 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #75 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #76 RenderConstrainedBox.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #77 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #78 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #79 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #80 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #81 RenderFlex.computeMaxIntrinsicWidth.�[39;49m
�[38;5;244mI/flutter (11414): #82 RenderFlex._getIntrinsicSize�[39;49m
�[38;5;244mI/flutter (11414): #83 RenderFlex.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #84 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #85 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #86 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #87 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #88 RenderFlex.computeMaxIntrinsicWidth.�[39;49m
�[38;5;244mI/flutter (11414): #89 RenderFlex._getIntrinsicSize�[39;49m
�[38;5;244mI/flutter (11414): #90 RenderFlex.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #91 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #92 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #93 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #94 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #95 _RenderSingleChildViewport.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #96 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #97 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #98 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #99 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #100 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #101 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #102 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #103 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #104 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #105 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #106 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #107 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #108 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #109 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #110 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #111 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #112 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #113 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #114 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #115 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #116 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #117 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #118 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #119 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #120 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #121 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #122 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #123 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #124 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #125 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #126 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #127 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #128 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #129 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #130 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #131 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #132 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #133 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #134 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #135 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #136 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #137 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #138 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #139 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #140 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #141 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #142 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #143 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #144 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #145 RenderPadding.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #146 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #147 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #148 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #149 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #150 RenderFlex.computeMaxIntrinsicWidth.�[39;49m
�[38;5;244mI/flutter (11414): #151 RenderFlex._getIntrinsicSize�[39;49m
�[38;5;244mI/flutter (11414): #152 RenderFlex.computeMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #153 RenderBox._computeIntrinsicDimension.�[39;49m
�[38;5;244mI/flutter (11414): #154 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)�[39;49m
�[38;5;244mI/flutter (11414): #155 RenderBox._computeIntrinsicDimension�[39;49m
�[38;5;244mI/flutter (11414): #156 RenderBox.getMaxIntrinsicWidth�[39;49m
�[38;5;244mI/flutter (11414): #157 RenderIntrinsicWidth.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #158 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #159 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #160 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #161 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #162 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #163 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #164 _RenderCustomClip.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #165 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #166 RenderConstrainedBox.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #167 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #168 RenderPositionedBox.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #169 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #170 RenderPadding.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #171 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #172 RenderPadding.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #173 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #174 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #175 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #176 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #177 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #178 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #179 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #180 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #181 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #182 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #183 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #184 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #185 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #186 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #187 RenderOffstage.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #188 RenderObject.layout�[39;49m
�[38;5;244mI/flutter (11414): #189 RenderStack.performLayout�[39;49m
�[38;5;244mI/flutter (11414): #190 RenderObject._layoutWithoutResize�[39;49m
�[38;5;244mI/flutter (11414): #191 PipelineOwner.flushLayout�[39;49m
�[38;5;244mI/flutter (11414): #192 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame�[39;49m
�[38;5;244mI/flutter (11414): #193 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame�[39;49m
�[38;5;244mI/flutter (11414): #194 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback�[39;49m
�[38;5;244mI/flutter (11414): #195 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback�[39;49m
�[38;5;244mI/flutter (11414): #196 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame�[39;49m
�[38;5;244mI/flutter (11414): #197 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame�[39;49m
�[38;5;244mI/flutter (11414): #201 _invoke (dart:ui/hooks.dart:219:10)�[39;49m
�[38;5;244mI/flutter (11414): #202 _drawFrame (dart:ui/hooks.dart:178:3)�[39;49m
I/flutter (11414): (elided 3 frames from package dart:async)
I/flutter (11414):
I/flutter (11414): The following RenderObject was being processed when the exception was fired:
I/flutter (11414): RenderIntrinsicWidth#e6f5b relayoutBoundary=up5 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): creator: IntrinsicWidth ← DefaultTextStyle ← AnimatedDefaultTextStyle ←
I/flutter (11414): _InkFeatures-[GlobalKey#759c7 ink renderer] ← NotificationListener ←
I/flutter (11414): CustomPaint ← _ShapeBorderPaint ← PhysicalShape ← _MaterialInterior ← Material ← ConstrainedBox ←
I/flutter (11414): Center ← ⋯
I/flutter (11414): parentData: (can use size)
I/flutter (11414): constraints: BoxConstraints(280.0<=w<=453.3, 0.0<=h<=743.3)
I/flutter (11414): size: MISSING
I/flutter (11414): stepWidth: null
I/flutter (11414): stepHeight: null
I/flutter (11414): This RenderObject had the following descendants (showing up to depth 5):
I/flutter (11414): RenderFlex#c077d NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderPadding#97390 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderSemanticsAnnotations#c1d20 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderFlex#e223e NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderParagraph#05686 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderConstrainedBox#a5fbb NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderPadding#2b5ee NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderRepaintBoundary#8a521 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderCustomPaint#1778d NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderRepaintBoundary#cfec9 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderPadding#ffc6c NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderFlex#dcdfd NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderPadding#354dc NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderSemanticsAnnotations#736aa NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderPadding#a4cb0 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): RenderSemanticsAnnotations#88516 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderIntrinsicWidth#e6f5b relayoutBoundary=up5 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: _RenderInkFeatures#408dd relayoutBoundary=up4 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderCustomPaint#d0cac relayoutBoundary=up3 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#1f231 relayoutBoundary=up2 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 314 pos 12: 'child.hasSize': is not true.
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderLeaderLayer#f741d NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderLeaderLayer#6a6ce NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderLeaderLayer#c1f2a NEEDS-LAYOUT NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#1f231 relayoutBoundary=up2
I/flutter (11414): Another exception was thrown: LayoutBuilder does not support returning intrinsic dimensions.
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderIntrinsicWidth#e6f5b relayoutBoundary=up5 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: _RenderInkFeatures#408dd relayoutBoundary=up4 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderCustomPaint#d0cac relayoutBoundary=up3 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#1f231 relayoutBoundary=up2 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 314 pos 12: 'child.hasSize': is not true.
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#1f231 relayoutBoundary=up2
I/flutter (11414): Another exception was thrown: LayoutBuilder does not support returning intrinsic dimensions.
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderIntrinsicWidth#e6f5b relayoutBoundary=up5 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: _RenderInkFeatures#408dd relayoutBoundary=up4 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderCustomPaint#d0cac relayoutBoundary=up3 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#1f231 relayoutBoundary=up2 NEEDS-PAINT
I/flutter (11414): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 314 pos 12: 'child.hasSize': is not true.
I/flutter (11414): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#1f231 relayoutBoundary=up2
Application finished.
Exited (sigterm)

auto_size_text 1.1.2

Version auto_size_text 1.1.2 does not exists, must be use auto_size_text: ^1.1.1 at pubspec.yaml

Shadow is not visible when applied.

When applying TextStyle and inside providing shadows list, shadows are not applied to the text. When doing the same thing inside a regular Text widget it works. There is something in the widget that doesn't take into an account TextStyle parameter shadows of type List.

Version

  • Flutter version: 1.17.1
  • auto_size_text version: 2.1.0

AutoSizeText.rich only working when style is defined both in AutoSizeText and TextSpan

When using AutoSizeText.rich, it seems that I can only have correct autosizing when the fontSize is declared both in the AutoSizeText's style and in the TextSpan's, unlike what is said in the documentation.

A short sample to test it:

class MyHomePage extends StatelessWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: true,
      appBar: AppBar(
        title: TextField(),
      ),
      body: SafeArea(
        child: Column(children: <Widget>[
          Expanded(child: Center(child: SizedBox(width: 200, height: 200, child: AutoSizeText.rich(TextSpan(text: "Style is defined only in AutoSizeText",), style: TextStyle(fontSize: 200),),),),),
          Expanded(child: Center(child: SizedBox(width: 200, height: 200, child: AutoSizeText.rich(TextSpan(text: "Style is defined only in TextSpan", style: TextStyle(fontSize: 200)),),),),),
          Expanded(child: Center(child: SizedBox(width: 200, height: 200, child: AutoSizeText.rich(TextSpan(text: "Style is define in both AutoSizeText and TextSpan", style: TextStyle(fontSize: 200)), style: TextStyle(fontSize: 200),),),),),
        ],),
      ),
    );
  }
}

Only the last widget of the Column will be auto sized.

Using auto_size_text: ^1.1.0

Exception "The getter 'itemHeights' was called on null" when using AutoSizeText with DropdownButton

Create an app with the following constraints:

  1. Have a DropdownButton where the DropdownMenuItems have as a child a AutoSizeText
  2. Add a Textfield somewhere

Steps to reproduce:

  1. Click on the Dropdown
  2. Click on the TextField

Exception:

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following NoSuchMethodError was thrown during performLayout():
The getter 'itemHeights' was called on null.
Receiver: null
Tried calling: itemHeights

The relevant error-causing widget was: 
  MaterialApp file:///D:/Projects/AndroidStudioProjects/chaldea/lib/main.dart:20:12
When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1      _DropdownButtonState._handleTap.<anonymous closure> (package:flutter/src/material/dropdown.dart:1146:26)
#2      _RenderMenuItem.performLayout (package:flutter/src/material/dropdown.dart:617:5)
#3      RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
#4      RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.