saltyaom / niku Goto Github PK
View Code? Open in Web Editor NEWCompose Flutter UI from utilities Widget and extensions with dot cascade. Fluently developing without headache and Nested Hell.
Home Page: https://niku.saltyaom.com
License: Other
Compose Flutter UI from utilities Widget and extensions with dot cascade. Fluently developing without headache and Nested Hell.
Home Page: https://niku.saltyaom.com
License: Other
When inserting Widget
children through NikuWrap
method, TypeErrorImpl
will be thrown when the list subtype of NikuWrap
constructor doesn't match with the subtype of the inserting child. Although _children
property in NikuWrap
constructor accepts any inherited Widget
subtype.
Example
List<NikuColumn> someRandomColumnList = [1, 2, 3, 4].map((e) => NikuColumn(NikuText('$e'))).toList();
Container randomContainer = Container();
// This will throw an error. Expected a value of type 'NikuColumn', but got one of type 'Container'.
return NikuWrap(someRandomColumnList).insert(0, randomContainer);
// This also throw an error.
return NikuWrap(someRandomColumnList).append(randomContainer);
// But this will not.
return NIkuWrap(someRandomColumnList);
// This will not.
List<Widget> widgetList = someRandomColumnList.map((e) => e.build(context)).toList()
return NikuWrap(widgetList); // Build NikuColumn into generic `Widget` type first.
// This also not.
return NikuWrap(widgetList).append(randomContainer);
This might be an issue with dart forcing typecast into the parent subclass with assigning the _children
property.
Widget content is being replaced with the last Widget
which has the same applied style. This is happening after hot reload
.
Previously styled widgets are not being replaced with the last Widget which shares the same style.
class RowStyle {
static final labelInput = n.Row(const [])
..px = 15
..pb = 18
..pt = 10
..gap = 10;
}
class TextStyleNiku {
static final labelInput = "".n
..mx = 15
..fontSize = 13;
}
// .....
n.Column([
"Jual / Beli:".n
..apply = TextStyleNiku.labelInput.copied, // first text style
// .....
"Kode saham:".n
..apply = TextStyleNiku.labelInput.copied, // last text style
// .....
sdk: '>=2.18.5 <3.0.0'
niku: ^2.3.3
flutter: 3.3.10
Please help, when i compile the app shows me a error, i use Flutter 3.16.0
hosted/pub.dev/niku-2.4.2/lib/widget/textFormField.dart:877:18: Error: The argument type 'bool?' can't be assigned to the parameter type 'bool' because 'bool?' is nullable and 'bool' isn't. enabled: enabled
Thanks.
Can you give me some Widgets the effect diagram and corresponding code
Can't use Niku with the new Flutter 3.
Update to 2.3.0-experimental.2
Here's a screenshot of Niku with Flutter 3 running on Apple Silicon MacOS.
I have no idea how or why Niku breaks on Flutter 3.
However, Niku 2.3 implemented an internal architecture rewrite known as Tempest Engine which for some reason doesn't break all the thing.
As it's a confirmed candidate for the next version of Niku and I have tested it a lot before publishing it as experimental, you should be able to use it without much breaking change (only 2 breaking changes which shouldn't affect a lot of people).
Also, I'll leave this issue open until the stable release of Niku 2.3.
So, yeah, if you encounter the problem and found a bug, feel free to report it by filing a new issue.
expands
method on nikuTextField
will throw assertion error when ran because maxLines
and minLines
property can't be set to null
.
When build this
NikuTextField("yoyo")
.expands()
.niku()
.height(200)
.width(200),
will throws
The following assertion was thrown building Builder(dirty):
Assertion failed:
!expands || (maxLines == null && minLines == null)
"minLines and maxLines must be null when expands is true."
...
So, The expected property would be,
NikuTextField("yoyo")
.maxLines(null) // currently not nullable
.minLines(null) // currently not nullable
.expands()
.niku()
.height(200)
.width(200),
flutter pub get niku
error with flutter 3.3.0
.env:
The location of the error code:
niku-2.3.2/lib/widget/niku.dart:1048:25
error log:
../../../../../../.pub-cache/hosted/pub.flutter-io.cn/niku-2.3.2/lib/widget/niku.dart:1048:25: Error: The argument type 'BorderRadiusGeometry?' can't be assigned to the parameter type 'BorderRadius?'.
- 'BorderRadiusGeometry' is from 'package:flutter/src/painting/border_radius.dart' ('../../../../../../.fvm/versions/3.3.0/packages/flutter/lib/src/painting/border_radius.dart').
- 'BorderRadius' is from 'package:flutter/src/painting/border_radius.dart' ('../../../../../../.fvm/versions/3.3.0/packages/flutter/lib/src/painting/border_radius.dart').
borderRadius: radius,
^
Command PhaseScriptExecution failed with a nonzero exit code
The argument type 'void Function()?' can't be assigned to the parameter type 'void Function()'.
NikuButton can't be disabled because one can't pass "null" in onPressed.
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.