Skip to content

Bump sentry_flutter from 6.22.0 to 7.2.0 #27

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/extension.dart
@@ -0,0 +1,10 @@
export 'package:collection/collection.dart';

export 'extension/devices.dart';
export 'extension/list.dart';
export 'extension/numbers.dart';
export 'extension/providers.dart';
export 'extension/strings.dart';
export 'navigation/common/material/theme.dart';

void importExtension() {}
13 changes: 13 additions & 0 deletions lib/extension/devices.dart
@@ -0,0 +1,13 @@
import 'package:flutter/foundation.dart';

extension TargetPlatformExtension on TargetPlatform {
bool isMobile() =>
this == TargetPlatform.android || this == TargetPlatform.iOS;

bool isDesktop() =>
this == TargetPlatform.macOS ||
this == TargetPlatform.windows ||
this == TargetPlatform.linux;

bool isIos() => this == TargetPlatform.iOS;
}
12 changes: 12 additions & 0 deletions lib/extension/list.dart
@@ -0,0 +1,12 @@
extension IterableExtension2<T> on Iterable<T> {
Iterable<T> separated(T toInsert) sync* {
var i = 0;
for (final item in this) {
if (i != 0) {
yield toInsert;
}
yield item;
i++;
}
}
}
5 changes: 5 additions & 0 deletions lib/extension/numbers.dart
@@ -0,0 +1,5 @@
extension IntParser on String {
int parseToInt() {
return int.parse(this);
}
}
49 changes: 49 additions & 0 deletions lib/extension/providers.dart
@@ -0,0 +1,49 @@
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

extension ProvidersException<State> on ProviderBase<AsyncValue<State>> {
ProviderListenable<AsyncValue<State>> logErrorOnDebug() {
return select((value) {
if (value is AsyncError) {
final error = value as AsyncError;
debugPrint('$this: ${error.error} ${error.stackTrace}');
}
return value;
});
}
}

extension ReadAsyncValueToFuture on WidgetRef {
Future<T> readValueOrWait<T>(ProviderBase<AsyncValue<T>> provider) {
final completer = Completer<T>();

final value = read(provider);
if (value.hasValue) {
completer.complete(value.value);
} else if (value.hasError) {
completer.completeError(value.error!, value.stackTrace);
} else {
ProviderSubscription? subscription;
subscription = listenManual<AsyncValue<T>>(provider, (previous, next) {
if (next.isLoading) {
return;
}
if (next.hasValue) {
completer.complete(next.value);
} else if (next.hasError) {
completer.completeError(next.error!, next.stackTrace);
}
subscription?.close();
});
}
return completer.future;
}
}

extension AutoRemover on ProviderSubscription {
void autoRemove(Ref ref) {
ref.onDispose(close);
}
}
8 changes: 8 additions & 0 deletions lib/extension/strings.dart
@@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import '../generated/l10n.dart';

extension AppStringResourceExtension on BuildContext {
S get strings {
return S.of(this);
}
}
71 changes: 71 additions & 0 deletions lib/generated/intl/messages_all.dart
@@ -0,0 +1,71 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that looks up messages for specific locales by
// delegating to the appropriate library.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:implementation_imports, file_names, unnecessary_new
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
// ignore_for_file:argument_type_not_assignable, invalid_assignment
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
// ignore_for_file:comment_references

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';

import 'messages_en.dart' as messages_en;
import 'messages_pt.dart' as messages_pt;
import 'messages_zh.dart' as messages_zh;

typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new SynchronousFuture(null),
'pt': () => new SynchronousFuture(null),
'zh': () => new SynchronousFuture(null),
};

MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) {
case 'en':
return messages_en.messages;
case 'pt':
return messages_pt.messages;
case 'zh':
return messages_zh.messages;
default:
return null;
}
}

/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new SynchronousFuture(false);
}
var lib = _deferredLibraries[availableLocale];
lib == null ? new SynchronousFuture(false) : lib();
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new SynchronousFuture(true);
}

bool _messagesExistFor(String locale) {
try {
return _findExact(locale) != null;
} catch (e) {
return false;
}
}

MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}
214 changes: 214 additions & 0 deletions lib/generated/intl/messages_en.dart
@@ -0,0 +1,214 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a en locale. All the
// messages from the main program should be duplicated here with the same
// function name.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';

final messages = new MessageLookup();

typedef String MessageIfAbsent(String messageStr, List<dynamic> args);

class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'en';

static String m0(artistName, albumName, albumId, sharedUserId) =>
"The ${artistName}\'s album《${albumName}》: http://music.163.com/album/${albumId}/?userid=${sharedUserId} (From @NeteaseCouldMusic)";

static String m1(value) => "Album count: ${value}";

static String m2(value) => "Created at ${value}";

static String m3(value) => "${value} Music";

static String m4(value) => "Play Count: ${value}";

static String m5(username, title, playlistId, userId, shareUserId) =>
"The PlayList created by ${username}${title}」: http://music.163.com/playlist/${playlistId}/${userId}/?userid=${shareUserId} (From @NeteaseCouldMusic)";

static String m6(value) => "Track Count: ${value}";

static String m7(value) => "Find ${value} music";

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"about": MessageLookupByLibrary.simpleMessage("About"),
"account": MessageLookupByLibrary.simpleMessage("Account"),
"addAllSongsToPlaylist":
MessageLookupByLibrary.simpleMessage("Add all songs to playlist"),
"addSongToPlaylist":
MessageLookupByLibrary.simpleMessage("Add song to playlist"),
"addToPlaylist":
MessageLookupByLibrary.simpleMessage("add to playlist"),
"addToPlaylistFailed":
MessageLookupByLibrary.simpleMessage("add to playlist failed"),
"addedToPlaylistSuccess": MessageLookupByLibrary.simpleMessage(
"Added to playlist successfully"),
"album": MessageLookupByLibrary.simpleMessage("Album"),
"albumShareContent": m0,
"alreadyBuy": MessageLookupByLibrary.simpleMessage("Payed"),
"artistAlbumCount": m1,
"artists": MessageLookupByLibrary.simpleMessage("Artists"),
"cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
"clear": MessageLookupByLibrary.simpleMessage("Clear"),
"clearPlayHistory":
MessageLookupByLibrary.simpleMessage("Clear Play History"),
"cloudMusic": MessageLookupByLibrary.simpleMessage("Could Space"),
"cloudMusicFileDropDescription": MessageLookupByLibrary.simpleMessage(
"Drop your music file to here to upload."),
"cloudMusicUsage": MessageLookupByLibrary.simpleMessage("Cloud Usage"),
"collectionLike": MessageLookupByLibrary.simpleMessage("Collections"),
"confirm": MessageLookupByLibrary.simpleMessage("Confirm"),
"copyRightOverlay": MessageLookupByLibrary.simpleMessage(
"Only used for personal study and research, commercial and illegal purposes are prohibited"),
"createdDate": m2,
"createdSongList":
MessageLookupByLibrary.simpleMessage("Created Song List"),
"currentPlaying":
MessageLookupByLibrary.simpleMessage("Current Playing"),
"dailyRecommend":
MessageLookupByLibrary.simpleMessage("Daily Recommend"),
"dailyRecommendDescription": MessageLookupByLibrary.simpleMessage(
"Daily recommend music from Netease cloud music. Refresh every day at 06:00."),
"delete": MessageLookupByLibrary.simpleMessage("delete"),
"discover": MessageLookupByLibrary.simpleMessage("Discover"),
"duration": MessageLookupByLibrary.simpleMessage("Duration"),
"errorNotLogin":
MessageLookupByLibrary.simpleMessage("Please login first."),
"errorToFetchData":
MessageLookupByLibrary.simpleMessage("error to fetch data."),
"events": MessageLookupByLibrary.simpleMessage("Events"),
"failedToDelete": MessageLookupByLibrary.simpleMessage("delete failed"),
"failedToLoad": MessageLookupByLibrary.simpleMessage("failed to load"),
"failedToPlayMusic":
MessageLookupByLibrary.simpleMessage("failed to play music"),
"favoriteSongList":
MessageLookupByLibrary.simpleMessage("Favorite Song List"),
"follow": MessageLookupByLibrary.simpleMessage("Follow"),
"follower": MessageLookupByLibrary.simpleMessage("Follower"),
"friends": MessageLookupByLibrary.simpleMessage("Friends"),
"functionDescription":
MessageLookupByLibrary.simpleMessage("Description"),
"hideCopyrightOverlay":
MessageLookupByLibrary.simpleMessage("Hide Copyright Overlay"),
"intelligenceRecommended":
MessageLookupByLibrary.simpleMessage("Intelligence Recommended"),
"keySpace": MessageLookupByLibrary.simpleMessage("Space"),
"latestPlayHistory":
MessageLookupByLibrary.simpleMessage("Play History"),
"leaderboard": MessageLookupByLibrary.simpleMessage("Leaderboard"),
"library": MessageLookupByLibrary.simpleMessage("Library"),
"likeMusic": MessageLookupByLibrary.simpleMessage("Like Music"),
"loading": MessageLookupByLibrary.simpleMessage("Loading..."),
"localMusic": MessageLookupByLibrary.simpleMessage("Local Music"),
"login": MessageLookupByLibrary.simpleMessage("Login"),
"loginViaQrCode":
MessageLookupByLibrary.simpleMessage("Login via QR code"),
"loginViaQrCodeWaitingConfirmDescription":
MessageLookupByLibrary.simpleMessage(
"Please confirm login via QR code in Netease cloud music mobile app"),
"loginViaQrCodeWaitingScanDescription":
MessageLookupByLibrary.simpleMessage(
"scan QR code by Netease cloud music mobile app"),
"loginWithPhone":
MessageLookupByLibrary.simpleMessage("login with phone"),
"logout": MessageLookupByLibrary.simpleMessage("Logout"),
"musicCountFormat": m3,
"musicName": MessageLookupByLibrary.simpleMessage("Music Name"),
"my": MessageLookupByLibrary.simpleMessage("My"),
"myDjs": MessageLookupByLibrary.simpleMessage("Dj"),
"myFavoriteMusics":
MessageLookupByLibrary.simpleMessage("My Favorite Musics"),
"myMusic": MessageLookupByLibrary.simpleMessage("My Music"),
"nextStep": MessageLookupByLibrary.simpleMessage("next step"),
"noLyric": MessageLookupByLibrary.simpleMessage("No Lyric"),
"noMusic": MessageLookupByLibrary.simpleMessage("no music"),
"noPlayHistory":
MessageLookupByLibrary.simpleMessage("No play history"),
"pause": MessageLookupByLibrary.simpleMessage("Pause"),
"personalFM": MessageLookupByLibrary.simpleMessage("Personal FM"),
"personalFmPlaying":
MessageLookupByLibrary.simpleMessage("Personal FM Playing"),
"personalProfile":
MessageLookupByLibrary.simpleMessage("Personal profile"),
"play": MessageLookupByLibrary.simpleMessage("Play"),
"playAll": MessageLookupByLibrary.simpleMessage("Play All"),
"playInNext": MessageLookupByLibrary.simpleMessage("play in next"),
"playOrPause": MessageLookupByLibrary.simpleMessage("Play/Pause"),
"playingList": MessageLookupByLibrary.simpleMessage("Playing List"),
"playlist": MessageLookupByLibrary.simpleMessage("PlayList"),
"playlistLoginDescription": MessageLookupByLibrary.simpleMessage(
"Login to discover your playlists."),
"playlistPlayCount": m4,
"playlistShareContent": m5,
"playlistTrackCount": m6,
"pleaseInputPassword":
MessageLookupByLibrary.simpleMessage("Please input password"),
"projectDescription": MessageLookupByLibrary.simpleMessage(
"OpenSource project https://github.com/boyan01/flutter-netease-music"),
"qrCodeExpired":
MessageLookupByLibrary.simpleMessage("QR code expired"),
"recommendForYou":
MessageLookupByLibrary.simpleMessage("Recommend for you"),
"recommendPlayLists":
MessageLookupByLibrary.simpleMessage("Recommend PlayLists"),
"recommendTrackIconText": MessageLookupByLibrary.simpleMessage("R"),
"remove": MessageLookupByLibrary.simpleMessage("Remove"),
"repeatModePlayIntelligence":
MessageLookupByLibrary.simpleMessage("Play Intelligence"),
"repeatModePlaySequence":
MessageLookupByLibrary.simpleMessage("Play Sequence"),
"repeatModePlayShuffle":
MessageLookupByLibrary.simpleMessage("Play Shuffle"),
"repeatModePlaySingle":
MessageLookupByLibrary.simpleMessage("Play Single"),
"search": MessageLookupByLibrary.simpleMessage("Search"),
"searchHistory": MessageLookupByLibrary.simpleMessage("Search History"),
"searchMusicResultCount": m7,
"searchPlaylistSongs":
MessageLookupByLibrary.simpleMessage("Search Songs"),
"selectRegionDiaCode":
MessageLookupByLibrary.simpleMessage("select region code"),
"selectTheArtist":
MessageLookupByLibrary.simpleMessage("Select the artist"),
"settings": MessageLookupByLibrary.simpleMessage("Settings"),
"share": MessageLookupByLibrary.simpleMessage("Share"),
"shareContentCopied": MessageLookupByLibrary.simpleMessage(
"Share content has copied to clipboard."),
"shortcuts": MessageLookupByLibrary.simpleMessage("Shortcuts"),
"showAllHotSongs":
MessageLookupByLibrary.simpleMessage("Show all hot songs >"),
"skipAccompaniment": MessageLookupByLibrary.simpleMessage(
"Skip accompaniment when play playlist."),
"skipLogin": MessageLookupByLibrary.simpleMessage("Skip login"),
"skipToNext": MessageLookupByLibrary.simpleMessage("Skip to Next"),
"skipToPrevious":
MessageLookupByLibrary.simpleMessage("Skip to Previous"),
"songs": MessageLookupByLibrary.simpleMessage("Songs"),
"subscribe": MessageLookupByLibrary.simpleMessage("Subscribe"),
"sureToClearPlayingList":
MessageLookupByLibrary.simpleMessage("Sure to clear playing list?"),
"sureToRemoveMusicFromPlaylist": MessageLookupByLibrary.simpleMessage(
"Sure to remove music from playlist?"),
"theme": MessageLookupByLibrary.simpleMessage("Theme"),
"themeAuto": MessageLookupByLibrary.simpleMessage("Follow System"),
"themeDark": MessageLookupByLibrary.simpleMessage("Dark"),
"themeLight": MessageLookupByLibrary.simpleMessage("Light"),
"tipsAutoRegisterIfUserNotExist":
MessageLookupByLibrary.simpleMessage("未注册手机号登陆后将自动创建账号"),
"todo": MessageLookupByLibrary.simpleMessage("TBD"),
"topSongs": MessageLookupByLibrary.simpleMessage("Top Songs"),
"trackNoCopyright":
MessageLookupByLibrary.simpleMessage("Track No Copyright"),
"volumeDown": MessageLookupByLibrary.simpleMessage("Volume Down"),
"volumeUp": MessageLookupByLibrary.simpleMessage("Volume Up")
};
}