Skip to content

Commit

Permalink
Merge pull request #184 from SputNikPlop/flutter_322
Browse files Browse the repository at this point in the history
fix: flutter deprecations for 3.22
  • Loading branch information
LezdCS authored May 24, 2024
2 parents 4dfc0a5 + d8b3523 commit 51ba074
Show file tree
Hide file tree
Showing 47 changed files with 324 additions and 235 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ IRL Link is a mobile application to monitor your IRL Stream.
[![GitHub](https://img.shields.io/github/license/lezdcs/irl_link?color=%238442f5)](https://choosealicense.com/licenses/gpl-3.0/)

## Download
<a href='https://play.google.com/store/apps/details?id=dev.lezd.www.irllink&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1' target="_blank"><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' height="85"/></a>
<a href='https://apps.apple.com/us/app/irl-link/id6447156883' target="_blank"><img alt='Get it on the App Store' src='https://www.irllink.com/_next/static/media/app-store-badge.a2e763b8.svg' height="74px"/></a>
<a href='https://play.google.com/store/apps/details?id=dev.lezd.www.irllink&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="85" src='./assets/google-play-badge.png'/></a>
<a href="https://apps.apple.com/app/id6447156883"><img alt='Download on the App Store' height="85" src="./assets/apple-download.svg"></a>

Also available in the [Releases](https://github.com/LezdCS/irl_link/releases).
<br />
Soon to be released on the iOS App Store!

## Features

Expand Down
46 changes: 46 additions & 0 deletions lib/assets/apple-download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/google-play-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
final crashlyticsTalkerObserver = CrashlyticsTalkerObserver();
final talker = TalkerFlutter.init(
settings: TalkerSettings(),
observer: crashlyticsTalkerObserver,
settings: TalkerSettings(),
observer: crashlyticsTalkerObserver,
);
await initializeService();
await GetStorage.init();
Expand All @@ -43,7 +43,9 @@ void main() async {
globals.packageName = packageInfo.packageName;
globals.talker = talker;
AppTranslations.initLanguages();
runApp(Main(talker: talker,));
runApp(Main(
talker: talker,
));
}

const notificationChannelId = 'irllink_foreground';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/resources/data_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract class DataState<T> {
this.data,
this.error,
}) {
if(error != null) {
if (error != null) {
globals.talker?.error(error);
}
}
Expand Down
36 changes: 18 additions & 18 deletions lib/src/core/resources/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class Themes {
final ThemeData darkTheme = ThemeData.dark().copyWith(
colorScheme: ColorScheme.fromSwatch().copyWith(
background: const Color(0xFF0e0e10),
surface: const Color(0xFF0e0e10),
secondary: const Color(0xFF18181b),
error: const Color(0xFFEC0808),

Expand All @@ -25,23 +25,23 @@ class Themes {
),
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
thumbColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.white;
}
if (states.contains(MaterialState.disabled)) {
if (states.contains(WidgetState.disabled)) {
return null;
}
return Colors.white;
},
),
trackColor: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
trackColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.deepPurpleAccent[200];
}
if (states.contains(MaterialState.disabled)) {
if (states.contains(WidgetState.disabled)) {
return Colors.grey[850];
}
return Colors.grey[850];
Expand All @@ -61,7 +61,7 @@ class Themes {

final ThemeData lightTheme = ThemeData.light().copyWith(
colorScheme: ColorScheme.fromSwatch().copyWith(
background: const Color(0xFFffffff),
surface: const Color(0xFFffffff),
secondary: const Color(0xFFefeff1),
error: const Color(0xFFEC0808),

Expand All @@ -77,23 +77,23 @@ class Themes {
),
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
thumbColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.white;
}
if (states.contains(MaterialState.disabled)) {
if (states.contains(WidgetState.disabled)) {
return null;
}
return Colors.white;
},
),
trackColor: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
trackColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.deepPurpleAccent[200];
}
if (states.contains(MaterialState.disabled)) {
if (states.contains(WidgetState.disabled)) {
return Colors.grey[850];
}
return Colors.grey[850];
Expand Down
22 changes: 11 additions & 11 deletions lib/src/core/utils/crashlytics_talker_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ class CrashlyticsTalkerObserver extends TalkerObserver {

@override
void onError(err) {
FirebaseCrashlytics.instance.recordError(
err.error,
err.stackTrace,
reason: err.message,
);
FirebaseCrashlytics.instance.recordError(
err.error,
err.stackTrace,
reason: err.message,
);
}

@override
void onException(err) {
FirebaseCrashlytics.instance.recordError(
err.exception,
err.stackTrace,
reason: err.message,
);
FirebaseCrashlytics.instance.recordError(
err.exception,
err.stackTrace,
reason: err.message,
);
}
}
}
3 changes: 2 additions & 1 deletion lib/src/core/utils/dashboard_events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ Map<SupportedEvents, ExistingDashboardEvent> dashboardEvents = {
provider: DashboardActionsProvider.twitch,
actionsAllowed: [DashboardActionsTypes.button],
action: (String v) {
String channel = Get.find<HomeViewController>().twitchData!.twitchUser.login;
String channel =
Get.find<HomeViewController>().twitchData!.twitchUser.login;
Get.find<HomeViewController>()
.sendChatMessage(v.substring(1, v.length - 1), channel);
},
Expand Down
3 changes: 2 additions & 1 deletion lib/src/core/utils/init_dio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Dio initDio() {
TalkerDioLogger(
talker: talker,
settings: TalkerDioLoggerSettings(
requestFilter: (RequestOptions options) => !options.path.contains('api.twitch.tv'),
requestFilter: (RequestOptions options) =>
!options.path.contains('api.twitch.tv'),
printRequestHeaders: true,
// responseFilter: (response) => ![200, 202].contains(response.statusCode),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/data/entities/stream_elements/se_activity_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SeActivityDTO extends SeActivity {
factory SeActivityDTO.fromJson(Map<String, dynamic> map) {
switch (map['type']) {
case 'follow':
return SeActivityDTO (
return SeActivityDTO(
id: map["_id"],
channel: map["channel"],
username: map["data"]["displayName"],
Expand All @@ -37,7 +37,7 @@ class SeActivityDTO extends SeActivity {
activityType: ActivityType.subscription,
);
case "tip":
return SeActivityDTO(
return SeActivityDTO(
id: map["_id"],
channel: map["channel"],
username: map["data"]["displayName"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:irllink/src/domain/entities/twitch/twitch_decoded_idtoken.dart';

class TwitchDecodedIdTokenDTO extends TwitchDecodedIdToken {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/entities/twitch/twitch_poll_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TwitchPollDTO extends TwitchPoll {

DateFormat df = DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
DateTime endsAt = df.parse(map['ends_at'] ?? map['ended_at']);

return TwitchPollDTO(
id: map['id'],
title: map['title'],
Expand Down
1 change: 0 additions & 1 deletion lib/src/data/entities/twitch/twitch_user_dto.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:irllink/src/domain/entities/twitch/twitch_user.dart';

class TwitchUserDTO extends TwitchUser {
Expand Down
Loading

0 comments on commit 51ba074

Please sign in to comment.