Minor toString refactor

This commit is contained in:
Vicente J. Ruiz Jurado 2018-08-03 08:44:57 +02:00
parent 81be8c8181
commit c39351d0df

View file

@ -1,10 +1,11 @@
import 'dart:async';
import 'package:comunes_flutter/comunes_flutter.dart'; import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:fires_flutter/models/fireNotification.dart'; import 'package:fires_flutter/models/fireNotification.dart';
import 'package:fires_flutter/models/yourLocation.dart'; import 'package:fires_flutter/models/yourLocation.dart';
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'fireMapState.dart'; import 'fireMapState.dart';
import 'user.dart'; import 'user.dart';
@ -53,8 +54,8 @@ class AppState extends Object with _$AppStateSerializerMixin {
this.error: null, this.error: null,
this.gmapKey, this.gmapKey,
this.firesApiKey, this.firesApiKey,
this.firesApiUrl, this.firesApiUrl,
this.serverUrl, this.serverUrl,
this.fireMapState: const FireMapState.initial()}); this.fireMapState: const FireMapState.initial()});
AppState copyWith( AppState copyWith(
@ -63,8 +64,8 @@ class AppState extends Object with _$AppStateSerializerMixin {
String user, String user,
String error, String error,
String gmapKey, String gmapKey,
String firesApiKey, String firesApiKey,
String serverUrl, String serverUrl,
String firesApiUrl, String firesApiUrl,
List<YourLocation> yourLocations, List<YourLocation> yourLocations,
List<FireNotification> fireNotifications, List<FireNotification> fireNotifications,
@ -77,8 +78,8 @@ class AppState extends Object with _$AppStateSerializerMixin {
error: error ?? this.error, error: error ?? this.error,
gmapKey: gmapKey ?? this.gmapKey, gmapKey: gmapKey ?? this.gmapKey,
firesApiKey: firesApiKey ?? this.firesApiKey, firesApiKey: firesApiKey ?? this.firesApiKey,
firesApiUrl: firesApiUrl ?? this.firesApiUrl, firesApiUrl: firesApiUrl ?? this.firesApiUrl,
serverUrl: serverUrl ?? this.serverUrl, serverUrl: serverUrl ?? this.serverUrl,
yourLocations: yourLocations ?? this.yourLocations, yourLocations: yourLocations ?? this.yourLocations,
fireNotifications: fireNotifications ?? this.fireNotifications, fireNotifications: fireNotifications ?? this.fireNotifications,
fireNotificationsUnread: fireNotificationsUnread:
@ -89,9 +90,9 @@ class AppState extends Object with _$AppStateSerializerMixin {
@override @override
String toString() { String toString() {
return 'AppState{\nuser: ${user}\nisLoading: $isLoading\nisLoaded: $isLoaded\napiKey: ${ellipse( return 'AppState{\nuser: ${user}\nisLoading: $isLoading\nisLoaded: $isLoaded\napiKey: ${ellipse(
firesApiKey, 8)}\napiUrl: ${ellipse( firesApiKey,
firesApiUrl, 8)}\nserverUrl: ${serverUrl}\nfireNotifications: ${fireNotifications}\nyourLocations count: ${yourLocations 8)}\napiUrl: ${firesApiUrl}\nserverUrl: ${serverUrl}\nfireMapState: $fireMapState\nyourLocations count: ${yourLocations
.length}\nunread notif: ${fireNotificationsUnread}\nyourLocations: ${yourLocations}\nfireMapState: $fireMapState}'; .length}\nunread notif: ${fireNotificationsUnread}\nfireNotifications: ${fireNotifications}\nyourLocations: ${yourLocations}}';
} }
} }