Skip to content

Commit

Permalink
refactor: Use spacing from Row/Column instead of intersperse
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Dec 12, 2024
1 parent e381a47 commit bfc177d
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 38 deletions.
4 changes: 2 additions & 2 deletions packages/neon_framework/lib/src/widgets/account_tile.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:meta/meta.dart';
import 'package:neon_framework/blocs.dart';
import 'package:neon_framework/models.dart';
Expand Down Expand Up @@ -52,6 +51,7 @@ class NeonAccountTile extends StatelessWidget {
title: ResultBuilder.behaviorSubject(
subject: userDetailsBloc.userDetails,
builder: (context, userDetails) => Row(
spacing: 5,
children: [
if (userDetails.hasData)
Flexible(
Expand All @@ -71,7 +71,7 @@ class NeonAccountTile extends StatelessWidget {
iconSize: 24,
onRetry: userDetailsBloc.refresh,
),
].intersperse(const SizedBox(width: 5)).toList(),
],
),
),
subtitle: Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:dashboard_app/src/widgets/widget.dart';
import 'package:dashboard_app/src/widgets/widget_button.dart';
import 'package:dashboard_app/src/widgets/widget_item.dart';
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:neon_framework/blocs.dart';
import 'package:neon_framework/models.dart';
import 'package:neon_framework/theme.dart';
Expand Down Expand Up @@ -97,13 +96,8 @@ class DashboardMainPage extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: children
.intersperse(
const SizedBox(
height: 40,
),
)
.toList(),
spacing: 40,
children: children,
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_localizations:
sdk: flutter
go_router: ^14.0.0
intersperse: ^2.0.0
logging: ^1.0.0
neon_framework:
git:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:built_collection/built_collection.dart';
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:neon_framework/models.dart';
import 'package:neon_framework/theme.dart';
import 'package:neon_framework/utils.dart';
Expand Down Expand Up @@ -63,6 +62,7 @@ class NotificationsNotification extends StatelessWidget {
title: subject,
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 5,
children: [
if (notification.message.isNotEmpty) message,
RelativeTime(
Expand All @@ -78,13 +78,7 @@ class NotificationsNotification extends StatelessWidget {
)
.toList(),
),
]
.intersperse(
const SizedBox(
height: 5,
),
)
.toList(),
],
),
leading: notification.icon!.isNotEmpty
? NeonUriImage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies:
sdk: flutter
flutter_material_design_icons: ^1.1.7296
go_router: ^14.0.0
intersperse: ^2.0.0
intl: ^0.19.0
logging: ^1.0.0
meta: ^1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:intl/intl.dart';
import 'package:neon_framework/blocs.dart';
import 'package:neon_framework/utils.dart';
Expand Down Expand Up @@ -79,6 +78,7 @@ class _TalkRoomPageState extends State<TalkRoomPage> {

final appBar = AppBar(
title: Row(
spacing: 10,
children: <Widget>[
TalkRoomAvatar(
room: room,
Expand All @@ -94,13 +94,7 @@ class _TalkRoomPageState extends State<TalkRoomPage> {
visible: result.isLoading,
),
),
]
.intersperse(
const SizedBox(
width: 10,
),
)
.toList(),
],
),
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:built_collection/built_collection.dart';
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:intl/intl.dart';
import 'package:neon_framework/blocs.dart';
import 'package:neon_framework/models.dart';
Expand Down Expand Up @@ -420,6 +419,7 @@ class _TalkCommentMessageState extends State<TalkCommentMessage> {

Widget message = Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 5,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand All @@ -440,13 +440,7 @@ class _TalkCommentMessageState extends State<TalkCommentMessage> {
room: widget.room,
chatMessage: widget.chatMessage,
),
]
.intersperse(
const SizedBox(
height: 5,
),
)
.toList(),
],
);

if (!widget.isParent) {
Expand Down
1 change: 0 additions & 1 deletion packages/neon_framework/packages/talk_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies:
flutter_material_design_icons: ^1.1.7296
flutter_typeahead: ^5.2.0
go_router: ^14.0.0
intersperse: ^2.0.0
intl: ^0.19.0
logging: ^1.0.0
meta: ^1.0.0
Expand Down
1 change: 0 additions & 1 deletion packages/neon_framework/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ dependencies:
go_router: ^14.0.0
http: ^1.0.0
image: ^4.0.0
intersperse: ^2.0.0
intl: ^0.19.0
logging: ^1.0.0
meta: ^1.0.0
Expand Down

0 comments on commit bfc177d

Please sign in to comment.