Skip to content

Commit 6eca1c7

Browse files
committed
v6.29.0
1 parent 46bb362 commit 6eca1c7

File tree

12 files changed

+354
-132
lines changed

12 files changed

+354
-132
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [6.29.0] - 2025-06-20
2+
3+
* Added new `visibleWhen` extension to `Widget` class. This will allow you to show or hide a widget based on a condition.
4+
* Added `onPop` to the `pushTo` method. This will allow you to receive a callback when the page is popped.
5+
* Added `removeFromIndex` to NyPullToRefresh. This will allow you to remove an item from the list at a specific index.
6+
* Bug fix for `NyTextField` onChanged method.
7+
* Fix analysis_options.yaml
8+
* Update pubspec.yaml
9+
110
## [6.28.5] - 2025-05-23
211

312
* Fix: `getEnv` helper to return an empty string if a variable is set like this `APP_WEBSITE=""`

analysis_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# packages, and plugins designed to encourage good coding practices.
1010
analyzer:
1111
errors:
12-
non_constant_identifier_names: ignore ignore ignore
13-
camel_case_types: ignore ignore
12+
non_constant_identifier_names: ignore
13+
camel_case_types: ignore
1414
include: package:flutter_lints/flutter.yaml
1515

1616
linter:

example/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ packages:
419419
path: ".."
420420
relative: true
421421
source: path
422-
version: "6.28.5"
422+
version: "6.29.0"
423423
path:
424424
dependency: transitive
425425
description:
@@ -789,10 +789,10 @@ packages:
789789
dependency: transitive
790790
description:
791791
name: win32
792-
sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba"
792+
sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
793793
url: "https://pub.dev"
794794
source: hosted
795-
version: "5.13.0"
795+
version: "5.14.0"
796796
xdg_directories:
797797
dependency: transitive
798798
description:
@@ -810,5 +810,5 @@ packages:
810810
source: hosted
811811
version: "6.5.0"
812812
sdks:
813-
dart: ">=3.7.0 <4.0.0"
813+
dart: ">=3.8.0 <4.0.0"
814814
flutter: ">=3.31.0-0.0.pre"

lib/dart_console/src/ffi/win/termlib_win.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ class TermLibWindows implements TermLib {
2323

2424
@override
2525
void enableRawMode() {
26-
final dwMode = (~CONSOLE_MODE.ENABLE_ECHO_INPUT) &
27-
(~CONSOLE_MODE.ENABLE_PROCESSED_INPUT) &
28-
(~CONSOLE_MODE.ENABLE_LINE_INPUT) &
29-
(~CONSOLE_MODE.ENABLE_WINDOW_INPUT);
26+
final dwMode = (~ENABLE_ECHO_INPUT) &
27+
(~ENABLE_PROCESSED_INPUT) &
28+
(~ENABLE_LINE_INPUT) &
29+
(~ENABLE_WINDOW_INPUT);
3030
SetConsoleMode(inputHandle, dwMode);
3131
}
3232

3333
@override
3434
void disableRawMode() {
35-
final dwMode = CONSOLE_MODE.ENABLE_ECHO_INPUT &
36-
CONSOLE_MODE.ENABLE_EXTENDED_FLAGS &
37-
CONSOLE_MODE.ENABLE_INSERT_MODE &
38-
CONSOLE_MODE.ENABLE_LINE_INPUT &
39-
CONSOLE_MODE.ENABLE_MOUSE_INPUT &
40-
CONSOLE_MODE.ENABLE_PROCESSED_INPUT &
41-
CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE &
42-
CONSOLE_MODE.ENABLE_VIRTUAL_TERMINAL_INPUT;
35+
final dwMode = ENABLE_ECHO_INPUT &
36+
ENABLE_EXTENDED_FLAGS &
37+
ENABLE_INSERT_MODE &
38+
ENABLE_LINE_INPUT &
39+
ENABLE_MOUSE_INPUT &
40+
ENABLE_PROCESSED_INPUT &
41+
ENABLE_QUICK_EDIT_MODE &
42+
ENABLE_VIRTUAL_TERMINAL_INPUT;
4343
SetConsoleMode(inputHandle, dwMode);
4444
}
4545

@@ -99,7 +99,7 @@ class TermLibWindows implements TermLib {
9999
}
100100

101101
TermLibWindows() {
102-
outputHandle = GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
103-
inputHandle = GetStdHandle(STD_HANDLE.STD_INPUT_HANDLE);
102+
outputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
103+
inputHandle = GetStdHandle(STD_INPUT_HANDLE);
104104
}
105105
}

lib/helpers/extensions.dart

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,14 @@ extension NyColumn on Column {
633633
child: this,
634634
);
635635
}
636+
637+
/// Make a widget visible when a condition is true.
638+
Widget visibleWhen(bool condition) {
639+
return Visibility(
640+
visible: condition,
641+
child: this,
642+
);
643+
}
636644
}
637645

638646
/// Extensions for [Image]
@@ -766,20 +774,28 @@ extension NySingleChildRenderObjectWidget on SingleChildRenderObjectWidget {
766774
child: this,
767775
);
768776
}
777+
778+
/// Make a widget visible when a condition is true.
779+
Widget visibleWhen(bool condition) {
780+
return Visibility(
781+
visible: condition,
782+
child: this,
783+
);
784+
}
769785
}
770786

771787
/// Extensions for [String]
772788
extension NyString on String {
773789
/// dump the value to the console.
774790
/// [tag] is optional.
775791
/// [alwaysPrint] is optional.
776-
dump({String? tag, bool alwaysPrint = false}) {
792+
void dump({String? tag, bool alwaysPrint = false}) {
777793
NyLogger.dump(toString(), tag, alwaysPrint: alwaysPrint);
778794
}
779795

780796
/// dump the value to the console and exit the app.
781797
/// [tag] is optional.
782-
dd({String? tag}) {
798+
void dd({String? tag}) {
783799
NyLogger.dump(toString(), tag);
784800
exit(0);
785801
}
@@ -887,6 +903,14 @@ extension NyStatelessWidget on StatelessWidget {
887903
);
888904
}
889905

906+
/// Make a widget visible when a condition is true.
907+
Widget visibleWhen(bool condition) {
908+
return Visibility(
909+
visible: condition,
910+
child: this,
911+
);
912+
}
913+
890914
/// Add a shadow to the container.
891915
Container shadow(int strength,
892916
{Color? color,
@@ -1145,6 +1169,14 @@ extension NyBoxScrollView on BoxScrollView {
11451169
child: this,
11461170
);
11471171
}
1172+
1173+
/// Make a widget visible when a condition is true.
1174+
Widget visibleWhen(bool condition) {
1175+
return Visibility(
1176+
visible: condition,
1177+
child: this,
1178+
);
1179+
}
11481180
}
11491181

11501182
/// Extensions for [Row]
@@ -1244,6 +1276,14 @@ extension NyRow on Row {
12441276
),
12451277
);
12461278
}
1279+
1280+
/// Make a widget visible when a condition is true.
1281+
Widget visibleWhen(bool condition) {
1282+
return Visibility(
1283+
visible: condition,
1284+
child: this,
1285+
);
1286+
}
12471287
}
12481288

12491289
/// Extensions for [Text]

lib/widgets/ny_base_state.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ abstract class NyBaseState<T extends StatefulWidget> extends State<T> {
849849
}
850850

851851
/// Push to a new page
852-
pushTo(Widget page, {dynamic data}) {
852+
void pushTo(Widget page, {dynamic data, Function(dynamic value)? onPop}) {
853853
Navigator.of(context).push(
854854
MaterialPageRoute(
855855
builder: (BuildContext context) {
@@ -859,7 +859,11 @@ abstract class NyBaseState<T extends StatefulWidget> extends State<T> {
859859
return page;
860860
},
861861
),
862-
);
862+
).then((value) {
863+
if (onPop != null) {
864+
onPop(value);
865+
}
866+
});
863867
}
864868

865869
/// Get the color based on the device mode
@@ -884,7 +888,7 @@ abstract class NyBaseState<T extends StatefulWidget> extends State<T> {
884888
/// routeToInitial();
885889
/// }
886890
/// });
887-
whenStateAction(Map<String, Function> actions) {
891+
void whenStateAction(Map<String, Function> actions) {
888892
_stateActions = actions;
889893
}
890894

lib/widgets/ny_form.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,12 +1209,12 @@ class Field {
12091209
bool? readOnly;
12101210

12111211
/// Hide the field
1212-
hide() {
1212+
void hide() {
12131213
hidden = true;
12141214
}
12151215

12161216
/// Show the field
1217-
show() {
1217+
void show() {
12181218
hidden = false;
12191219
}
12201220

0 commit comments

Comments
 (0)