Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YaruPopupMenuButton: replace borderRadius with style #620

Merged
merged 1 commit into from
Feb 14, 2023
Merged
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
10 changes: 3 additions & 7 deletions lib/src/widgets/yaru_popup_menu_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:yaru_icons/yaru_icons.dart';
import 'package:yaru_widgets/constants.dart';

import 'yaru_check_button.dart';

Expand All @@ -23,9 +22,7 @@ class YaruPopupMenuButton<T> extends StatelessWidget {
this.enableFeedback,
this.constraints,
this.elevation,
this.borderRadius = const BorderRadius.all(
Radius.circular(kYaruButtonRadius),
),
this.style,
});

final T? initialValue;
Expand All @@ -42,17 +39,16 @@ class YaruPopupMenuButton<T> extends StatelessWidget {
final bool? enableFeedback;
final BoxConstraints? constraints;
final double? elevation;
final BorderRadius borderRadius;
final ButtonStyle? style;

@override
Widget build(BuildContext context) {
final style = OutlinedButtonTheme.of(context).style;
final style = this.style ?? OutlinedButtonTheme.of(context).style;
final state = <MaterialState>{if (!enabled) MaterialState.disabled};
final side = style?.side?.resolve(state);
final shape = style?.shape?.resolve(state) ??
RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor),
borderRadius: borderRadius,
);
return DecoratedBox(
decoration: ShapeDecoration(shape: shape.copyWith(side: side)),
Expand Down