Code Monkey home page Code Monkey logo

assorted_layout_widgets's People

Contributors

erickok avatar hixie avatar josh-burton avatar marcglasberg avatar parlough avatar passsy avatar whesse avatar wiefel 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

assorted_layout_widgets's Issues

Support crossAlignment in WrapSuper

Hello there,

Thanks for this amazing lib!!

I would like to know is there any way to align crossAxis center in WrapSuper just like in offical Wrap widget?
Because I do not see crossAlignment property in WrapSuper.

FitHorizontally different vertical alignment when text is scaled

Hello,

when the text is too long and it gets scaled it seems with some layouts that the vertical alignment of FitHorizontally becomes a top-alignment. I don't know the reason for this.

main.dart:

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: Scaffold(
        body: Container(
          height: 100,
          child: Row(
            children: <Widget>[
              Column(
                children: <Widget>[
                  Container(
                    width: 100,
                    child: FitHorizontally(
                      child: TextOneLine("text"),
                    ),
                  ),
                ],
              ),
              Column(
                children: <Widget>[
                  Container(
                    width: 100,
                    child: FitHorizontally(
                      child: TextOneLine("looooooooooooooooooooooooooooong"),
                    ),
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Which results in:

FitHorizontally

Missing implementations for RenderParagraph.getFullHeightForCaret

   1 warning generated.
    ../../Library/flutter/.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.3.4/lib/src/text_one_line.dart:207:7:
    Error: The non-abstract class 'RenderParagraphX' is missing implementations for these members:
     - RenderParagraph.getFullHeightForCaret
    Try to either
     - provide an implementation,
     - inherit an implementation from a superclass or mixin,
     - mark the class as abstract, or
     - provide a 'noSuchMethod' implementation.

    class RenderParagraphX extends RenderBox
          ^^^^^^^^^^^^^^^^
    ../../Library/flutter/packages/flutter/lib/src/rendering/paragraph.dart:750:11: Context:
    'RenderParagraph.getFullHeightForCaret' is defined here.
      double? getFullHeightForCaret(TextPosition position) {
              ^^^^^^^^^^^^^^^^^^^^^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
Flutter 1.22.0-12.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 8b3760638a (2 days ago) • 2020-09-15 17:47:13 -0700
Engine • revision 4654fc6cf6
Tools • Dart 2.10.0 (build 2.10.0-110.3.beta)

This is the error I got after trying to build my flutter project for ios.

I'm using 1.22 from the beta channel which has support for Xcode12 and iOS14.
Thank you

Building with flutter for web fails

When building with flutter for web I get the following error:

Target dart2js failed: Exception: /opt/flutter/.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.1.1/lib/src/minimum_raggedness.dart:20:61:

Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.
    List<num> minimum = [0]..addAll(List<num>.filled(count, 9223372036854775807));
                                                            ^^^^^^^^^^^^^^^^^^^
/opt/flutter/.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.1.1/lib/src/minimum_raggedness.dart:26:16:
Error: The integer literal 9223372036854775806 can't be represented exactly in JavaScript.
        return 9223372036854775806;
               ^^^^^^^^^^^^^^^^^^^
Error: Compilation failed.

It works fine when compiling for Android

Error: The non-abstract class 'TextOneLineEllipsisWithFade' is missing implementations

Error: The non-abstract class 'TextOneLineEllipsisWithFade' is missing implementations for these members:
../…/src/text_one_line_ellipsis_with_fade.dart:20
 - Text.selectionColor
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class TextOneLineEllipsisWithFade extends StatelessWidget implements Text {
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
: Context: 'Text.selectionColor' is defined here.
../…/widgets/text.dart:535
  final Color? selectionColor;

null safety

build msg is:
pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-6.0.0/lib/src/delayed.dart:40:29: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/D:/Android/flutter/packages/flutter/lib/src/widgets/binding.dart').
    Try calling using ?. instead.
    WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
    ^^^^^^^^^^^^^^^^^^^^

pls fix it

Flutter 2.5.0: getBoxesForSelection has fewer named arguments than those of overridden method

When running my app using Flutter version 2.5.0 I get the following error in assorted_layout_widgets: 5.1.1 dependency:

../../.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-5.1.1/lib/src/text_one_line_ellipsis_with_fade.dart:995:20: Error: The method 'RenderParagraphX.getBoxesForSelection' has fewer named arguments than those of overridden method 'RenderParagraph.getBoxesForSelection'.
      List<ui.TextBox> getBoxesForSelection(TextSelection selection) {
                       ^
    ../../Development/flutter/packages/flutter/lib/src/rendering/paragraph.dart:811:20: Context: This is the overridden method ('getBoxesForSelection').
      List<ui.TextBox> getBoxesForSelection(
                       ^

There might have been some breaking change in Flutter 2.5.0.
Can you please fix it?

TextOneLine doesn't respect OS-set textScaleFactor

First off, thanks for your work. It is useful and well done. 👍

A minor thing: We found that using TextOneLine it does not automatically apply the OS-set textScaleFactor the way that a normal Text does. It you set the iOS or Android accessibility text scale to something larger (or smaller) than the default, the text stays the same size.

Explicitly setting it scale factor with textScaleFactor: MediaQuery.of(context).textScaleFactor works well, which is great, but we expected this to be applied by default.

Render error in nullsafe TextoneLine inside IntrinsicHeight widget

When using assorted_layout_widgets 4.0.0 (with nullsafety) and wrapping a TextOneLine widget in a IntrinsicHeight widget, I get a rendering error.

IntrinsicHeight(child: TextOneLine("test this widget"))

produces:

The following _CastError was thrown during performLayout():
type 'List<PlaceholderDimensions?>' is not a subtype of type 'List<PlaceholderDimensions>?' in type
cast

The relevant error-causing widget was:
  IntrinsicHeight
  file:///Users/erickok/Dev/vrt/flutter-article-components/lib/components/player_time_line_event_component.dart:57:27

When the exception was thrown, this was the stack:
#0      RenderParagraphX._computeChildrenHeightWithMinIntrinsics (package:assorted_layout_widgets/src/text_one_line.dart:586:65)
#1      RenderParagraphX._computeIntrinsicHeight (package:assorted_layout_widgets/src/text_one_line.dart:475:5)
#2      RenderParagraphX.computeMaxIntrinsicHeight (package:assorted_layout_widgets/src/text_one_line.dart:487:12)
#3      RenderBox._computeIntrinsicDimension.<anonymous closure> (package:flutter/src/rendering/box.dart:1377:23)
#4      _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:311:23)
#5      RenderBox._computeIntrinsicDimension (package:flutter/src/rendering/box.dart:1375:42)
#6      RenderBox.getMaxIntrinsicHeight (package:flutter/src/rendering/box.dart:1747:12)
#7      RenderFlex.computeMaxIntrinsicHeight.<anonymous closure> 

This is because the code here tried to force-cast a non-nullable list of nullable PlaceholderDimensions into a nullable list of non-nullable PlaceholderDimensions.

Not working with Flutter 1.15 (master channel): TextOneLine is missing implementations.

Using assorted_layout_widgets: ^1.0.15 and sdk: ">=2.3.0 <3.0.0" I'm getting this error when I've added RowSuper to a widget:

Compiler message:
../../../flutter/.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.0.15/lib/src/text_one_line.dart:19:7: Error: The non-abstract class 'TextOneLine' is missing implementations for these members:
 - Text.textHeightBehavior
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class TextOneLine extends StatelessWidget implements Text {
      ^^^^^^^^^^^
../../../flutter/packages/flutter/lib/src/widgets/text.dart:432:31: Context: 'Text.textHeightBehavior' is defined here.
  final ui.TextHeightBehavior textHeightBehavior;
                              ^^^^^^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.0.15/lib/src/text_one_line.dart:200:7: Error: The non-abstract class 'RenderParagraphX' is missing implementations for these members:
 - RenderParagraph.textHeightBehavior
 - RenderParagraph.textHeightBehavior=
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class RenderParagraphX extends RenderBox
      ^^^^^^^^^^^^^^^^
../../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:281:29: Context: 'RenderParagraph.textHeightBehavior' is defined here.
  ui.TextHeightBehavior get textHeightBehavior => _textPainter.textHeightBehavior;
                            ^^^^^^^^^^^^^^^^^^
../../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:282:7: Context: 'RenderParagraph.textHeightBehavior=' is defined here.
  set textHeightBehavior(ui.TextHeightBehavior value) {
      ^^^^^^^^^^^^^^^^^^

Incompatible with the latest Flutter beta (2.5.0-5.1.pre)

../../../../.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-5.0.2/lib/src/text_one_line_ellipsis_with_fade.dart:995:20: Error: The method 'RenderParagraphX.getBoxesForSelection' has fewer named arguments than those of overridden method 'RenderParagraph.getBoxesForSelection'.
  List<ui.TextBox> getBoxesForSelection(TextSelection selection) {

TextField in RowSuper

Hi,
When I'm putting 2 TextField in a RowSuper, and start to type to one of TextField, the aspect of 2 TextFiel was changed. Now its not 50%/50%, but 70/30, 80/20, ...
The more I write into one of them than the other, it takes up more space.

How can I prevent this?

My target is the 2 TextField stays 50%50% ratio as original.

image
image

Thanks,
Gabor

Z-indexes in RowSuper and ColumnSuper

Hey, I was wondering if it's possible to programmatically decide which child displays on top with ColumnSuper or RowSuper (RowSuper specifically), since they allow widgets to overlap.

Is there something like flexShrink in css?

I have a row with text on the left and some icons on the right. I want the icon to be just next to the text all the time.

The Row will push the icons away if the text is too long, and the RowSuper that you created will shrink the icons if there is not enough space.

Is there something like flex_shrink in your library to allow a widget (the text in my case) to expand only if the row overflow?

RowSuper flex

Hi!
RowSuper has fill attribute which affects all children of the row.
I would like to fill all remaining space by only one last child.
I have tried using Expanded, SizedBox.expand or Container(width: double.infinity) bot none of them worked.
Is it possible?

TextOneLine: Letterspacing rendered different

image

Code to reproduce (assuming usage of GoogleFonts package)

 final TextStyle style = GoogleFonts.inter(
      fontSize: 10,
      fontWeight: FontWeight.w500,
      letterSpacing: 1.1,
    );
    const String textValue =
        'Consectetur adipiscing elit. Et sept en andor cras massa mass';

    return Padding(
      padding: const EdgeInsets.all(16.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          TextOneLine(
            textValue,
            style: style,
          ),
          const SizedBox(height: 4.0),
          Text(
            textValue,
            style: style,
            maxLines: 1,
            overflow: TextOverflow.ellipsis,
          ),
        ],
      ),
    );`

TextOneLine seems to render extra letter spacing, This is also the case with a default letter spacing, giving it a higher value seems to make the difference even greater.

TextOneLine changes height

Hi there! I have 1 line text and it shows height 18 in the inspector and with your TextOneLine it becomes 27, which breaks layout.

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.