Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
alnitak committed Jun 6, 2024
1 parent efa0a81 commit 3b2422b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
25 changes: 12 additions & 13 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -41,7 +39,7 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
Dashboard dashboard = Dashboard(defaultArrowStyle: ArrowStyle.segmented);
Dashboard dashboard = Dashboard();

/// Notifier for the tension slider
final segmentedTension = ValueNotifier<double>(1);
Expand Down Expand Up @@ -159,7 +157,11 @@ class _MyHomePageState extends State<MyHomePage> {
dashboard.dashboardSize.height / 2,
),
),
onItemTapped: (index, controller) => controller.closeMenu!(),
onItemTapped: (index, controller) {
if (index != 2) {
controller.closeMenu!();
}
},
items: [
FloatingActionButton(
child: const Icon(Icons.delete),
Expand All @@ -177,8 +179,8 @@ class _MyHomePageState extends State<MyHomePage> {
builder: (_, tension, __) {
return Wrap(
children: [
OutlinedButton(
child: const Text('segmented'),
ActionChip(
label: const Text('segmented'),
onPressed: () {
dashboard.setArrowStyleByHandler(
element,
Expand Down Expand Up @@ -208,8 +210,8 @@ class _MyHomePageState extends State<MyHomePage> {
);
},
),
OutlinedButton(
child: const Text('curved'),
ActionChip(
label: const Text('curved'),
onPressed: () {
dashboard.setArrowStyleByHandler(
element,
Expand All @@ -218,8 +220,8 @@ class _MyHomePageState extends State<MyHomePage> {
);
},
),
OutlinedButton(
child: const Text('rectangular'),
ActionChip(
label: const Text('rectangular'),
onPressed: () {
dashboard.setArrowStyleByHandler(
element,
Expand Down Expand Up @@ -253,9 +255,6 @@ class _MyHomePageState extends State<MyHomePage> {
),
onHoverScale: 1.1,
centerOffset: position - const Offset(50, 0),
backgroundParams: const BackgroundParams(
backgroundColor: Colors.transparent,
),
boundaryBackground: BoundaryBackground(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified images/flowchart.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/flowchart.mp4
Binary file not shown.
4 changes: 3 additions & 1 deletion lib/src/elements/connection_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class ConnectionParams {
arrowParams:
ArrowParams.fromMap(map['arrowParams'] as Map<String, dynamic>),
pivots: (map['pivots'] as List?)
?.map<Pivot>((pivot) => Pivot.fromMap(pivot))
?.map<Pivot>(
(pivot) => Pivot.fromMap(pivot as Map<String, dynamic>),
)
.toList() ??
[],
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/element_handlers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class _ElementHandler extends StatelessWidget {
);
},
builder: (context, candidateData, rejectedData) {
return Draggable<Map>(
return Draggable(
feedback: const SizedBox.shrink(),
feedbackOffset: dashboard.handlerFeedbackOffset,
childWhenDragging: HandlerWidget(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 3b2422b

Please sign in to comment.