Skip to content

Commit

Permalink
defaultConnectionId == defaultNetwork.id
Browse files Browse the repository at this point in the history
  • Loading branch information
knightsforce committed Dec 19, 2024
1 parent 8fc35f7 commit 45c3d70
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ import 'package:collection/collection.dart';

class ConnectionNetwork {
ConnectionNetwork({
required this.defaultConnectionId,
required String defaultConnectionId,
List<ConnectionData>? networks,
Map<String, ConnectionTransportData>? transports,
}) : networks = networks ?? [],
transports = transports ?? {};
transports = transports ?? {},
defaultNetwork = networks?.firstWhereOrNull(
(n) => n.id == defaultConnectionId,
) ??
networks?.firstOrNull ??
defaultPresetNetwork;

final String defaultConnectionId;
final List<ConnectionData> networks;
final Map<String, ConnectionTransportData> transports;

late final ConnectionData defaultNetwork = networks.firstWhereOrNull(
(n) => n.id == defaultConnectionId,
) ??
networks.firstOrNull ??
defaultPresetNetwork;
late final ConnectionData defaultNetwork;
late final String defaultConnectionId = defaultNetwork.id;
}

0 comments on commit 45c3d70

Please sign in to comment.