Skip to content

Commit

Permalink
feat: platform tabbar macos text style, platform list tile macos,ios …
Browse files Browse the repository at this point in the history
…exception on border decoration
  • Loading branch information
KRTirtho committed Nov 12, 2022
1 parent af9485b commit 83ac0af
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
2 changes: 0 additions & 2 deletions lib/src/platform_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class PlatformListTile extends StatelessWidget with PlatformMixin<Widget> {
focusNode: focusNode,
autofocus: autofocus,
pressColor: selectedTileColor ?? CupertinoColors.systemFill,
border: shape,
);
}

Expand Down Expand Up @@ -132,7 +131,6 @@ class PlatformListTile extends StatelessWidget with PlatformMixin<Widget> {
focusNode: focusNode,
autofocus: autofocus,
pressColor: selectedTileColor ?? CupertinoColors.systemFill,
border: shape,
),
);
}
Expand Down
14 changes: 9 additions & 5 deletions lib/src/platform_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,15 @@ class _PlatformTabBarState extends State<PlatformTabBar>

@override
Widget macos(BuildContext context) {
return MacosSegmentedControl(
controller: _macosTabController,
tabs: widget.tabs
.mapIndexed((i, tab) => tab.macos(context, widget.selectedIndex == i))
.toList(),
return DefaultTextStyle(
style: PlatformTextTheme.of(context).body!,
child: MacosSegmentedControl(
controller: _macosTabController,
tabs: widget.tabs
.mapIndexed(
(i, tab) => tab.macos(context, widget.selectedIndex == i))
.toList(),
),
);
}

Expand Down
29 changes: 9 additions & 20 deletions lib/src/specific/cupertino_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class _CupertinoListTileBackground extends StatelessWidget {
this.onHover,
this.mouseCursor = MouseCursor.defer,
this.borderRadius,
this.customBorder,
this.focusColor,
this.hoverColor,
this.pressColor,
Expand All @@ -59,7 +58,6 @@ class _CupertinoListTileBackground extends StatelessWidget {
final ValueChanged<bool?>? onHover;
final MouseCursor mouseCursor;
final BorderRadius? borderRadius;
final ShapeBorder? customBorder;
final Color? focusColor;
final Color? hoverColor;
final Color? pressColor;
Expand All @@ -83,7 +81,6 @@ class _CupertinoListTileBackground extends StatelessWidget {
onHover: onHover,
mouseCursor: mouseCursor,
borderRadius: borderRadius,
customBorder: customBorder,
focusColor: focusColor,
hoverColor: hoverColor,
pressColor: pressColor,
Expand Down Expand Up @@ -392,7 +389,6 @@ class _ListTileBackgroundState extends State<_ListTileBackgroundStateWidget> {
child: Container(
decoration: BoxDecoration(
color: _highlightColor,
border: widget.customBorder as BoxBorder?,
borderRadius: widget.borderRadius,
),
child: widget.child,
Expand Down Expand Up @@ -424,7 +420,6 @@ class CupertinoListTile extends StatelessWidget {
this.onLongPress,
this.mouseCursor,
this.selected = false,
this.border,
this.pressColor = CupertinoColors.systemFill,
this.focusColor,
this.hoverColor,
Expand Down Expand Up @@ -469,9 +464,6 @@ class CupertinoListTile extends StatelessWidget {
/// See [ListTile.active].
final bool selected;

/// The border of the list tile.
final ShapeBorder? border;

/// The color for the tile's background when it is pressed.
final Color pressColor;

Expand Down Expand Up @@ -611,19 +603,17 @@ class CupertinoListTile extends StatelessWidget {
);

Widget? separator;
if (border == null) {
separator = Container(
height: 1,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: CupertinoDynamicColor.resolve(
CupertinoColors.separator, context),
),
separator = Container(
height: 1,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: CupertinoDynamicColor.resolve(
CupertinoColors.separator, context),
),
),
);
}
),
);

return _CupertinoListTileBackground(
onTap: enabled ? onTap : null,
Expand All @@ -635,7 +625,6 @@ class CupertinoListTile extends StatelessWidget {
focusColor: CupertinoDynamicColor.maybeResolve(focusColor, context),
hoverColor: CupertinoDynamicColor.maybeResolve(hoverColor, context),
autofocus: autofocus,
customBorder: border,
child: Semantics(
selected: selected,
enabled: enabled,
Expand Down

0 comments on commit 83ac0af

Please sign in to comment.