Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rodydavis committed Nov 21, 2024
1 parent 84690e4 commit 8970839
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 100 deletions.
2 changes: 1 addition & 1 deletion examples/dart_mappable_example/lib/graph_signal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ class GraphSignal extends Signal<Graph> implements Graph {

@override
String toJson() => super.toJson();
}
}
26 changes: 16 additions & 10 deletions examples/node_based_editor/lib/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,22 @@ class _EditorState extends State<Editor> {
IconButton(
icon: const Icon(Icons.zoom_in),
tooltip: 'Zoom In',
onPressed: () => matrix.set(force: true, matrix.value
..translate(size.width / 2, size.height / 2)
..scale(1.1, 1.1)
..translate(-(size.width / 2), -(size.height / 2))),
onPressed: () => matrix.set(
force: true,
matrix.value
..translate(size.width / 2, size.height / 2)
..scale(1.1, 1.1)
..translate(-(size.width / 2), -(size.height / 2))),
),
IconButton(
icon: const Icon(Icons.zoom_out),
tooltip: 'Zoom Out',
onPressed: () => matrix.set(force: true, matrix.value
..translate(size.width / 2, size.height / 2)
..scale(0.9, 0.9)
..translate(-(size.width / 2), -(size.height / 2))),
onPressed: () => matrix.set(
force: true,
matrix.value
..translate(size.width / 2, size.height / 2)
..scale(0.9, 0.9)
..translate(-(size.width / 2), -(size.height / 2))),
),
Watch((context) {
return IconButton(
Expand Down Expand Up @@ -103,8 +107,10 @@ class _EditorState extends State<Editor> {
child: SizedBox.expand(
child: GestureDetector(
onPanUpdate: (details) {
matrix.set(force: true, matrix.value
..translate(details.delta.dx, details.delta.dy));
matrix.set(
force: true,
matrix.value
..translate(details.delta.dx, details.delta.dy));
},
child: CustomPaint(
painter: NodeEdges(matrix(), nodes, selection),
Expand Down
4 changes: 0 additions & 4 deletions packages/signals_core/lib/signals_core.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// Core signals library
library signals_core;

export 'src/devtool.dart';
export 'src/async/connect.dart';
export 'src/extensions/future.dart';
Expand All @@ -26,4 +23,3 @@ export 'src/mixins/set.dart';
export 'src/mixins/map.dart';
export 'src/mixins/queue.dart';
export 'src/mixins/tracked.dart';

56 changes: 28 additions & 28 deletions packages/signals_core/lib/src/async/connect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ import '../core/signals.dart';

/// {@template connect}
/// The idea for `connect` comes from Anguar Signals with RxJS:
///
///
/// <iframe width="560" height="315" src="https://www.youtube.com/embed/R7-KdADEq0A?si=kK8XasbBedE3sPrR" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
///
///
/// Start with a signal and then use the `connect` method to create a connector.
/// Streams will feed Signal value.
///
///
/// ```dart
/// final s = signal(0);
/// final c = connect(s);
/// ```
///
///
/// ### to
///
///
/// Add streams to the connector.
///
///
/// ```dart
/// final s = signal(0);
/// final c = connect(s);
///
///
/// final s1 = Stream.value(1);
/// final s2 = Stream.value(2);
///
///
/// c.from(s1).from(s2); // These can be chained
/// ```
///
///
/// ### dispose
///
///
/// Cancel all subscriptions.
///
///
/// ```dart
/// final s = signal(0);
/// final c = connect(s);
///
///
/// final s1 = Stream.value(1);
/// final s2 = Stream.value(2);
///
///
/// c.from(s1).from(s2);
/// // or
/// c << s1 << s2
///
///
/// c.dispose(); // This will cancel all subscriptions
/// ```
/// @link https://dartsignals.dev/async/connect
Expand Down Expand Up @@ -111,46 +111,46 @@ class Connect<T, S extends T> {

/// {@template connect}
/// The idea for `connect` comes from Anguar Signals with RxJS:
///
///
/// <iframe width="560" height="315" src="https://www.youtube.com/embed/R7-KdADEq0A?si=kK8XasbBedE3sPrR" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
///
///
/// Start with a signal and then use the `connect` method to create a connector.
/// Streams will feed Signal value.
///
///
/// ```dart
/// final s = signal(0);
/// final c = connect(s);
/// ```
///
///
/// ### to
///
///
/// Add streams to the connector.
///
///
/// ```dart
/// final s = signal(0);
/// final c = connect(s);
///
///
/// final s1 = Stream.value(1);
/// final s2 = Stream.value(2);
///
///
/// c.from(s1).from(s2); // These can be chained
/// ```
///
///
/// ### dispose
///
///
/// Cancel all subscriptions.
///
///
/// ```dart
/// final s = signal(0);
/// final c = connect(s);
///
///
/// final s1 = Stream.value(1);
/// final s2 = Stream.value(2);
///
///
/// c.from(s1).from(s2);
/// // or
/// c << s1 << s2
///
///
/// c.dispose(); // This will cancel all subscriptions
/// ```
/// @link https://dartsignals.dev/async/connect
Expand Down
Loading

0 comments on commit 8970839

Please sign in to comment.