mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-06 15:21:21 +08:00
NNBD: try fixing some of the errors
This commit is contained in:
@ -133,7 +133,7 @@ class Analytics {
|
||||
|
||||
Future<void> log({
|
||||
@required Event e,
|
||||
Map<String, String> parameters,
|
||||
Map<String, String> parameters = const {},
|
||||
}) async {
|
||||
String name = _eventToString(e);
|
||||
await firebase.logEvent(name: name, parameters: parameters);
|
||||
@ -146,7 +146,7 @@ class Analytics {
|
||||
}
|
||||
}
|
||||
|
||||
void logEvent(Event event, {Map<String, String> parameters}) {
|
||||
void logEvent(Event event, {Map<String, String> parameters = const {}}) {
|
||||
getAnalytics().log(e: event, parameters: parameters);
|
||||
Log.d("Event $event");
|
||||
}
|
||||
|
@ -33,14 +33,14 @@ class GitHub implements GitHost {
|
||||
|
||||
String url = call.arguments["URL"];
|
||||
var uri = Uri.parse(url);
|
||||
var authCode = uri.queryParameters['code'];
|
||||
if (authCode == null) {
|
||||
var authCode = uri.queryParameters['code'] ?? "";
|
||||
if (authCode.isEmpty) {
|
||||
Log.d("GitHub: Missing auth code. Now what?");
|
||||
callback(GitHostException.OAuthFailed);
|
||||
}
|
||||
|
||||
_accessCode = await _getAccessCode(authCode);
|
||||
if (_accessCode == null || _accessCode.isEmpty) {
|
||||
if (_accessCode.isEmpty) {
|
||||
Log.d("GitHub: AccessCode is invalid: " + _accessCode);
|
||||
callback(GitHostException.OAuthFailed);
|
||||
}
|
||||
@ -67,7 +67,7 @@ class GitHub implements GitHost {
|
||||
Log.d("GithubResponse: " + response.body);
|
||||
|
||||
var map = Uri.splitQueryString(response.body);
|
||||
return map["access_token"];
|
||||
return map["access_token"] ?? "";
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -12,7 +12,7 @@ class FlattenedNotesFolder with NotesFolderNotifier implements NotesFolder {
|
||||
var _notes = <Note>[];
|
||||
var _folders = <NotesFolder>[];
|
||||
|
||||
FlattenedNotesFolder(this._parentFolder, {this.filter, this.title}) {
|
||||
FlattenedNotesFolder(this._parentFolder, {this.filter, this.title = ""}) {
|
||||
_addFolder(_parentFolder);
|
||||
}
|
||||
|
||||
@ -130,10 +130,10 @@ class FlattenedNotesFolder with NotesFolderNotifier implements NotesFolder {
|
||||
}
|
||||
|
||||
@override
|
||||
String get name => title ?? "All Notes";
|
||||
String get name => title.isEmpty ? "All Notes" : title;
|
||||
|
||||
@override
|
||||
String get publicName => title ?? "All Notes";
|
||||
String get publicName => title.isEmpty ? "All Notes" : title;
|
||||
|
||||
@override
|
||||
NotesFolderConfig get config {
|
||||
|
Reference in New Issue
Block a user