marcglasberg / assorted_layout_widgets Goto Github PK
View Code? Open in Web Editor NEWFlutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.
License: BSD 2-Clause "Simplified" License
Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.
License: BSD 2-Clause "Simplified" License
remove that and the example works
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.
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:
Items in WrapSuper are arranged from left to right and it isn't affected by the Directionality widget.
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
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 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;
When inspecting the code for TextOneLine we saw this:
String? get data => super.data == null ? null : Characters(super.data!).toList().join("\u{200B}");
why is that?
Some changes in version 6.0.0 introduced changes specific to Flutter 3 only.
It would be great to support both Flutter 2 and 3 there using approach similar to this
More details are at https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0#your-code
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.
pls fix it
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?
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.
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.
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) {
^^^^^^^^^^^^^^^^^^
../../../../.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) {
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.
Thanks,
Gabor
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.
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?
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?
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.
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.
This combination results in a division by zero
FitHorizontally(
fitsHeight: false,
shrinkLimit: 0.0,
child: //...
)
assorted_layout_widgets/lib/src/fit_horizontally.dart
Lines 191 to 192 in c0e1a25
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.