Skip to content

Commit

Permalink
Merge pull request #66 from IamMuuo/dev
Browse files Browse the repository at this point in the history
Playstore Fixes
  • Loading branch information
IamMuuo authored Mar 15, 2024
2 parents c877597 + a0a52cf commit 86aca83
Show file tree
Hide file tree
Showing 30 changed files with 31 additions and 76 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- dev

jobs:
build:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#252623</item>
<item name="android:windowSplashScreenBrandingImage">@drawable/android12branding</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
3 changes: 3 additions & 0 deletions android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#f9f9f9</item>
<item name="android:windowSplashScreenBrandingImage">@drawable/android12branding</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
8 changes: 4 additions & 4 deletions flutter_native_splash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ flutter_native_splash:
# 640 pixels in diameter.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter.
#image: assets/android12splash.png
image: assets/icons/academia.png

# Splash screen background color.
#color: "#42a5f5"
color: "#f9f9f9"

# App icon background color.
#icon_background_color: "#111111"

# The branding property allows you to specify an image used as branding in the splash screen.
#branding: assets/dart.png
branding: assets/icons/branding.png

# The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that
# apply when the device is in dark mode. If they are not specified, the app will use the
# parameters from above.
#image_dark: assets/android12splash-invert.png
#color_dark: "#042a49"
color_dark: "#252623"
#icon_background_color_dark: "#eeeeee"

# The android, ios and web parameters can be used to disable generating a splash screen on a given
Expand Down
23 changes: 13 additions & 10 deletions lib/controllers/settings_controller.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:academia/constants/common.dart';
import 'package:flutter/material.dart';
import 'package:academia/exports/barrel.dart';
import 'package:get/get.dart';
import 'package:shorebird_code_push/shorebird_code_push.dart';

Expand All @@ -14,7 +13,7 @@ class SettingsController extends GetxController {
Rx<bool> hasUpdates = false.obs;
Rx<String> patch = "0.0.0".obs;
late Map<dynamic, dynamic> settings;
final ShorebirdCodePush shorebirdCodePush = ShorebirdCodePush();
late ShorebirdCodePush? shorebirdCodePush;

@override
void onInit() async {
Expand All @@ -30,12 +29,15 @@ class SettingsController extends GetxController {
debugPrint("Settings loaded!");
super.onInit();

shorebirdCodePush.currentPatchNumber().then((value) {
patch.value = value.toString();
debugPrint("Current patch number is: $value");
});
if (Platform.isAndroid) {
shorebirdCodePush = ShorebirdCodePush();
shorebirdCodePush?.currentPatchNumber().then((value) {
patch.value = value.toString();
debugPrint("Current patch number is: $value");
});

checkForUpdates();
checkForUpdates();
}
}

Future<void> saveSettings() async {
Expand All @@ -51,11 +53,12 @@ class SettingsController extends GetxController {

Future<void> checkForUpdates() async {
// Check whether a patch is available to install.
hasUpdates.value = await shorebirdCodePush.isNewPatchAvailableForDownload();
hasUpdates.value =
await shorebirdCodePush?.isNewPatchAvailableForDownload() ?? false;

if (hasUpdates.value) {
// Download the new patch if it's available.
await shorebirdCodePush.downloadUpdateIfAvailable();
await shorebirdCodePush?.downloadUpdateIfAvailable();
}
hasUpdates.value = false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class AdmissionNumberFormatter extends TextInputFormatter {
@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) {
final oldValueText = oldValue.text;
// final oldValueText = oldValue.text;
final newValueText = newValue.text;

if (newValueText == '') {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class SettingsPage extends StatelessWidget {
title: Obx(
() => controller.hasUpdates.value
? const Text("Updating")
: Text("Update v 1.0.${controller.patch.value}"),
: Text("Update v2.0.${controller.patch.value}"),
),
trailing: controller.hasUpdates.value
? LoadingAnimationWidget.beat(
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/academia_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AcademiaAppBar extends StatelessWidget {
storyController: StoryController(),
));
}
: () {},
: null,
child: Container(
padding: const EdgeInsets.all(2),
decoration: notificationsController.hasNotifications.value
Expand Down
59 changes: 0 additions & 59 deletions lib/widgets/dateTime_picker.dart

This file was deleted.

4 changes: 4 additions & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@








Expand Down Expand Up @@ -163,6 +165,8 @@






<script>
window.addEventListener('load', function(ev) {
Expand Down

0 comments on commit 86aca83

Please sign in to comment.