diff --git a/CHANGELOG.md b/CHANGELOG.md index c0cb844..f1eb0b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.1.1 +* Added curvature tension between pivot point of segmented arrows. + ## 3.1.0 * Implemented styling new arrows (thanks to Isira Herath) diff --git a/example/lib/main.dart b/example/lib/main.dart index 2c5955d..6cec1eb 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,5 @@ // ignore_for_file: public_member_api_docs -import 'dart:io'; - import 'package:example/element_settings_menu.dart'; import 'package:example/text_menu.dart'; import 'package:flutter/material.dart'; @@ -41,7 +39,7 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State { - Dashboard dashboard = Dashboard(defaultArrowStyle: ArrowStyle.segmented); + Dashboard dashboard = Dashboard(); /// Notifier for the tension slider final segmentedTension = ValueNotifier(1); @@ -159,7 +157,11 @@ class _MyHomePageState extends State { dashboard.dashboardSize.height / 2, ), ), - onItemTapped: (index, controller) => controller.closeMenu!(), + onItemTapped: (index, controller) { + if (index != 2) { + controller.closeMenu!(); + } + }, items: [ FloatingActionButton( child: const Icon(Icons.delete), @@ -177,8 +179,8 @@ class _MyHomePageState extends State { builder: (_, tension, __) { return Wrap( children: [ - OutlinedButton( - child: const Text('segmented'), + ActionChip( + label: const Text('segmented'), onPressed: () { dashboard.setArrowStyleByHandler( element, @@ -208,8 +210,8 @@ class _MyHomePageState extends State { ); }, ), - OutlinedButton( - child: const Text('curved'), + ActionChip( + label: const Text('curved'), onPressed: () { dashboard.setArrowStyleByHandler( element, @@ -218,8 +220,8 @@ class _MyHomePageState extends State { ); }, ), - OutlinedButton( - child: const Text('rectangular'), + ActionChip( + label: const Text('rectangular'), onPressed: () { dashboard.setArrowStyleByHandler( element, @@ -253,9 +255,6 @@ class _MyHomePageState extends State { ), onHoverScale: 1.1, centerOffset: position - const Offset(50, 0), - backgroundParams: const BackgroundParams( - backgroundColor: Colors.transparent, - ), boundaryBackground: BoundaryBackground( padding: const EdgeInsets.all(16), decoration: BoxDecoration( diff --git a/example/pubspec.lock b/example/pubspec.lock index 4dceaf4..6b000fb 100755 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -100,7 +100,7 @@ packages: path: ".." relative: true source: path - version: "3.1.0" + version: "3.1.1" flutter_test: dependency: "direct dev" description: flutter diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 1818ece..c68b2df 100755 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -13,10 +13,10 @@ dependencies: flutter_flow_chart: path: ../ - cupertino_icons: ^1.0.6 + cupertino_icons: ^1.0.8 # https://pub.dev/packages/star_menu - star_menu: ^4.0.0 + star_menu: ^4.0.1 # https://pub.dev/packages/path_provider path_provider: ^2.1.3 diff --git a/images/flowchart.gif b/images/flowchart.gif index 379cdc1..2563b01 100644 Binary files a/images/flowchart.gif and b/images/flowchart.gif differ diff --git a/images/flowchart.mp4 b/images/flowchart.mp4 index 6d386d5..57e5240 100644 Binary files a/images/flowchart.mp4 and b/images/flowchart.mp4 differ diff --git a/lib/src/elements/connection_params.dart b/lib/src/elements/connection_params.dart index 71e9e40..87d3d32 100755 --- a/lib/src/elements/connection_params.dart +++ b/lib/src/elements/connection_params.dart @@ -20,7 +20,9 @@ class ConnectionParams { arrowParams: ArrowParams.fromMap(map['arrowParams'] as Map), pivots: (map['pivots'] as List?) - ?.map((pivot) => Pivot.fromMap(pivot)) + ?.map( + (pivot) => Pivot.fromMap(pivot as Map), + ) .toList() ?? [], ); diff --git a/lib/src/ui/element_handlers.dart b/lib/src/ui/element_handlers.dart index f356cae..ff203da 100755 --- a/lib/src/ui/element_handlers.dart +++ b/lib/src/ui/element_handlers.dart @@ -181,7 +181,7 @@ class _ElementHandler extends StatelessWidget { ); }, builder: (context, candidateData, rejectedData) { - return Draggable( + return Draggable( feedback: const SizedBox.shrink(), feedbackOffset: dashboard.handlerFeedbackOffset, childWhenDragging: HandlerWidget( diff --git a/pubspec.yaml b/pubspec.yaml index a970a56..6176b9e 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_flow_chart description: draw a flow chart diagram with different kind of customizable elements. Dashboards can be saved for later use. -version: 3.1.0 +version: 3.1.1 homepage: https://github.com/alnitak/flutter_flow_chart environment: