Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/stac/lib/src/parsers/types/type_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ extension StacFloatingActionButtonLocationParser
}
}

extension StacStrokeCapParser on StacStrokeCap? {
StrokeCap? get parse {
switch (this) {
case StacStrokeCap.butt:
return StrokeCap.butt;
case StacStrokeCap.round:
return StrokeCap.round;
case StacStrokeCap.square:
return StrokeCap.square;
default:
return null;
}
}
}

extension StacOverflowBarAlignmentParser on StacOverflowBarAlignment {
OverflowBarAlignment get parse {
switch (this) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:stac/src/utils/widget_type.dart';
import 'package:stac/src/utils/color_utils.dart';
import 'package:stac/src/parsers/types/type_parser.dart';
import 'package:stac_framework/stac_framework.dart';
import 'package:stac_core/widgets/circular_progress_indicator/stac_circular_progress_indicator.dart';

Expand All @@ -25,7 +26,7 @@ class StacCircularProgressIndicatorParser
strokeAlign: model.strokeAlign ?? 0.0,
semanticsLabel: model.semanticsLabel,
semanticsValue: model.semanticsValue,
strokeCap: model.strokeCap,
strokeCap: model.strokeCap.parse,
);
}
}
13 changes: 13 additions & 0 deletions packages/stac_core/lib/types/stac_stroke_cap.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// Stroke cap styles for line endings.
///
/// Mirrors Flutter's [StrokeCap] values.
enum StacStrokeCap {
/// Flat end at the edge of the path.
butt,

/// Rounded end with a semicircle extension.
round,

/// Square end that extends half the stroke width beyond the end.
square,
}
1 change: 1 addition & 0 deletions packages/stac_core/lib/types/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ export 'stac_table/stac_table_cell_vertical_alignment.dart';
export 'stac_dialog_traversal_edge_behavior.dart';
export 'stac_snack_bar_behavior.dart';
export 'stac_dismiss_direction.dart';
export 'stac_stroke_cap.dart';
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'dart:ui';

import 'package:json_annotation/json_annotation.dart';
import 'package:stac_core/core/converters/double_converter.dart';
import 'package:stac_core/core/stac_widget.dart';
import 'package:stac_core/painting/stac_color/stac_colors.dart';
import 'package:stac_core/types/stac_stroke_cap.dart';

part 'stac_circular_progress_indicator.g.dart';

Expand Down Expand Up @@ -76,7 +75,7 @@ class StacCircularProgressIndicator extends StacWidget {
final String? semanticsValue;

/// Stroke line cap style.
final StrokeCap? strokeCap;
final StacStrokeCap? strokeCap;

/// Widget type identifier.
@override
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/stac_core/lib/widgets/scaffold/stac_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class StacScaffold extends StacWidget {
this.bottomNavigationBar,
this.bottomSheet,
this.drawer,
this.drawerDragStartBehavior = StacDragStartBehavior.start,
this.drawerDragStartBehavior,
this.drawerEdgeDragWidth,
this.drawerEnableOpenDragGesture,
this.drawerScrimColor,
Expand Down
10 changes: 4 additions & 6 deletions packages/stac_core/lib/widgets/scaffold/stac_scaffold.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.