Skip to content

Commit

Permalink
🔄 REFACTOR: Remove cast with withBetween
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Dillenburg <[email protected]>
  • Loading branch information
LucaDillenburg committed Aug 13, 2022
1 parent 435514f commit a1c9229
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/features/user/sports.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class _ConfigSportsDialogState extends State<ConfigSportsDialog> {
return Row(
children: widgets
.map((widget) => Expanded(child: widget))
.cast<Widget>()
.withBetween(SizedBox(width: _iconsPadding))
.toList(),
);
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../config/routes.dart';
import 'theme.dart';

extension ListExtensions<Widget> on Iterable<Widget> {
List<Widget> withBetween(Widget separation) {
extension ListExtensions<J extends Widget> on Iterable<Widget> {
List<Widget> withBetween<T extends Widget>(T separation) {
return [
...take(1),
...skip(1).expand((e) => [separation, e]).toList(),
Expand Down

0 comments on commit a1c9229

Please sign in to comment.