Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d26c5f1
feat: Added check updated functionality
Mayank4352 Sep 1, 2025
a46316f
feat: Added updated functionality on App launch
Mayank4352 Sep 1, 2025
2b6aee8
fix: Made the reduired changes and added localizations
Mayank4352 Sep 2, 2025
ad95a50
chore: update project structure
github-actions[bot] Sep 2, 2025
59d2417
feat: Added test for about screen controller
Mayank4352 Sep 6, 2025
365924b
Merge branch 'dev' of https://github.com/Mayank4352/Resonate into dev
Mayank4352 Sep 6, 2025
ef39d7c
chore: update project structure
github-actions[bot] Sep 6, 2025
5e62bbe
feat: made the requested changes
Mayank4352 Sep 7, 2025
2699cf7
Merge branch 'dev' of https://github.com/AOSSIE-Org/Resonate into dev
Mayank4352 Sep 7, 2025
eb2de02
feat: Added the localization chnages back
Mayank4352 Sep 7, 2025
ac21564
Merge branch 'dev' of https://github.com/Mayank4352/Resonate into dev
Mayank4352 Sep 7, 2025
867c3d3
chore: update project structure
github-actions[bot] Sep 7, 2025
b2418e6
feat: made the requested changes
Mayank4352 Sep 7, 2025
104e650
chore: update project structure
github-actions[bot] Sep 7, 2025
bf39ab1
feat: made the changes
Mayank4352 Sep 7, 2025
d73c017
Merge branch 'dev' of https://github.com/Mayank4352/Resonate into dev
Mayank4352 Sep 7, 2025
04a36ee
chore: update project structure
github-actions[bot] Sep 7, 2025
3ea7c87
feat: made the change
Mayank4352 Sep 12, 2025
45e1577
Merge branch 'dev' of https://github.com/AOSSIE-Org/Resonate into dev
Mayank4352 Sep 14, 2025
d6e3864
chore: update project structure
github-actions[bot] Sep 14, 2025
6bbeece
fix: fixed the issue with debug mode
Mayank4352 Sep 14, 2025
259edfc
fix: removed pubspec from gitignore
Mayank4352 Sep 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ migrate_working_dir/
.pub-cache/
.pub/
/build/
pubspec.lock
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Don’t ignore pubspec.lock for apps.

For application repos, committing pubspec.lock ensures reproducible builds across CI/dev. Recommend removing this ignore.

Apply this diff:

-pubspec.lock
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pubspec.lock
🤖 Prompt for AI Agents
In .gitignore around line 37, the file currently ignores "pubspec.lock" which
should not be ignored for application repositories; remove the "pubspec.lock"
entry from .gitignore so the lockfile can be tracked, then add and commit
pubspec.lock to the repo (git add pubspec.lock && git commit -m "Track
pubspec.lock for reproducible builds").

lib/firebase_options.dart
firebase.json


# Symbolication related
app.*.symbols

Expand Down
97 changes: 74 additions & 23 deletions lib/controllers/about_app_screen_controller.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import 'dart:developer';
import 'dart:io';

import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:resonate/utils/enums/action_enum.dart';
import 'package:upgrader/upgrader.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:resonate/utils/enums/update_enums.dart';

class AboutAppScreenController extends GetxController {
final Rx<String> appVersion = "0.0.0".obs;
final Rx<String> appBuildNumber = "1".obs;
final Rx<bool> updateAvailable = false.obs;
final Rx<bool> isCheckingForUpdate = false.obs;

final showFullDescription = false.obs;

final String fullDescription = """
Resonate is a revolutionary voice-based social media platform where every voice matters.
Join real-time audio conversations, participate in diverse discussions, and connect with
like-minded individuals. Our platform offers:
- Live audio rooms with topic-based discussions
- Seamless social networking through voice
- Community-driven content moderation
- Cross-platform compatibility
- End-to-end encrypted private conversations

Developed by the AOSSIE open source community, we prioritize user privacy and
community-driven development. Join us in shaping the future of social audio!""";
final Upgrader upgrader = Upgrader(
debugDisplayAlways: true,
debugDisplayOnce: true,
debugLogging: true,
durationUntilAlertAgain: const Duration(days: 1),
);

@override
void onInit() {
Expand All @@ -33,26 +35,75 @@ community-driven development. Join us in shaping the future of social audio!""";
appVersion.value = packageInfo.version;
appBuildNumber.value = packageInfo.buildNumber;
} catch (e) {
Get.snackbar("Error", "Could not load package info");
log('Could not load package info: $e');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Showing errors via Snackbar is better than logging it, let us revert to that

}
}

void toggleDescription() {
showFullDescription.toggle();
}

Future<void> checkForUpdate() async {
// Implement actual update check logic
updateAvailable.value = await _fakeUpdateCheck();
if (updateAvailable.value) {
Get.snackbar("Update Available", "A new version is available!");
} else {
Get.snackbar("Up to Date", "You're using the latest version");
Future<UpdateCheckResult> checkForUpdate({
bool launchUpdateIfAvailable = false,
bool isManualCheck = false,
}) async {
isCheckingForUpdate.value = true;
try {
if (!Platform.isAndroid && !Platform.isIOS) {
return UpdateCheckResult.platformNotSupported;
}
Upgrader.clearSavedSettings();
await upgrader.initialize();
final needsUpdate = upgrader.shouldDisplayUpgrade();
updateAvailable.value = needsUpdate;
if (needsUpdate) {
if (isManualCheck) {
Get.dialog(
UpgradeAlert(upgrader: upgrader),
barrierDismissible: false,
);
} else if (launchUpdateIfAvailable) {
await launchStoreForUpdate();
} else {
Get.dialog(
UpgradeAlert(upgrader: upgrader),
barrierDismissible: false,
);
}
}
return needsUpdate
? UpdateCheckResult.updateAvailable
: UpdateCheckResult.noUpdateAvailable;
} catch (e) {
log('Update check error: $e');
return UpdateCheckResult.checkFailed;
} finally {
isCheckingForUpdate.value = false;
}
}

Future<bool> _fakeUpdateCheck() async {
await Future.delayed(const Duration(seconds: 1));
return false;
Future<UpdateActionResult> launchStoreForUpdate() async {
try {
String storeUrl;
if (Platform.isAndroid) {
storeUrl =
'https://play.google.com/store/apps/details?id=com.resonate.resonate';
} else if (Platform.isIOS) {
// The App Store URL of app
storeUrl = '';
} else {
return UpdateActionResult.error;
}
final uri = Uri.parse(storeUrl);
if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
return UpdateActionResult.success;
} else {
return UpdateActionResult.failed;
}
} catch (e) {
log('Update error: $e');
return UpdateActionResult.error;
}
}
}
4 changes: 4 additions & 0 deletions lib/controllers/auth_state_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:resonate/controllers/friend_calling_controller.dart';
import 'package:resonate/controllers/friends_controller.dart';
import 'package:resonate/controllers/about_app_screen_controller.dart';
import 'package:resonate/controllers/upcomming_rooms_controller.dart';
import 'package:resonate/controllers/tabview_controller.dart';
import 'package:resonate/models/follower_user_model.dart';
Expand Down Expand Up @@ -233,6 +234,9 @@ class AuthStateController extends GetxController {
Future<void> isUserLoggedIn() async {
try {
await setUserProfileData();
if (Get.isRegistered<AboutAppScreenController>()) {
Get.find<AboutAppScreenController>().checkForUpdate();
}
if (isUserProfileComplete == false) {
Get.offNamed(AppRoutes.onBoarding);
} else {
Expand Down
22 changes: 21 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,25 @@
"example": "john_doe"
}
}
}
},
"checkForUpdates": "Check Updates",
"updateNow": "Update Now",
"updateLater": "Later",
"updateSuccessful": "Update Successful",
"updateSuccessfulMessage": "Resonate has been updated successfully!",
"updateCancelled": "Update Cancelled",
"updateCancelledMessage": "Update was cancelled by user",
"updateFailed": "Update Failed",
"updateFailedMessage": "Failed to update. Please try updating from Play Store manually.",
"updateError": "Update Error",
"updateErrorMessage": "An error occurred while updating. Please try again.",
"platformNotSupported": "Platform Not Supported",
"platformNotSupportedMessage": "Update checking is only available on Android devices",
"updateCheckFailed": "Update Check Failed",
"updateCheckFailedMessage": "Could not check for updates. Please try again later.",
"upToDateTitle": "You're Up to Date!",
"upToDateMessage": "You're using the latest version of Resonate",
"updateAvailableTitle": "Update Available!",
"updateAvailableMessage": "A new version of Resonate is available on Play Store",
"updateFeaturesImprovement": "Get the latest features and improvements!"
}
22 changes: 21 additions & 1 deletion lib/l10n/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -588,5 +588,25 @@
"example": "john_doe"
}
}
}
},
"checkForUpdates": "अपडेट चेक करें",
"updateNow": "अभी अपडेट करें",
"updateLater": "बाद में",
"updateSuccessful": "अपडेट सफल",
"updateSuccessfulMessage": "रेज़ोनेट सफलतापूर्वक अपडेट हो गया है!",
"updateCancelled": "अपडेट रद्द किया गया",
"updateCancelledMessage": "अपडेट यूज़र द्वारा रद्द किया गया",
"updateFailed": "अपडेट फेल",
"updateFailedMessage": "अपडेट फेल हो गया। कृपया Play Store से मैन्युअली अपडेट करने का प्रयास करें।",
"updateError": "अपडेट एरर",
"updateErrorMessage": "अपडेट करने में कोई समस्या आई। कृपया फिर से प्रयास करें।",
"platformNotSupported": "प्लेटफॉर्म सपोर्टेड नहीं",
"platformNotSupportedMessage": "अपडेट चेक करना केवल Android डिवाइस पर उपलब्ध है",
"updateCheckFailed": "अपडेट चेक फेल",
"updateCheckFailedMessage": "अपडेट चेक नहीं हो सका। कृपया बाद में प्रयास करें।",
"upToDateTitle": "आप अप टू डेट हैं!",
"upToDateMessage": "आप रेज़ोनेट का लेटेस्ट वर्शन इस्तेमाल कर रहे हैं",
"updateAvailableTitle": "अपडेट उपलब्ध है!",
"updateAvailableMessage": "रेज़ोनेट का नया वर्शन Play Store पर उपलब्ध है",
"updateFeaturesImprovement": "नवीनतम सुविधाएं और सुधार प्राप्त करें!"
}
120 changes: 120 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,126 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'User \${username} declined the call.'**
String callDeclinedTo(String username);

/// No description provided for @checkForUpdates.
///
/// In en, this message translates to:
/// **'Check Updates'**
String get checkForUpdates;

/// No description provided for @updateNow.
///
/// In en, this message translates to:
/// **'Update Now'**
String get updateNow;

/// No description provided for @updateLater.
///
/// In en, this message translates to:
/// **'Later'**
String get updateLater;

/// No description provided for @updateSuccessful.
///
/// In en, this message translates to:
/// **'Update Successful'**
String get updateSuccessful;

/// No description provided for @updateSuccessfulMessage.
///
/// In en, this message translates to:
/// **'Resonate has been updated successfully!'**
String get updateSuccessfulMessage;

/// No description provided for @updateCancelled.
///
/// In en, this message translates to:
/// **'Update Cancelled'**
String get updateCancelled;

/// No description provided for @updateCancelledMessage.
///
/// In en, this message translates to:
/// **'Update was cancelled by user'**
String get updateCancelledMessage;

/// No description provided for @updateFailed.
///
/// In en, this message translates to:
/// **'Update Failed'**
String get updateFailed;

/// No description provided for @updateFailedMessage.
///
/// In en, this message translates to:
/// **'Failed to update. Please try updating from Play Store manually.'**
String get updateFailedMessage;

/// No description provided for @updateError.
///
/// In en, this message translates to:
/// **'Update Error'**
String get updateError;

/// No description provided for @updateErrorMessage.
///
/// In en, this message translates to:
/// **'An error occurred while updating. Please try again.'**
String get updateErrorMessage;

/// No description provided for @platformNotSupported.
///
/// In en, this message translates to:
/// **'Platform Not Supported'**
String get platformNotSupported;

/// No description provided for @platformNotSupportedMessage.
///
/// In en, this message translates to:
/// **'Update checking is only available on Android devices'**
String get platformNotSupportedMessage;

/// No description provided for @updateCheckFailed.
///
/// In en, this message translates to:
/// **'Update Check Failed'**
String get updateCheckFailed;

/// No description provided for @updateCheckFailedMessage.
///
/// In en, this message translates to:
/// **'Could not check for updates. Please try again later.'**
String get updateCheckFailedMessage;

/// No description provided for @upToDateTitle.
///
/// In en, this message translates to:
/// **'You\'re Up to Date!'**
String get upToDateTitle;

/// No description provided for @upToDateMessage.
///
/// In en, this message translates to:
/// **'You\'re using the latest version of Resonate'**
String get upToDateMessage;

/// No description provided for @updateAvailableTitle.
///
/// In en, this message translates to:
/// **'Update Available!'**
String get updateAvailableTitle;

/// No description provided for @updateAvailableMessage.
///
/// In en, this message translates to:
/// **'A new version of Resonate is available on Play Store'**
String get updateAvailableMessage;

/// No description provided for @updateFeaturesImprovement.
///
/// In en, this message translates to:
/// **'Get the latest features and improvements!'**
String get updateFeaturesImprovement;
}

class _AppLocalizationsDelegate
Expand Down
Loading