Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Grodien committed Nov 5, 2024
1 parent 7faf229 commit e5b7557
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:das_client/app/bloc/train_journey_cubit.dart';
import 'package:das_client/sfera/sfera_component.dart';
import 'package:das_client/sfera/src/model/journey_profile.dart';
import 'package:design_system_flutter/design_system_flutter.dart';
import 'package:flutter/material.dart';
import 'package:rxdart/rxdart.dart';
Expand All @@ -13,8 +12,7 @@ class TrainJourney extends StatelessWidget {
final bloc = context.trainJourneyCubit;

return StreamBuilder<List<dynamic>>(
stream:
CombineLatestStream.list([bloc.journeyStream, bloc.segmentStream]),
stream: CombineLatestStream.list([bloc.journeyStream, bloc.segmentStream]),
builder: (context, snapshot) {
JourneyProfile? journeyProfile = snapshot.data?[0];
List<SegmentProfile> segmentProfiles = snapshot.data?[1] ?? [];
Expand All @@ -31,23 +29,17 @@ class TrainJourney extends StatelessWidget {
List<SegmentProfile> segmentProfiles,
) {
final timingPoints = journeyProfile.segmentProfilesLists
.expand((it) => it.timingPoints
.toList()
.sublist(it == journeyProfile.segmentProfilesLists.first ? 0 : 1))
.expand((it) => it.timingPoints.toList().sublist(it == journeyProfile.segmentProfilesLists.first ? 0 : 1))
.toList();

final points = segmentProfiles
.expand((it) => it.points?.timingPoints.toList() ?? <TimingPoint>[]);
final points = segmentProfiles.expand((it) => it.points?.timingPoints.toList() ?? <TimingPoint>[]);

return SingleChildScrollView(
child: Column(
children: [
...List.generate(timingPoints.length, (index) {
var timingPoint = timingPoints[index];
var tpId = timingPoint.timingPointReference.children
.whereType<TpIdReference>()
.firstOrNull
?.tpId;
var tpId = timingPoint.timingPointReference.children.whereType<TpIdReference>().firstOrNull?.tpId;
var tp = points.where((point) => point.id == tpId).firstOrNull;
return Padding(
padding: const EdgeInsets.all(sbbDefaultSpacing * 0.5),
Expand All @@ -65,8 +57,7 @@ class TrainJourney extends StatelessWidget {
);
}

Widget _servicePointName(TimingPoint? tp) =>
Text(tp?.names.first.name ?? 'Unknown');
Widget _servicePointName(TimingPoint? tp) => Text(tp?.names.first.name ?? 'Unknown');

Widget _arrivalTime(TimingPointConstraints timingPoint) {
return Text(timingPoint.attributes['TP_PlannedLatestArrivalTime'] ?? '');
Expand Down
3 changes: 1 addition & 2 deletions das_client/lib/app/pages/login/splash_page.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:das_client/app/nav/app_router.dart';
import 'package:das_client/auth/authentication_component.dart';
import 'package:das_client/auth/src/authenticator.dart';
import 'package:das_client/di.dart';
import 'package:das_client/app/nav/app_router.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down
1 change: 1 addition & 0 deletions das_client/lib/mqtt/src/mqtt_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class MqttServiceImpl implements MqttService {

final _messageSubject = BehaviorSubject<String>();

@override
Stream<String> get messageStream => _messageSubject.stream;

MqttServiceImpl({required String mqttUrl, required MqttClientConnector mqttClientConnector, required this.prefix})
Expand Down

0 comments on commit e5b7557

Please sign in to comment.