Skip to content

Commit acf7914

Browse files
committed
feat: release v7.13.0
1 parent e69b918 commit acf7914

10 files changed

Lines changed: 151 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [7.13.0] - 2026-03-31
2+
3+
### Added
4+
5+
* **Satellite connectivity support for `Connective` widget and `NyConnectivityState`** - Added `satellite` value to the `NyConnectivityState` enum with mapping from `ConnectivityResult.satellite`, and added `onSatellite` widget parameter to `Connective` for rendering satellite-specific UI
6+
* **Wildcard `*` key for `StyledText.template` styles and onTap** - When no exact or pipe-delimited key matches a placeholder, the styles/onTap map now falls back to a `*` wildcard key, allowing a single style or tap handler to apply to all placeholders
7+
8+
### Changed
9+
10+
* Updated dependency constraint: `connectivity_plus` ^7.1.0
11+
112
## [7.12.0] - 2026-03-29
213

314
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import 'package:nylo_support/widgets/ny_widgets.dart';
4949

5050
```yaml
5151
dependencies:
52-
nylo_support: ^7.12.0
52+
nylo_support: ^7.13.0
5353
```
5454
5555
### Documentation

example/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,18 @@ packages:
8585
dependency: transitive
8686
description:
8787
name: connectivity_plus
88-
sha256: "33bae12a398f841c6cda09d1064212957265869104c478e5ad51e2fb26c3973c"
88+
sha256: b8fe52979ff12432ecf8f0abf6ff70410b1bb734be1c9e4f2f86807ad7166c79
8989
url: "https://pub.dev"
9090
source: hosted
91-
version: "7.0.0"
91+
version: "7.1.0"
9292
connectivity_plus_platform_interface:
9393
dependency: transitive
9494
description:
9595
name: connectivity_plus_platform_interface
96-
sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204"
96+
sha256: "3c09627c536d22fd24691a905cdd8b14520de69da52c7a97499c8be5284a32ed"
9797
url: "https://pub.dev"
9898
source: hosted
99-
version: "2.0.1"
99+
version: "2.1.0"
100100
convert:
101101
dependency: transitive
102102
description:

lib/helpers/src/ny_connectivity.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,16 @@ class NyConnectivity {
145145
}
146146

147147
/// Connectivity state enum for NyConnective widget.
148-
enum NyConnectivityState { wifi, mobile, ethernet, vpn, bluetooth, other, none }
148+
enum NyConnectivityState {
149+
wifi,
150+
mobile,
151+
ethernet,
152+
vpn,
153+
bluetooth,
154+
satellite,
155+
other,
156+
none,
157+
}
149158

150159
/// Extension to convert ConnectivityResult to NyConnectivityState.
151160
extension ConnectivityResultExtension on ConnectivityResult {
@@ -165,6 +174,8 @@ extension ConnectivityResultExtension on ConnectivityResult {
165174
return NyConnectivityState.other;
166175
case ConnectivityResult.none:
167176
return NyConnectivityState.none;
177+
case ConnectivityResult.satellite:
178+
return NyConnectivityState.satellite;
168179
}
169180
}
170181
}

lib/widgets/src/connective.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class Connective extends StatefulWidget {
4545
/// Widget to show when connected via Bluetooth.
4646
final Widget? onBluetooth;
4747

48+
/// Widget to show when connected via Satellite.
49+
final Widget? onSatellite;
50+
4851
/// Widget to show for other connection types.
4952
final Widget? onOther;
5053

@@ -83,6 +86,7 @@ class Connective extends StatefulWidget {
8386
this.onEthernet,
8487
this.onVpn,
8588
this.onBluetooth,
89+
this.onSatellite,
8690
this.onOther,
8791
this.onNone,
8892
this.child,
@@ -103,6 +107,7 @@ class Connective extends StatefulWidget {
103107
onEthernet = null,
104108
onVpn = null,
105109
onBluetooth = null,
110+
onSatellite = null,
106111
onOther = null,
107112
onNone = null,
108113
child = null;
@@ -168,6 +173,9 @@ class _ConnectiveState extends State<Connective> {
168173
if (results.contains(ConnectivityResult.bluetooth)) {
169174
return NyConnectivityState.bluetooth;
170175
}
176+
if (results.contains(ConnectivityResult.satellite)) {
177+
return NyConnectivityState.satellite;
178+
}
171179
if (results.contains(ConnectivityResult.other)) {
172180
return NyConnectivityState.other;
173181
}
@@ -198,6 +206,7 @@ class _ConnectiveState extends State<Connective> {
198206
NyConnectivityState.ethernet => widget.onEthernet,
199207
NyConnectivityState.vpn => widget.onVpn,
200208
NyConnectivityState.bluetooth => widget.onBluetooth,
209+
NyConnectivityState.satellite => widget.onSatellite,
201210
NyConnectivityState.other => widget.onOther,
202211
NyConnectivityState.none => widget.onNone,
203212
};

lib/widgets/src/styled_text.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ import 'package:flutter/material.dart';
4646
/// )
4747
/// ```
4848
///
49+
/// Example using wildcard `*` to style all placeholders:
50+
/// ```dart
51+
/// StyledText.template(
52+
/// "Hello {{name}}, welcome to {{app}}!",
53+
/// styles: {
54+
/// "*": TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
55+
/// },
56+
/// )
57+
/// ```
58+
///
4959
/// Example using template text with localization (`{{key:text}}` syntax):
5060
/// ```dart
5161
/// StyledText.template(
@@ -190,6 +200,11 @@ class _StyledTextState extends State<StyledText> {
190200
}
191201
}
192202

203+
// Wildcard fallback
204+
if (map.containsKey('*')) {
205+
return map['*'];
206+
}
207+
193208
return null;
194209
}
195210

pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,18 @@ packages:
8585
dependency: "direct main"
8686
description:
8787
name: connectivity_plus
88-
sha256: "33bae12a398f841c6cda09d1064212957265869104c478e5ad51e2fb26c3973c"
88+
sha256: b8fe52979ff12432ecf8f0abf6ff70410b1bb734be1c9e4f2f86807ad7166c79
8989
url: "https://pub.dev"
9090
source: hosted
91-
version: "7.0.0"
91+
version: "7.1.0"
9292
connectivity_plus_platform_interface:
9393
dependency: transitive
9494
description:
9595
name: connectivity_plus_platform_interface
96-
sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204"
96+
sha256: "3c09627c536d22fd24691a905cdd8b14520de69da52c7a97499c8be5284a32ed"
9797
url: "https://pub.dev"
9898
source: hosted
99-
version: "2.0.1"
99+
version: "2.1.0"
100100
convert:
101101
dependency: transitive
102102
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_support
22
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
3-
version: 7.12.0
3+
version: 7.13.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/7.x
66
issue_tracker: https://github.com/nylo-core/support/issues
@@ -40,7 +40,7 @@ dependencies:
4040
mask_text_input_formatter: ^2.9.0
4141
uuid: ^4.5.3
4242
characters: ^1.4.1
43-
connectivity_plus: ^7.0.0
43+
connectivity_plus: ^7.1.0
4444
url_launcher: ^6.3.2
4545
flutter_web_plugins:
4646
sdk: flutter

test/helpers/ny_connectivity_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void main() {
88

99
nyGroup('NyConnectivityState', () {
1010
nyTest('should have all expected values', () async {
11-
expect(NyConnectivityState.values, hasLength(7));
11+
expect(NyConnectivityState.values, hasLength(8));
1212
expect(NyConnectivityState.values, contains(NyConnectivityState.wifi));
1313
expect(NyConnectivityState.values, contains(NyConnectivityState.mobile));
1414
expect(
@@ -20,6 +20,10 @@ void main() {
2020
NyConnectivityState.values,
2121
contains(NyConnectivityState.bluetooth),
2222
);
23+
expect(
24+
NyConnectivityState.values,
25+
contains(NyConnectivityState.satellite),
26+
);
2327
expect(NyConnectivityState.values, contains(NyConnectivityState.other));
2428
expect(NyConnectivityState.values, contains(NyConnectivityState.none));
2529
});

test/widgets/styled_text_test.dart

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,94 @@ void main() {
155155
});
156156
});
157157

158+
nyGroup('wildcard * key', () {
159+
testWidgets('applies style to all placeholders', (tester) async {
160+
final wildcardStyle = TextStyle(
161+
color: Colors.blue,
162+
fontWeight: FontWeight.bold,
163+
);
164+
await tester.pumpWidget(
165+
MaterialApp(
166+
home: StyledText.template(
167+
"Hello {{name}}, welcome to {{app}}!",
168+
styles: {"*": wildcardStyle},
169+
),
170+
),
171+
);
172+
173+
final spans = _extractSpans(tester);
174+
expect(spans[0].text, 'Hello ');
175+
expect(spans[1].text, 'name');
176+
expect(spans[1].style!.color, Colors.blue);
177+
expect(spans[1].style!.fontWeight, FontWeight.bold);
178+
expect(spans[2].text, ', welcome to ');
179+
expect(spans[3].text, 'app');
180+
expect(spans[3].style!.color, Colors.blue);
181+
expect(spans[3].style!.fontWeight, FontWeight.bold);
182+
expect(spans[4].text, '!');
183+
});
184+
185+
testWidgets('exact key overrides wildcard', (tester) async {
186+
final wildcardStyle = TextStyle(color: Colors.blue);
187+
final nameStyle = TextStyle(color: Colors.red);
188+
await tester.pumpWidget(
189+
MaterialApp(
190+
home: StyledText.template(
191+
"Hello {{name}}, welcome to {{app}}!",
192+
styles: {"*": wildcardStyle, "name": nameStyle},
193+
),
194+
),
195+
);
196+
197+
final spans = _extractSpans(tester);
198+
expect(spans[1].text, 'name');
199+
expect(spans[1].style!.color, Colors.red);
200+
expect(spans[3].text, 'app');
201+
expect(spans[3].style!.color, Colors.blue);
202+
});
203+
204+
testWidgets('pipe key overrides wildcard', (tester) async {
205+
final wildcardStyle = TextStyle(color: Colors.blue);
206+
final pipeStyle = TextStyle(color: Colors.green);
207+
await tester.pumpWidget(
208+
MaterialApp(
209+
home: StyledText.template(
210+
"{{a}}, {{b}}, {{c}}",
211+
styles: {"*": wildcardStyle, "a|b": pipeStyle},
212+
),
213+
),
214+
);
215+
216+
final spans = _extractSpans(tester);
217+
expect(spans[0].text, 'a');
218+
expect(spans[0].style!.color, Colors.green);
219+
expect(spans[2].text, 'b');
220+
expect(spans[2].style!.color, Colors.green);
221+
expect(spans[4].text, 'c');
222+
expect(spans[4].style!.color, Colors.blue);
223+
});
224+
225+
testWidgets('wildcard onTap applies to all placeholders', (tester) async {
226+
int tapCount = 0;
227+
await tester.pumpWidget(
228+
MaterialApp(
229+
home: StyledText.template(
230+
"{{a}} and {{b}}",
231+
onTap: {"*": () => tapCount++},
232+
),
233+
),
234+
);
235+
236+
final spans = _extractSpans(tester);
237+
expect(spans[0].recognizer, isA<TapGestureRecognizer>());
238+
expect(spans[2].recognizer, isA<TapGestureRecognizer>());
239+
240+
(spans[0].recognizer as TapGestureRecognizer).onTap!();
241+
(spans[2].recognizer as TapGestureRecognizer).onTap!();
242+
expect(tapCount, 2);
243+
});
244+
});
245+
158246
nyGroup('localization simulation', () {
159247
testWidgets('same keys render different display text per locale', (
160248
tester,

0 commit comments

Comments
 (0)