From 5e3150282ef839759b01845acb30934fc8ce83e8 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 07:42:42 +0200
Subject: [PATCH 01/34] Fix imutable extras row
---
lib/icanteen_setup.dart | 43 -----------------------------------------
lib/timetable.dart | 3 +--
2 files changed, 1 insertion(+), 45 deletions(-)
diff --git a/lib/icanteen_setup.dart b/lib/icanteen_setup.dart
index d0c3246..1e8523d 100644
--- a/lib/icanteen_setup.dart
+++ b/lib/icanteen_setup.dart
@@ -31,49 +31,6 @@ class ICanteenSetupScreenState extends State {
String password = "";
String server = "";
-/*
- Future init() async {
- startedInit = true;
- sharedPreferences = await SharedPreferences.getInstance();
- progress = 0.1;
- loaderText = local!.loadCredentials;
- dio.interceptors
- .add(DioCacheManager(CacheConfig(baseUrl: baseUrl)).interceptor);
- setState(() {});
- loadMessages();
- }
-
- Future loadMessages() async {
- progress = 0.9;
- loaderText = local!.loadDownloadMessages;
- setState(() {});
- final metric = FirebasePerformance.instance
- .newHttpMetric("$baseUrl/messages", HttpMethod.Get);
-
- String token = sharedPreferences.getString("token")!;
- metric.start();
- Response response = await dio.get(
- "$baseUrl/messages",
- options: buildCacheOptions(
- const Duration(days: 5),
- forceRefresh: true,
- options: Options(
- headers: {
- "Authorization": "Bearer $token",
- },
- ),
- ),
- );
- metric.stop();
- sessionManager.set("messages", jsonEncode(response.data));
-
- progress = 1.0;
- loaderText = local!.loadDone;
- setState(() {});
- widget.loadedCallback();
- }
-*/
-
Future login() async {
setState(() {
hasLogin = true;
diff --git a/lib/timetable.dart b/lib/timetable.dart
index 8431324..f3002ee 100644
--- a/lib/timetable.dart
+++ b/lib/timetable.dart
@@ -307,8 +307,7 @@ Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
}
}
for (TimeTableClass ttclass in tt.classes) {
- const Row extrasRow = Row(
- // ignore: prefer_const_literals_to_create_immutables
+ Row extrasRow = const Row(
children: [],
);
if (ttclass.data['curriculum'] != null) {
From 9380a94fc45e28be0c3baa093ea6aca976cf92d1 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 08:18:09 +0200
Subject: [PATCH 02/34] Update workflow, create PR template
---
.github/pull_request_template.md | 36 +++++++++++++++++++++++++++++
.github/workflows/build-patch.yml | 6 ++---
pubspec.lock | 38 +++++++++++++++++++------------
3 files changed, 62 insertions(+), 18 deletions(-)
create mode 100644 .github/pull_request_template.md
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..8f257d0
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,36 @@
+# Description
+
+Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
+
+Fixes # (issue)
+
+## Type of change
+
+Please delete options that are not relevant.
+
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] This change requires a documentation update
+
+# How Has This Been Tested?
+
+Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
+
+- [ ] Test coverage
+
+**Test Configuration**:
+* OS and version:
+* Hardware (or VM):
+* API (version/selfhosted):
+
+# Checklist:
+
+- [ ] My code follows the style guidelines of this project
+- [ ] I have performed a self-review of my code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] My changes generate no new warnings
+- [ ] I have added tests that prove my fix is effective or that my feature works
+- [ ] New and existing unit tests pass locally with my changes
+- [ ] Any dependent changes have been merged and published in downstream modules
+
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 8339d73..38e37d4 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -83,11 +83,11 @@ jobs:
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change, supports regular expressions wrapped with '/'
- major_pattern: "(MAJOR)"
+ major_pattern: ""
# A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs
major_regexp_flags: ""
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
- minor_pattern: "(MINOR)"
+ minor_pattern: ""
# A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs
minor_regexp_flags: ""
# A string to determine the format of the version output
@@ -104,6 +104,6 @@ jobs:
- run: flutter analyze .
- run: flutter gen-l10n
- name: 🚀 Shorebird Patch
- run: shorebird patch android --release-version ${{ steps.previoustag.outputs.tag }}+1 --force '--' --dart-define=BVS="Patch v${{ steps.semver.outputs.version }} ShoreBird"
+ run: shorebird patch android --force '--' --dart-define=BVS="Patch v${{ steps.semver.outputs.version }} ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
\ No newline at end of file
diff --git a/pubspec.lock b/pubspec.lock
index eb3083a..620841e 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: collection
- sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
+ sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
- version: "1.17.1"
+ version: "1.17.2"
connectivity_plus:
dependency: "direct main"
description:
@@ -384,10 +384,10 @@ packages:
dependency: "direct main"
description:
name: intl
- sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
+ sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev"
source: hosted
- version: "0.18.0"
+ version: "0.18.1"
js:
dependency: transitive
description:
@@ -432,18 +432,18 @@ packages:
dependency: transitive
description:
name: matcher
- sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
+ sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
- version: "0.12.15"
+ version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
- sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
+ sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
- version: "0.2.0"
+ version: "0.5.0"
meta:
dependency: transitive
description:
@@ -717,10 +717,10 @@ packages:
dependency: transitive
description:
name: source_span
- sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
+ sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
- version: "1.9.1"
+ version: "1.10.0"
sqflite:
dependency: transitive
description:
@@ -789,10 +789,10 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
+ sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
- version: "0.5.1"
+ version: "0.6.0"
typed_data:
dependency: transitive
description:
@@ -885,10 +885,10 @@ packages:
dependency: transitive
description:
name: vm_service
- sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe
+ sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f
url: "https://pub.dev"
source: hosted
- version: "11.3.0"
+ version: "11.7.1"
watcher:
dependency: transitive
description:
@@ -897,6 +897,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
+ web:
+ dependency: transitive
+ description:
+ name: web
+ sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.1.4-beta"
webdriver:
dependency: transitive
description:
@@ -970,5 +978,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
- dart: ">=3.0.0 <4.0.0"
+ dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.10.0"
From 615445da4c56622008149919ee6085ec7e181071 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 08:31:51 +0200
Subject: [PATCH 03/34] Fix workflow
---
.github/workflows/build-patch.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 38e37d4..4e209ba 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -83,11 +83,11 @@ jobs:
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change, supports regular expressions wrapped with '/'
- major_pattern: ""
+ major_pattern: "somethingiwillneverwriteinacommit"
# A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs
major_regexp_flags: ""
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
- minor_pattern: ""
+ minor_pattern: "somethingiwillalsoneverwriteinacommit"
# A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs
minor_regexp_flags: ""
# A string to determine the format of the version output
From 363f0233f2bb019fd825eb49a04ee462be02f60a Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 08:34:42 +0200
Subject: [PATCH 04/34] Add code push dependency
---
pubspec.lock | 8 ++++++++
pubspec.yaml | 1 +
2 files changed, 9 insertions(+)
diff --git a/pubspec.lock b/pubspec.lock
index 620841e..6971941 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -700,6 +700,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
+ shorebird_code_push:
+ dependency: "direct main"
+ description:
+ name: shorebird_code_push
+ sha256: "751bac1e53928bd398ed5ad407938e356df8416151c572eaba73fb7d844bdf95"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.1.0"
sky_engine:
dependency: transitive
description: flutter
diff --git a/pubspec.yaml b/pubspec.yaml
index 0621128..c930e9f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -52,6 +52,7 @@ dependencies:
flutter_cached_pdfview: ^0.4.1
package_info: ^2.0.2
url_launcher: ^6.1.12
+ shorebird_code_push: ^1.1.0
dependency_overrides:
flutter_pdfview: 1.2.9
From 95b7f68536796a627d14506eb05e095dd80826d3 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 08:40:18 +0200
Subject: [PATCH 05/34] Patch workflow final version
---
.github/workflows/build-patch.yml | 2 +-
pubspec.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 4e209ba..5a7a822 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -98,7 +98,7 @@ jobs:
with:
valueFile: 'pubspec.yaml'
propertyPath: 'version'
- value: "${{ steps.semver.outputs.version }}"
+ value: "${{ steps.previoustag.outputs.tag }}+1"
commitChange: false
- run: flutter pub get
- run: flutter analyze .
diff --git a/pubspec.yaml b/pubspec.yaml
index c930e9f..88bedc2 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
-version: 1.7.3+2
+version: 1.7.6+1
environment:
sdk: ">=2.19.0 <3.0.0"
From e7762826cf72822e818fcaa86e8a7e5c6c446f47 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 08:49:03 +0200
Subject: [PATCH 06/34] The workflow should now work
---
.github/workflows/build-patch.yml | 16 ++++++----------
pubspec.yaml | 2 +-
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 5a7a822..d55c737 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -66,16 +66,12 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASS }}
run: |
echo -e "storePassword=$KEYSTORE_PASSWORD\nkeyPassword=$KEY_PASSWORD\nkeyAlias=$KEY_ALIAS\nstoreFile=$RUNNER_TEMP/keystore.jks" > android/key.properties
- - name: 'Get Previous tag'
- id: previoustag
- uses: "WyriHaximus/github-action-get-previous-tag@v1"
+ - name: Get tag
+ id: tag
+ uses: dawidd6/action-get-tag@v1
with:
- fallback: 1.0.0
- - name: 'Get next minor version'
- id: semvers
- uses: "WyriHaximus/github-action-next-semvers@v1"
- with:
- version: ${{ steps.previoustag.outputs.tag }}
+ # Optionally strip `v` prefix
+ strip_v: true
- uses: paulhatch/semantic-version@v5.0.2
id: semver
with:
@@ -98,7 +94,7 @@ jobs:
with:
valueFile: 'pubspec.yaml'
propertyPath: 'version'
- value: "${{ steps.previoustag.outputs.tag }}+1"
+ value: "${{steps.tag.outputs.tag}}+1"
commitChange: false
- run: flutter pub get
- run: flutter analyze .
diff --git a/pubspec.yaml b/pubspec.yaml
index 88bedc2..ffa95d4 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: eduapge2
-description: A new Flutter project.
+description: A custom mobile client for EduPage, focusing on design and speed improvement
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
From da7d47437785f11cf46695058101ae4e6a1b7a18 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 11:46:52 +0200
Subject: [PATCH 07/34] release workflow update
---
.github/workflows/build-patch.yml | 13 -------------
.github/workflows/build-prerelease-apk.yml | 8 ++++++--
.github/workflows/build-release-apk.yml | 8 ++++++--
pubspec.yaml | 2 +-
4 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index d55c737..8e7ce05 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -66,12 +66,6 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASS }}
run: |
echo -e "storePassword=$KEYSTORE_PASSWORD\nkeyPassword=$KEY_PASSWORD\nkeyAlias=$KEY_ALIAS\nstoreFile=$RUNNER_TEMP/keystore.jks" > android/key.properties
- - name: Get tag
- id: tag
- uses: dawidd6/action-get-tag@v1
- with:
- # Optionally strip `v` prefix
- strip_v: true
- uses: paulhatch/semantic-version@v5.0.2
id: semver
with:
@@ -89,13 +83,6 @@ jobs:
# A string to determine the format of the version output
version_format: "${major}.${minor}.${patch}+${increment}"
bump_each_commit: false
- - name: Update pubspec.yaml
- uses: fjogeleit/yaml-update-action@main
- with:
- valueFile: 'pubspec.yaml'
- propertyPath: 'version'
- value: "${{steps.tag.outputs.tag}}+1"
- commitChange: false
- run: flutter pub get
- run: flutter analyze .
- run: flutter gen-l10n
diff --git a/.github/workflows/build-prerelease-apk.yml b/.github/workflows/build-prerelease-apk.yml
index dfadcc6..53c0cf2 100644
--- a/.github/workflows/build-prerelease-apk.yml
+++ b/.github/workflows/build-prerelease-apk.yml
@@ -62,11 +62,15 @@ jobs:
valueFile: 'pubspec.yaml'
propertyPath: 'version'
value: "${{ steps.semvers.outputs.patch }}"
- commitChange: false
+ commitChange: true
+ branch: 'build-prerelease'
+ labels: 'bump'
+ message: 'Bump version to ${{ steps.semvers.outputs.patch }}'
+ description: 'Automatic version bump to ${{ steps.semvers.outputs.patch }} for prerelease build'
- run: flutter pub get
- run: flutter analyze .
- run: flutter gen-l10n
- - name: 🚀 Shorebird Patch
+ - name: 🚀 Shorebird Release
run: shorebird release android --force --artifact apk '--' --dart-define=BVS="Prerelease ${{ steps.semvers.outputs.v_patch }} ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
diff --git a/.github/workflows/build-release-apk.yml b/.github/workflows/build-release-apk.yml
index 0022580..e682318 100644
--- a/.github/workflows/build-release-apk.yml
+++ b/.github/workflows/build-release-apk.yml
@@ -62,11 +62,15 @@ jobs:
valueFile: 'pubspec.yaml'
propertyPath: 'version'
value: "${{ steps.semvers.outputs.patch }}"
- commitChange: false
+ commitChange: true
+ branch: 'build-release'
+ labels: 'bump'
+ message: 'Bump version to ${{ steps.semvers.outputs.patch }}'
+ description: 'Automatic version bump to ${{ steps.semvers.outputs.patch }} for release build'
- run: flutter pub get
- run: flutter analyze .
- run: flutter gen-l10n
- - name: 🚀 Shorebird Patch
+ - name: 🚀 Shorebird Release
run: shorebird release android --force --artifact apk '--' --dart-define=BVS="Release ${{ steps.semvers.outputs.v_patch }} ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
diff --git a/pubspec.yaml b/pubspec.yaml
index ffa95d4..24c894b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
-version: 1.7.6+1
+version: 1.7.6
environment:
sdk: ">=2.19.0 <3.0.0"
From a9c7ddb9593c542e54f944633256b09e83d81ca6 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 12:33:07 +0200
Subject: [PATCH 08/34] New semver parsing for workflows
---
.github/workflows/build-patch.yml | 25 +++++++---------------
.github/workflows/build-prerelease-apk.yml | 1 -
.github/workflows/build-preview-apk.yml | 1 -
.github/workflows/build-release-apk.yml | 1 -
.github/workflows/test-coverage.yml | 1 -
pubspec.yaml | 4 ++--
6 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 8e7ce05..255c59f 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -66,27 +66,18 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASS }}
run: |
echo -e "storePassword=$KEYSTORE_PASSWORD\nkeyPassword=$KEY_PASSWORD\nkeyAlias=$KEY_ALIAS\nstoreFile=$RUNNER_TEMP/keystore.jks" > android/key.properties
- - uses: paulhatch/semantic-version@v5.0.2
- id: semver
+ - name: 'Get Previous tag'
+ id: previoustag
+ uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
- # The prefix to use to identify tags
- tag_prefix: "v"
- # A string which, if present in a git commit, indicates that a change represents a
- # major (breaking) change, supports regular expressions wrapped with '/'
- major_pattern: "somethingiwillneverwriteinacommit"
- # A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs
- major_regexp_flags: ""
- # Same as above except indicating a minor change, supports regular expressions wrapped with '/'
- minor_pattern: "somethingiwillalsoneverwriteinacommit"
- # A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs
- minor_regexp_flags: ""
- # A string to determine the format of the version output
- version_format: "${major}.${minor}.${patch}+${increment}"
- bump_each_commit: false
+ fallback: 1.0.0
+ - name: Extract version from tag
+ id: semver
+ uses: damienaicheh/extract-version-from-tag-action@v1.1.0
- run: flutter pub get
- run: flutter analyze .
- run: flutter gen-l10n
- name: 🚀 Shorebird Patch
- run: shorebird patch android --force '--' --dart-define=BVS="Patch v${{ steps.semver.outputs.version }} ShoreBird"
+ run: shorebird patch android --force '--' --dart-define=BVS="Patch ${{ steps.previoustag.outputs.tag }}+$NUMBER_OF_COMMITS ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/build-prerelease-apk.yml b/.github/workflows/build-prerelease-apk.yml
index 53c0cf2..29ad622 100644
--- a/.github/workflows/build-prerelease-apk.yml
+++ b/.github/workflows/build-prerelease-apk.yml
@@ -26,7 +26,6 @@ jobs:
java-version: '11'
- uses: subosito/flutter-action@v2
with:
- flutter-version: '3.10.6'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:' # optional, change this to force refresh cache
diff --git a/.github/workflows/build-preview-apk.yml b/.github/workflows/build-preview-apk.yml
index f54622c..56f84f6 100644
--- a/.github/workflows/build-preview-apk.yml
+++ b/.github/workflows/build-preview-apk.yml
@@ -29,7 +29,6 @@ jobs:
java-version: '11'
- uses: subosito/flutter-action@v2
with:
- flutter-version: '3.10.6'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:' # optional, change this to force refresh cache
diff --git a/.github/workflows/build-release-apk.yml b/.github/workflows/build-release-apk.yml
index e682318..61c023e 100644
--- a/.github/workflows/build-release-apk.yml
+++ b/.github/workflows/build-release-apk.yml
@@ -26,7 +26,6 @@ jobs:
java-version: '11'
- uses: subosito/flutter-action@v2
with:
- flutter-version: '3.10.6'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:' # optional, change this to force refresh cache
diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml
index 557397d..6461af7 100644
--- a/.github/workflows/test-coverage.yml
+++ b/.github/workflows/test-coverage.yml
@@ -68,7 +68,6 @@ jobs:
java-version: '11'
- uses: subosito/flutter-action@v2
with:
- flutter-version: '3.10.6'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:' # optional, change this to force refresh cache
diff --git a/pubspec.yaml b/pubspec.yaml
index 24c894b..f38eb47 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -33,14 +33,14 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
+ flutter_localizations:
+ sdk: flutter
cupertino_icons: ^1.0.2
dio: ^4.0.6
dio_http_cache: ^0.3.0
shared_preferences: ^2.0.17
flutter_session_manager: ^1.0.3
connectivity_plus: ^3.0.2
- flutter_localizations:
- sdk: flutter
intl: any
sentry_flutter: ^7.4.0
firebase_core: ^2.9.0
From 85a8e12b69b40d2f32c8722ed5e90d1708c38b9f Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 12:39:10 +0200
Subject: [PATCH 09/34] Fix escaped html characters showing up in message
---
lib/message.dart | 8 +++++---
lib/messages.dart | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/message.dart b/lib/message.dart
index 5a7bc47..2d53065 100644
--- a/lib/message.dart
+++ b/lib/message.dart
@@ -62,6 +62,8 @@ class MessagePageState extends State {
),
);
+ HtmlUnescape unescape = HtmlUnescape();
+
Map data = response.data;
messages = Stack(
children: [
@@ -89,7 +91,7 @@ class MessagePageState extends State {
const Icon(Icons.arrow_right_rounded, size: 18),
Expanded(
child: Text(
- data["title"],
+ unescape.convert(data["title"]),
overflow: TextOverflow.fade,
maxLines: 5,
softWrap: true,
@@ -102,7 +104,7 @@ class MessagePageState extends State {
const SizedBox(
height: 30,
),
- Text(data["text"]),
+ Text(unescape.convert(data["text"])),
for (Map att in data["attachments"]!)
if (att["name"]!.endsWith(".jpg") ||
att["name"]!.endsWith(".png"))
@@ -150,7 +152,7 @@ class MessagePageState extends State {
Text(
"${r["owner"]["firstname"]} ${r["owner"]["lastname"]}: "),
Text(
- HtmlUnescape().convert(r["text"]),
+ unescape.convert(r["text"]),
),
],
),
diff --git a/lib/messages.dart b/lib/messages.dart
index 968190a..04602c1 100644
--- a/lib/messages.dart
+++ b/lib/messages.dart
@@ -6,6 +6,7 @@ import 'package:eduapge2/message.dart';
import 'package:flutter/material.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
+import 'package:html_unescape/html_unescape.dart';
import 'package:shared_preferences/shared_preferences.dart';
class MessagesPage extends StatefulWidget {
@@ -112,6 +113,7 @@ class TimeTablePageState extends State {
}
Widget getMessages(var apidataMsg) {
+ HtmlUnescape unescape = HtmlUnescape();
List rows = [];
apidataMsg ??= [
{
@@ -172,7 +174,7 @@ class TimeTablePageState extends State {
),
Expanded(
child: Text(
- msg["title"],
+ unescape.convert(msg["title"]),
overflow: TextOverflow.fade,
maxLines: 5,
softWrap: false,
@@ -185,7 +187,7 @@ class TimeTablePageState extends State {
children: [
Expanded(
child: Text(
- msg["text"],
+ unescape.convert(msg["text"]),
style: const TextStyle(fontSize: 12),
overflow: TextOverflow.fade,
maxLines: 5,
@@ -205,7 +207,7 @@ class TimeTablePageState extends State {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
- r["owner"] + ": " + r["text"],
+ r["owner"] + ": " + unescape.convert(r["text"]),
softWrap: false,
overflow: TextOverflow.ellipsis,
),
From 27a57bb364a9e61bc6c980d96fec71979d2b34e9 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 12:52:02 +0200
Subject: [PATCH 10/34] Show message when patching
---
lib/home.dart | 56 +++++++++++++++++++++++++++++++++++++++++++++
lib/l10n/app_cs.arb | 2 ++
lib/l10n/app_en.arb | 2 ++
shorebird.yaml | 2 +-
4 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/lib/home.dart b/lib/home.dart
index a6f82c2..cc6d750 100644
--- a/lib/home.dart
+++ b/lib/home.dart
@@ -12,6 +12,7 @@ import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:package_info/package_info.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
+import 'package:shorebird_code_push/shorebird_code_push_web.dart';
import 'package:url_launcher/url_launcher.dart';
class HomePage extends StatefulWidget {
@@ -143,6 +144,7 @@ class HomePageState extends State {
String baseUrl = "https://lobster-app-z6jfk.ondigitalocean.app/api";
late Response response;
Dio dio = Dio();
+ final ShorebirdCodePush shorebird = ShorebirdCodePush();
bool error = false; //for error status
bool loading = true; //for data featching status
@@ -150,6 +152,8 @@ class HomePageState extends State {
dynamic apidata; //for decoded JSON data
bool refresh = false;
bool updateAvailable = false;
+ bool patchAvailable = false;
+ bool patchDownloaded = false;
bool quickstart = false;
late Map apidataTT;
@@ -163,6 +167,7 @@ class HomePageState extends State {
super.initState();
dio.interceptors
.add(DioCacheManager(CacheConfig(baseUrl: baseUrl)).interceptor);
+ downloadUpdate();
fetchAndCompareBuildName();
getData(); //fetching data
}
@@ -181,6 +186,19 @@ class HomePageState extends State {
return DateTime(now.year, now.month, now.day);
}
+ downloadUpdate() async {
+ final isUpdateAvailable = await shorebird.isNewPatchAvailableForDownload();
+ if (isUpdateAvailable) {
+ setState(() {
+ patchAvailable = true;
+ });
+ await shorebird.downloadUpdateIfAvailable();
+ setState(() {
+ patchDownloaded = true;
+ });
+ }
+ }
+
getData() async {
setState(() {
loading = true;
@@ -486,6 +504,44 @@ class HomePageState extends State {
),
),
),
+ if (patchAvailable)
+ Container(
+ width: MediaQuery.of(context).size.width,
+ margin: const EdgeInsets.only(left: 20, right: 20, top: 10),
+ child: Stack(
+ children: [
+ Card(
+ elevation: 5,
+ child: Padding(
+ padding: const EdgeInsets.only(
+ top: 10, bottom: 10, left: 10, right: 10),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ patchDownloaded
+ ? local!.homePatchDownloaded
+ : local!.homePatchAvailable,
+ style: const TextStyle(fontSize: 20)),
+ ],
+ ),
+ ),
+ ),
+ Positioned(
+ top: 0,
+ right: 0,
+ child: IconButton(
+ icon: const Icon(Icons.close),
+ onPressed: () {
+ setState(() {
+ updateAvailable = false;
+ });
+ },
+ ),
+ ),
+ ],
+ ),
+ ),
if (lunch != -1 && apidataTT["lessons"].length > 0)
Container(
width: MediaQuery.of(context).size.width,
diff --git a/lib/l10n/app_cs.arb b/lib/l10n/app_cs.arb
index 8d4e774..01f1dc2 100644
--- a/lib/l10n/app_cs.arb
+++ b/lib/l10n/app_cs.arb
@@ -64,6 +64,8 @@
"homeUpdateDescription": "Prosím navštivte https://github.com/DislikesSchool/EduPage2/releases pro nejnovější verzi",
"homeQuickstart": "Rychlý start",
"homePreview": "Náhled",
+ "homePatchAvailable": "Instaluje se nový patch...",
+ "homePatchDownloaded": "Patch byl stažen, restartujte aplikaci pro instalaci",
"homeworkTitle": "Domácí úkoly",
"@homeworkTitle": {
"description": "Title of homework page"
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index 120ec4c..b21c37b 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -17,6 +17,8 @@
"homeUpdateDescription": "Please visit https://github.com/DislikesSchool/EduPage2/releases to download the latest version",
"homeQuickstart": "QuickStart",
"homePreview": "Preview",
+ "homePatchAvailable": "Installing new patch...",
+ "homePatchDownloaded": "Patch downloaded, please restart EduPage2",
"homeworkTitle": "Homework",
"messagesTitle": "Messages",
"loginPleaseLogin": "Please login to EduPage2",
diff --git a/shorebird.yaml b/shorebird.yaml
index 40e37fb..b284a33 100644
--- a/shorebird.yaml
+++ b/shorebird.yaml
@@ -10,4 +10,4 @@ app_id: 0f4dc1a8-0c38-409f-838c-9bca97783f4a
# If auto_update: false, you will need to use package:shorebird_code_push to trigger updates.
# https://pub.dev/packages/shorebird_code_push
# Uncomment the following line to disable automatic updates.
-# auto_update: false
+auto_update: false
From 6d4904cd72e111beaee07ee3efd8286100a4aecb Mon Sep 17 00:00:00 2001
From: "Restyled.io"
Date: Sat, 2 Sep 2023 10:54:07 +0000
Subject: [PATCH 11/34] Restyled by astyle
---
linux/flutter/generated_plugin_registrant.cc | 12 ++++++------
windows/flutter/generated_plugin_registrant.cc | 16 ++++++++--------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc
index 25e690a..b4bdd39 100644
--- a/linux/flutter/generated_plugin_registrant.cc
+++ b/linux/flutter/generated_plugin_registrant.cc
@@ -10,10 +10,10 @@
#include
void fl_register_plugins(FlPluginRegistry* registry) {
- g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
- sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
- g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
- url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
+ g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
+ fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
+ sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
+ g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
+ fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
+ url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
}
diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc
index 1cef8a9..2fd961d 100644
--- a/windows/flutter/generated_plugin_registrant.cc
+++ b/windows/flutter/generated_plugin_registrant.cc
@@ -12,12 +12,12 @@
#include
void RegisterPlugins(flutter::PluginRegistry* registry) {
- ConnectivityPlusWindowsPluginRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
- FirebaseCorePluginCApiRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
- SentryFlutterPluginRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
- UrlLauncherWindowsRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("UrlLauncherWindows"));
+ ConnectivityPlusWindowsPluginRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
+ FirebaseCorePluginCApiRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
+ SentryFlutterPluginRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
+ UrlLauncherWindowsRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
From ba390b615eb01d2936a980a09538f9e123c03dd9 Mon Sep 17 00:00:00 2001
From: "Restyled.io"
Date: Sat, 2 Sep 2023 10:54:40 +0000
Subject: [PATCH 12/34] Restyled by prettier-markdown
---
README.md | 2 +-
SECURITY.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index eeb0e7b..d96d3cc 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,6 @@
[![build-release-android](https://github.com/DislikesSchool/EduPage2/actions/workflows/build-release-apk.yml/badge.svg)](https://github.com/DislikesSchool/EduPage2/actions/workflows/build-release-apk.yml) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/dislikesschool/edupage2) ![Downloads](https://img.shields.io/github/downloads/DislikesSchool/EduPage2/total) ![Contributors](https://img.shields.io/github/contributors/DislikesSchool/EduPage2?color=dark-green) ![Issues](https://img.shields.io/github/issues/DislikesSchool/EduPage2) ![License](https://img.shields.io/github/license/DislikesSchool/EduPage2) [![codecov](https://codecov.io/github/DislikesSchool/EduPage2/branch/master/graph/badge.svg?token=HKP9WFL0LN)](https://codecov.io/github/DislikesSchool/EduPage2) [![Discord](https://img.shields.io/discord/1143488418840584224)](https://discord.gg/xy5nqWa2kQ)
-
## Table Of Contents
- [Table Of Contents](#table-of-contents)
@@ -46,6 +45,7 @@ EduPage2 uses local caching on your device, and a caching server with our own pr
**IMPORTANT** EduPage2 is a cutom client for EduPage. We do not have any connection to EduPage.
## Join Our Discord!
+
[![Discord](https://discordapp.com/api/guilds/1143488418840584224/widget.png?style=banner2)](https://discord.gg/xy5nqWa2kQ)
## Built With
diff --git a/SECURITY.md b/SECURITY.md
index d8eefbe..01eec1a 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -4,8 +4,8 @@
### App versions
-| Version | API | Supported | Remote patching * | Changelog |
-| ------- | --- | ------------------ | ------------------ | ----------------------------------------------------------------------------------- |
+| Version | API | Supported | Remote patching \* | Changelog |
+| ------------- | --- | ------------------ | ------------------ | ----------------------------------------------------------------------------------- |
| > 1.7.3 | β13 | :white_check_mark: | :white_check_mark: | [1.7.3...1.7.6](https://github.com/DislikesSchool/EduPage2/compare/v1.7.1...v1.7.3) |
| 1.7.1 - 1.7.3 | β13 | :white_check_mark: | :x: | [1.7.1...1.7.3](https://github.com/DislikesSchool/EduPage2/compare/v1.7.1...v1.7.3) |
| 1.7.1 | β13 | :white_check_mark: | :x: | [1.7.0...1.7.1](https://github.com/DislikesSchool/EduPage2/compare/v1.7.0...v1.7.1) |
From ed13cf10c03f2d7d3887d04569a741482030898d Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sat, 2 Sep 2023 10:55:53 +0000
Subject: [PATCH 13/34] Bump version to 1.7.7
---
pubspec.yaml | 79 ++--------------------------------------------------
1 file changed, 3 insertions(+), 76 deletions(-)
diff --git a/pubspec.yaml b/pubspec.yaml
index f38eb47..a169fb4 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,38 +1,12 @@
name: eduapge2
description: A custom mobile client for EduPage, focusing on design and speed improvement
-# The following line prevents the package from being accidentally published to
-# pub.dev using `flutter pub publish`. This is preferred for private packages.
-publish_to: "none" # Remove this line if you wish to publish to pub.dev
-
-# The following defines the version and build number for your application.
-# A version number is three numbers separated by dots, like 1.2.43
-# followed by an optional build number separated by a +.
-# Both the version and the builder number may be overridden in flutter
-# build by specifying --build-name and --build-number, respectively.
-# In Android, build-name is used as versionName while build-number used as versionCode.
-# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
-# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
-# Read more about iOS versioning at
-# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
-# In Windows, build-name is used as the major, minor, and patch parts
-# of the product and file versions while build-number is used as the build suffix.
-version: 1.7.6
-
+publish_to: none
+version: 1.7.7
environment:
- sdk: ">=2.19.0 <3.0.0"
-
-# Dependencies specify other packages that your package needs in order to work.
-# To automatically upgrade your package dependencies to the latest versions
-# consider running `flutter pub upgrade --major-versions`. Alternatively,
-# dependencies can be manually updated by changing the version numbers below to
-# the latest version available on pub.dev. To see which dependencies have newer
-# versions available, run `flutter pub outdated`.
+ sdk: '>=2.19.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
-
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.2
@@ -53,63 +27,16 @@ dependencies:
package_info: ^2.0.2
url_launcher: ^6.1.12
shorebird_code_push: ^1.1.0
-
dependency_overrides:
flutter_pdfview: 1.2.9
-
dev_dependencies:
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
-
- # The "flutter_lints" package below contains a set of recommended lints to
- # encourage good coding practices. The lint set provided by the package is
- # activated in the `analysis_options.yaml` file located at the root of your
- # package. See that file for information about deactivating specific lint
- # rules and activating additional ones.
flutter_lints: ^2.0.0
-
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter packages.
flutter:
assets:
- shorebird.yaml
generate: true
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
uses-material-design: true
-
- # To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
-
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.dev/assets-and-images/#resolution-aware
-
- # For details regarding adding assets from package dependencies, see
- # https://flutter.dev/assets-and-images/#from-packages
-
- # To add custom fonts to your application, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
- # fonts:
- # - family: Schyler
- # fonts:
- # - asset: fonts/Schyler-Regular.ttf
- # - asset: fonts/Schyler-Italic.ttf
- # style: italic
- # - family: Trajan Pro
- # fonts:
- # - asset: fonts/TrajanPro.ttf
- # - asset: fonts/TrajanPro_Bold.ttf
- # weight: 700
- #
- # For details regarding fonts from package dependencies,
- # see https://flutter.dev/custom-fonts/#from-packages
From fb33f7655fc7d53d3e52e890e368f8a606cb4823 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 12:57:26 +0200
Subject: [PATCH 14/34] Remove flutter analyze from build workflows
---
.github/workflows/build-patch.yml | 1 -
.github/workflows/build-prerelease-apk.yml | 1 -
.github/workflows/build-preview-apk.yml | 1 -
.github/workflows/build-release-apk.yml | 1 -
4 files changed, 4 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 255c59f..ac08027 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -75,7 +75,6 @@ jobs:
id: semver
uses: damienaicheh/extract-version-from-tag-action@v1.1.0
- run: flutter pub get
- - run: flutter analyze .
- run: flutter gen-l10n
- name: 🚀 Shorebird Patch
run: shorebird patch android --force '--' --dart-define=BVS="Patch ${{ steps.previoustag.outputs.tag }}+$NUMBER_OF_COMMITS ShoreBird"
diff --git a/.github/workflows/build-prerelease-apk.yml b/.github/workflows/build-prerelease-apk.yml
index 29ad622..f21dfda 100644
--- a/.github/workflows/build-prerelease-apk.yml
+++ b/.github/workflows/build-prerelease-apk.yml
@@ -67,7 +67,6 @@ jobs:
message: 'Bump version to ${{ steps.semvers.outputs.patch }}'
description: 'Automatic version bump to ${{ steps.semvers.outputs.patch }} for prerelease build'
- run: flutter pub get
- - run: flutter analyze .
- run: flutter gen-l10n
- name: 🚀 Shorebird Release
run: shorebird release android --force --artifact apk '--' --dart-define=BVS="Prerelease ${{ steps.semvers.outputs.v_patch }} ShoreBird"
diff --git a/.github/workflows/build-preview-apk.yml b/.github/workflows/build-preview-apk.yml
index 56f84f6..e5a70e5 100644
--- a/.github/workflows/build-preview-apk.yml
+++ b/.github/workflows/build-preview-apk.yml
@@ -64,7 +64,6 @@ jobs:
version_format: "${major}.${minor}.${patch}+${increment}"
bump_each_commit: false
- run: flutter pub get
- - run: flutter analyze .
- run: flutter gen-l10n
- run: flutter build apk --build-name ${{ steps.semver.outputs.version }} --dart-define=BVS="Preview ${{ steps.semver.outputs.version }} ${{ github.ref_name }} GitHub"
- run: cp "build/app/outputs/apk/release/app-release.apk" "EduPage2-v${{ steps.semver.outputs.version }}.apk"
diff --git a/.github/workflows/build-release-apk.yml b/.github/workflows/build-release-apk.yml
index 61c023e..e49ea19 100644
--- a/.github/workflows/build-release-apk.yml
+++ b/.github/workflows/build-release-apk.yml
@@ -67,7 +67,6 @@ jobs:
message: 'Bump version to ${{ steps.semvers.outputs.patch }}'
description: 'Automatic version bump to ${{ steps.semvers.outputs.patch }} for release build'
- run: flutter pub get
- - run: flutter analyze .
- run: flutter gen-l10n
- name: 🚀 Shorebird Release
run: shorebird release android --force --artifact apk '--' --dart-define=BVS="Release ${{ steps.semvers.outputs.v_patch }} ShoreBird"
From 0e4293fe4fb82236d0fb4afd8a7a01bffcc360fc Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sat, 2 Sep 2023 18:53:51 +0200
Subject: [PATCH 15/34] Fix extrasRow error
---
lib/timetable.dart | 12 ++++++------
linux/flutter/generated_plugin_registrant.cc | 12 ++++++------
windows/flutter/generated_plugin_registrant.cc | 16 ++++++++--------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/lib/timetable.dart b/lib/timetable.dart
index f3002ee..280e3f5 100644
--- a/lib/timetable.dart
+++ b/lib/timetable.dart
@@ -307,11 +307,9 @@ Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
}
}
for (TimeTableClass ttclass in tt.classes) {
- Row extrasRow = const Row(
- children: [],
- );
+ List extrasRow = [];
if (ttclass.data['curriculum'] != null) {
- extrasRow.children.add(
+ extrasRow.add(
Expanded(
child: Text(
ttclass.data['curriculum'],
@@ -324,7 +322,7 @@ Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
}
if (ttclass.data['homeworkNote'] != null &&
ttclass.data['homeworkNote'] != "") {
- extrasRow.children.add(
+ extrasRow.add(
Expanded(
child: Text(
ttclass.data['homeworkNote'],
@@ -378,7 +376,9 @@ Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
)
],
),
- extrasRow,
+ Row(
+ children: extrasRow,
+ ),
],
)),
),
diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc
index b4bdd39..25e690a 100644
--- a/linux/flutter/generated_plugin_registrant.cc
+++ b/linux/flutter/generated_plugin_registrant.cc
@@ -10,10 +10,10 @@
#include
void fl_register_plugins(FlPluginRegistry* registry) {
- g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
- sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
- g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
- url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
+ g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
+ fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
+ sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
+ g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
+ fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
+ url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
}
diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc
index 2fd961d..1cef8a9 100644
--- a/windows/flutter/generated_plugin_registrant.cc
+++ b/windows/flutter/generated_plugin_registrant.cc
@@ -12,12 +12,12 @@
#include
void RegisterPlugins(flutter::PluginRegistry* registry) {
- ConnectivityPlusWindowsPluginRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
- FirebaseCorePluginCApiRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
- SentryFlutterPluginRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
- UrlLauncherWindowsRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("UrlLauncherWindows"));
+ ConnectivityPlusWindowsPluginRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
+ FirebaseCorePluginCApiRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
+ SentryFlutterPluginRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
+ UrlLauncherWindowsRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
From 25bcc6fe6f00c95df55d014b86cf8cf2ca0bbce1 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sun, 3 Sep 2023 08:04:46 +0200
Subject: [PATCH 16/34] Patcher updates
---
lib/home.dart | 151 ++++++++++++++++++++++++++++++++-----------------
pubspec.lock | 128 +++++++++++++++++++++--------------------
pubspec.yaml | 1 +
shorebird.yaml | 3 +-
4 files changed, 168 insertions(+), 115 deletions(-)
diff --git a/lib/home.dart b/lib/home.dart
index cc6d750..9b8d44f 100644
--- a/lib/home.dart
+++ b/lib/home.dart
@@ -10,6 +10,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:package_info/package_info.dart';
+import 'package:restart_app/restart_app.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:shorebird_code_push/shorebird_code_push_web.dart';
@@ -138,13 +139,14 @@ LessonStatus getLessonStatus(List lessons, TimeOfDay currentTime) {
}
}
+final _shorebirdCodePush = ShorebirdCodePush();
+
class HomePageState extends State {
final GlobalKey scaffoldKey = GlobalKey();
late SharedPreferences sharedPreferences;
String baseUrl = "https://lobster-app-z6jfk.ondigitalocean.app/api";
late Response response;
Dio dio = Dio();
- final ShorebirdCodePush shorebird = ShorebirdCodePush();
bool error = false; //for error status
bool loading = true; //for data featching status
@@ -152,9 +154,9 @@ class HomePageState extends State {
dynamic apidata; //for decoded JSON data
bool refresh = false;
bool updateAvailable = false;
- bool patchAvailable = false;
- bool patchDownloaded = false;
bool quickstart = false;
+ final _isShorebirdAvailable = _shorebirdCodePush.isShorebirdAvailable();
+ bool _isCheckingForUpdate = false;
late Map apidataTT;
List apidataMsg = [];
@@ -167,9 +169,96 @@ class HomePageState extends State {
super.initState();
dio.interceptors
.add(DioCacheManager(CacheConfig(baseUrl: baseUrl)).interceptor);
- downloadUpdate();
fetchAndCompareBuildName();
getData(); //fetching data
+ if (!_isCheckingForUpdate) _checkForUpdate(); // ik that it's not necessary
+ }
+
+ Future _checkForUpdate() async {
+ setState(() {
+ _isCheckingForUpdate = true;
+ });
+
+ // Ask the Shorebird servers if there is a new patch available.
+ final isUpdateAvailable =
+ await _shorebirdCodePush.isNewPatchAvailableForDownload();
+
+ if (!mounted) return;
+
+ setState(() {
+ _isCheckingForUpdate = false;
+ });
+
+ if (isUpdateAvailable) {
+ _showUpdateAvailableBanner();
+ } else {
+ ScaffoldMessenger.of(context).showSnackBar(
+ const SnackBar(
+ content: Text('No update available'),
+ ),
+ );
+ }
+ }
+
+ void _showDownloadingBanner() {
+ ScaffoldMessenger.of(context).showMaterialBanner(
+ const MaterialBanner(
+ content: Text('Downloading...'),
+ actions: [
+ SizedBox(
+ height: 14,
+ width: 14,
+ child: CircularProgressIndicator(
+ strokeWidth: 2,
+ ),
+ )
+ ],
+ ),
+ );
+ }
+
+ void _showUpdateAvailableBanner() {
+ ScaffoldMessenger.of(context).showMaterialBanner(
+ MaterialBanner(
+ content: const Text('Update available'),
+ actions: [
+ TextButton(
+ onPressed: () async {
+ ScaffoldMessenger.of(context).hideCurrentMaterialBanner();
+ await _downloadUpdate();
+
+ if (!mounted) return;
+ ScaffoldMessenger.of(context).hideCurrentMaterialBanner();
+ },
+ child: const Text('Download'),
+ ),
+ ],
+ ),
+ );
+ }
+
+ void _showRestartBanner() {
+ ScaffoldMessenger.of(context).showMaterialBanner(
+ const MaterialBanner(
+ content: Text('A new patch is ready!'),
+ actions: [
+ TextButton(
+ // Restart the app for the new patch to take effect.
+ onPressed: Restart.restartApp,
+ child: Text('Restart app'),
+ ),
+ ],
+ ),
+ );
+ }
+
+ Future _downloadUpdate() async {
+ _showDownloadingBanner();
+ await _shorebirdCodePush.downloadUpdateIfAvailable();
+ if (!mounted) return;
+
+ ScaffoldMessenger.of(context).hideCurrentMaterialBanner();
+ _showRestartBanner();
}
@override
@@ -186,19 +275,6 @@ class HomePageState extends State {
return DateTime(now.year, now.month, now.day);
}
- downloadUpdate() async {
- final isUpdateAvailable = await shorebird.isNewPatchAvailableForDownload();
- if (isUpdateAvailable) {
- setState(() {
- patchAvailable = true;
- });
- await shorebird.downloadUpdateIfAvailable();
- setState(() {
- patchDownloaded = true;
- });
- }
- }
-
getData() async {
setState(() {
loading = true;
@@ -504,42 +580,11 @@ class HomePageState extends State {
),
),
),
- if (patchAvailable)
- Container(
- width: MediaQuery.of(context).size.width,
- margin: const EdgeInsets.only(left: 20, right: 20, top: 10),
- child: Stack(
- children: [
- Card(
- elevation: 5,
- child: Padding(
- padding: const EdgeInsets.only(
- top: 10, bottom: 10, left: 10, right: 10),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- patchDownloaded
- ? local!.homePatchDownloaded
- : local!.homePatchAvailable,
- style: const TextStyle(fontSize: 20)),
- ],
- ),
- ),
- ),
- Positioned(
- top: 0,
- right: 0,
- child: IconButton(
- icon: const Icon(Icons.close),
- onPressed: () {
- setState(() {
- updateAvailable = false;
- });
- },
- ),
- ),
- ],
+ if (!_isShorebirdAvailable)
+ Text(
+ 'Shorebird Engine not available.',
+ style: theme.textTheme.bodyLarge?.copyWith(
+ color: theme.colorScheme.error,
),
),
if (lunch != -1 && apidataTT["lessons"].length > 0)
diff --git a/pubspec.lock b/pubspec.lock
index 6971941..adb1ffe 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -141,10 +141,10 @@ packages:
dependency: "direct main"
description:
name: cupertino_icons
- sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
+ sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
url: "https://pub.dev"
source: hosted
- version: "1.0.5"
+ version: "1.0.6"
dart_style:
dependency: transitive
description:
@@ -303,10 +303,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
- sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4"
+ sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
url: "https://pub.dev"
source: hosted
- version: "2.0.2"
+ version: "2.0.3"
flutter_localizations:
dependency: "direct main"
description: flutter
@@ -512,50 +512,50 @@ packages:
dependency: transitive
description:
name: path_provider
- sha256: "909b84830485dbcd0308edf6f7368bc8fd76afa26a270420f34cabea2a6467a0"
+ sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
url: "https://pub.dev"
source: hosted
- version: "2.1.0"
+ version: "2.1.1"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
- sha256: "5d44fc3314d969b84816b569070d7ace0f1dea04bd94a83f74c4829615d22ad8"
+ sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1"
url: "https://pub.dev"
source: hosted
- version: "2.1.0"
+ version: "2.2.0"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
- sha256: "1b744d3d774e5a879bb76d6cd1ecee2ba2c6960c03b1020cd35212f6aa267ac5"
+ sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
url: "https://pub.dev"
source: hosted
- version: "2.3.0"
+ version: "2.3.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
- sha256: ba2b77f0c52a33db09fc8caf85b12df691bf28d983e84cf87ff6d693cfa007b3
+ sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.dev"
source: hosted
- version: "2.2.0"
+ version: "2.2.1"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
- sha256: bced5679c7df11190e1ddc35f3222c858f328fff85c3942e46e7f5589bf9eb84
+ sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
url: "https://pub.dev"
source: hosted
- version: "2.1.0"
+ version: "2.1.1"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
- sha256: ee0e0d164516b90ae1f970bdf29f726f1aa730d7cfc449ecc74c495378b705da
+ sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
url: "https://pub.dev"
source: hosted
- version: "2.2.0"
+ version: "2.2.1"
pedantic:
dependency: transitive
description:
@@ -584,10 +584,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
- sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd"
+ sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
url: "https://pub.dev"
source: hosted
- version: "2.1.5"
+ version: "2.1.6"
process:
dependency: transitive
description:
@@ -620,6 +620,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
+ restart_app:
+ dependency: "direct main"
+ description:
+ name: restart_app
+ sha256: b37daeb1c02fcab30e19d9e30b6fdd215bd53577efd927042eb77cf6f09daadb
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.2.1"
rxdart:
dependency: transitive
description:
@@ -648,58 +656,58 @@ packages:
dependency: "direct main"
description:
name: shared_preferences
- sha256: "0344316c947ffeb3a529eac929e1978fcd37c26be4e8468628bac399365a3ca1"
+ sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac
url: "https://pub.dev"
source: hosted
- version: "2.2.0"
+ version: "2.2.1"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
- sha256: fe8401ec5b6dcd739a0fe9588802069e608c3fdbfd3c3c93e546cf2f90438076
+ sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06"
url: "https://pub.dev"
source: hosted
- version: "2.2.0"
+ version: "2.2.1"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
- sha256: d29753996d8eb8f7619a1f13df6ce65e34bc107bef6330739ed76f18b22310ef
+ sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7"
url: "https://pub.dev"
source: hosted
- version: "2.3.3"
+ version: "2.3.4"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
- sha256: "71d6806d1449b0a9d4e85e0c7a917771e672a3d5dc61149cc9fac871115018e1"
+ sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a
url: "https://pub.dev"
source: hosted
- version: "2.3.0"
+ version: "2.3.1"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
- sha256: "23b052f17a25b90ff2b61aad4cc962154da76fb62848a9ce088efe30d7c50ab1"
+ sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a
url: "https://pub.dev"
source: hosted
- version: "2.3.0"
+ version: "2.3.1"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
- sha256: "7347b194fb0bbeb4058e6a4e87ee70350b6b2b90f8ac5f8bd5b3a01548f6d33a"
+ sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
url: "https://pub.dev"
source: hosted
- version: "2.2.0"
+ version: "2.2.1"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
- sha256: f95e6a43162bce43c9c3405f3eb6f39e5b5d11f65fab19196cf8225e2777624d
+ sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f
url: "https://pub.dev"
source: hosted
- version: "2.3.0"
+ version: "2.3.1"
shorebird_code_push:
dependency: "direct main"
description:
@@ -813,66 +821,66 @@ packages:
dependency: "direct main"
description:
name: url_launcher
- sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e"
+ sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27"
url: "https://pub.dev"
source: hosted
- version: "6.1.12"
+ version: "6.1.14"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
- sha256: "3dd2388cc0c42912eee04434531a26a82512b9cb1827e0214430c9bcbddfe025"
+ sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330
url: "https://pub.dev"
source: hosted
- version: "6.0.38"
+ version: "6.1.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
- sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2"
+ sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f"
url: "https://pub.dev"
source: hosted
- version: "6.1.4"
+ version: "6.1.5"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
- sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5"
+ sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e
url: "https://pub.dev"
source: hosted
- version: "3.0.5"
+ version: "3.0.6"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
- sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1"
+ sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88
url: "https://pub.dev"
source: hosted
- version: "3.0.6"
+ version: "3.0.7"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
- sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea
+ sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618"
url: "https://pub.dev"
source: hosted
- version: "2.1.3"
+ version: "2.1.5"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
- sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4
+ sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5"
url: "https://pub.dev"
source: hosted
- version: "2.0.18"
+ version: "2.0.20"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
- sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422"
+ sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069"
url: "https://pub.dev"
source: hosted
- version: "3.0.7"
+ version: "3.0.8"
uuid:
dependency: transitive
description:
@@ -925,34 +933,34 @@ packages:
dependency: "direct main"
description:
name: webview_flutter
- sha256: "04a0782fb058b7c71f2048935583488f4d32e9147ca403abc4e58f1de9964629"
+ sha256: "82f6787d5df55907aa01e49bd9644f4ed1cc82af7a8257dd9947815959d2e755"
url: "https://pub.dev"
source: hosted
- version: "4.2.3"
+ version: "4.2.4"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
- sha256: bca797abba472868655b5f1a6029c1132385685ee9db4713cb0e7f33076210c6
+ sha256: "0d8f5ac96a155e672129bf94c7abf625de01241d44d269dbaff083f1b4deb1aa"
url: "https://pub.dev"
source: hosted
- version: "3.9.3"
+ version: "3.9.5"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
- sha256: "0ca3cfcc6781a7de701d580917af4a9efc4e3e129f8ead95a80587f0a749480a"
+ sha256: "9d32a63a5ee111b37482cb3eac3379b9f0992afd27a52ee30279dbf06f41918b"
url: "https://pub.dev"
source: hosted
- version: "2.5.0"
+ version: "2.5.1"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
- sha256: ed749f94ac9e814d04a258a9255cf69cfa4cc6006ff59542aea7fb4590144972
+ sha256: d2f7241849582da80b79acb03bb936422412ce5c0c79fb5f6a1de5421a5aecc4
url: "https://pub.dev"
source: hosted
- version: "3.7.3"
+ version: "3.7.4"
win32:
dependency: transitive
description:
@@ -965,10 +973,10 @@ packages:
dependency: transitive
description:
name: xdg_directories
- sha256: f0c26453a2d47aa4c2570c6a033246a3fc62da2fe23c7ffdd0a7495086dc0247
+ sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
url: "https://pub.dev"
source: hosted
- version: "1.0.2"
+ version: "1.0.3"
xml:
dependency: transitive
description:
@@ -986,5 +994,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
- dart: ">=3.1.0-185.0.dev <4.0.0"
- flutter: ">=3.10.0"
+ dart: ">=3.1.0 <4.0.0"
+ flutter: ">=3.13.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index a169fb4..8addfc3 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -27,6 +27,7 @@ dependencies:
package_info: ^2.0.2
url_launcher: ^6.1.12
shorebird_code_push: ^1.1.0
+ restart_app: ^1.2.1
dependency_overrides:
flutter_pdfview: 1.2.9
dev_dependencies:
diff --git a/shorebird.yaml b/shorebird.yaml
index b284a33..6ae6501 100644
--- a/shorebird.yaml
+++ b/shorebird.yaml
@@ -9,5 +9,4 @@ app_id: 0f4dc1a8-0c38-409f-838c-9bca97783f4a
# auto_update controls if Shorebird should automatically update in the background on launch.
# If auto_update: false, you will need to use package:shorebird_code_push to trigger updates.
# https://pub.dev/packages/shorebird_code_push
-# Uncomment the following line to disable automatic updates.
-auto_update: false
+# Uncomment the following line to disable automatic updates.
\ No newline at end of file
From 0306b4849623a806b1ef42fb71f1bda78d6fa213 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sun, 3 Sep 2023 08:06:20 +0200
Subject: [PATCH 17/34] Fix: '_Map' not subtype of String
---
lib/load.dart | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/load.dart b/lib/load.dart
index 84bb230..46d7b4f 100644
--- a/lib/load.dart
+++ b/lib/load.dart
@@ -188,8 +188,14 @@ class LoadingScreenState extends State {
});
if (response.statusCode == 200) {
- if (jsonDecode(response.data)["icanteen"] == true) {
- await sessionManager.set('iCanteenEnabled', true);
+ if (response.data.runtimeType == String) {
+ if (jsonDecode(response.data)["icanteen"] == true) {
+ await sessionManager.set('iCanteenEnabled', true);
+ }
+ } else {
+ if (response.data["icanteen"] == true) {
+ await sessionManager.set('iCanteenEnabled', true);
+ }
}
OneSignal.shared.setExternalUserId(token);
progress = 0.6;
From 3697875a8356bc56a55c9403c3375ec0600fbd51 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sun, 3 Sep 2023 08:13:13 +0200
Subject: [PATCH 18/34] Fix: method '[]' was called on null
---
lib/timetable.dart | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/timetable.dart b/lib/timetable.dart
index 280e3f5..4adf7b0 100644
--- a/lib/timetable.dart
+++ b/lib/timetable.dart
@@ -163,7 +163,9 @@ class TimeTablePageState extends State {
TimeTableClass(
ttLesson["period"]["name"],
ttLesson["subject"]["short"],
- ttLesson["teachers"][0]["short"],
+ ttLesson["teachers"].length > 0
+ ? ttLesson["teachers"][0]["short"]
+ : "?",
ttLesson["period"]["startTime"],
ttLesson["period"]["endTime"],
ttLesson["classrooms"].length > 0
From a735a21d2b1ed8d7b60be6347a8aada427c4a509 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sun, 3 Sep 2023 06:20:49 +0000
Subject: [PATCH 19/34] Bump version to 1.7.8
---
pubspec.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pubspec.yaml b/pubspec.yaml
index 8addfc3..6985dc7 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
name: eduapge2
description: A custom mobile client for EduPage, focusing on design and speed improvement
publish_to: none
-version: 1.7.7
+version: 1.7.8
environment:
sdk: '>=2.19.0 <3.0.0'
dependencies:
From a2b350f9d40299486d723ee5be84e24e4a6c656a Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sun, 3 Sep 2023 08:28:44 +0200
Subject: [PATCH 20/34] Patch workflow update
---
.github/workflows/build-patch.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index ac08027..6c58163 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -72,11 +72,10 @@ jobs:
with:
fallback: 1.0.0
- name: Extract version from tag
- id: semver
uses: damienaicheh/extract-version-from-tag-action@v1.1.0
- run: flutter pub get
- run: flutter gen-l10n
- name: 🚀 Shorebird Patch
- run: shorebird patch android --force '--' --dart-define=BVS="Patch ${{ steps.previoustag.outputs.tag }}+$NUMBER_OF_COMMITS ShoreBird"
+ run: shorebird patch android --force '--' --dart-define=BVS="Patch ${{ steps.previoustag.outputs.tag }}+${{ github.env.NUMBER_OF_COMMITS_SINCE_TAG }} ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
\ No newline at end of file
From 17e5c6b73ab9bf51117131a962c87645493a3767 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Sun, 3 Sep 2023 09:04:52 +0200
Subject: [PATCH 21/34] Remove shorebird engine not available
---
lib/home.dart | 8 --------
1 file changed, 8 deletions(-)
diff --git a/lib/home.dart b/lib/home.dart
index 9b8d44f..0f77df2 100644
--- a/lib/home.dart
+++ b/lib/home.dart
@@ -155,7 +155,6 @@ class HomePageState extends State {
bool refresh = false;
bool updateAvailable = false;
bool quickstart = false;
- final _isShorebirdAvailable = _shorebirdCodePush.isShorebirdAvailable();
bool _isCheckingForUpdate = false;
late Map apidataTT;
@@ -580,13 +579,6 @@ class HomePageState extends State {
),
),
),
- if (!_isShorebirdAvailable)
- Text(
- 'Shorebird Engine not available.',
- style: theme.textTheme.bodyLarge?.copyWith(
- color: theme.colorScheme.error,
- ),
- ),
if (lunch != -1 && apidataTT["lessons"].length > 0)
Container(
width: MediaQuery.of(context).size.width,
From 6021a7b57989bc1d374e440b899650c40c011e32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20=C4=8Cuk=C3=A1=C5=A1?=
<70645520+SAMUELLL41@users.noreply.github.com>
Date: Sun, 3 Sep 2023 09:19:58 +0200
Subject: [PATCH 22/34] Added slovak translation
---
lib/l10n/app_sk.arb | 54 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 lib/l10n/app_sk.arb
diff --git a/lib/l10n/app_sk.arb b/lib/l10n/app_sk.arb
new file mode 100644
index 0000000..993efd1
--- /dev/null
+++ b/lib/l10n/app_sk.arb
@@ -0,0 +1,54 @@
+{
+ "loading": "Načítavam",
+ "mainHome": "Domov",
+ "mainTimetable": "Rozvrh hodín",
+ "mainICanteen": "iCanteen",
+ "mainMessages": "Správy",
+ "mainHomework": "Domáce úlohy",
+ "mainGrades": "Známky",
+ "homeLunchesNotLoaded": "Nepodarilo sa načítať obedy",
+ "homeNoLunchToday": "Dnes nemáte žiadny obed",
+ "homeLunchToday": "Dnes máte možnosť obedu číslo {lunch}",
+ "homeLunchDontForget": "Nezabudnite si objednať obed pre {date}",
+ "homeLogout": "Odhlásiť sa",
+ "homeSetupICanteen": "Nastavenie iCanteen",
+ "homeNoClasses": "Dnes sa škola nekoná :D",
+ "homeUpdateTitle": "Dostupná nová verzia",
+ "homeUpdateDescription": "Prosím, navštívte https://github.com/DislikesSchool/EduPage2/releases pre stiahnutie najnovšej verzie",
+ "homeQuickstart": "Rýchly štart",
+ "homePreview": "Náhľad",
+ "homePatchAvailable": "Inštaluje sa aktualizácia...",
+ "homePatchDownloaded": "Aktualizácia je stiahnutá, prosím reštartujte EduPage2",
+ "homeworkTitle": "Domáce úlohy",
+ "messagesTitle": "Správy",
+ "loginPleaseLogin": "Prosím, prihláste sa do EduPage2",
+ "loginUseExistingCredentials": "Použite svoje existujúce prihlasovacie údaje do EduPage",
+ "loginUsername": "Prihlasovacie meno",
+ "loginPassword": "Heslo",
+ "loginLogin": "Prihlásiť sa",
+ "today": "Dnes",
+ "tomorrow": "Zajtra",
+ "monday": "Pondelok",
+ "tuesday": "Utorok",
+ "wednesday": "Streda",
+ "thursday": "Štvrtok",
+ "friday": "Piatok",
+ "saturday": "Sobota",
+ "sunday": "Nedeľa",
+ "loadCredentials": "Načítavam prihlasovacie údaje...",
+ "loadLoggingIn": "Prihlasovanie...",
+ "loadLoggedIn": "Prihlásený",
+ "loadAccessToken": "Získavam prístupový token...",
+ "loadVerify": "Overujem",
+ "loadDownloadTimetable": "Sťahujem rozvrh hodín...",
+ "loadDownloadMessages": "Sťahujem správy...",
+ "loadDone": "Hotovo!",
+ "iCanteenLoading": "Načítavam obedy (môže to chvíľu trvať)",
+ "iCanteenCantLoad": "Nepodarilo sa načítať obedy",
+ "iCanteenSetupPleaseLogin": "Prihláste sa do iCanteen",
+ "iCanteenSetupDetails": "Adresa URL v tomto formáte: https://lunches.yourschool.com/login",
+ "iCanteenSetupServer": "Adresa servera",
+ "iCanteenSetupEmail": "Používateľské meno",
+ "iCanteenSetupPassword": "Heslo",
+ "messagesLoadingAttachment": "Načítavam PDF..."
+}
From 2dec8f2fbbf8079551a10772d5c6d0ed44dfeef5 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 11:33:17 +0200
Subject: [PATCH 23/34] Fix: context used over async gap
---
lib/icanteen_setup.dart | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/icanteen_setup.dart b/lib/icanteen_setup.dart
index 1e8523d..da5db9b 100644
--- a/lib/icanteen_setup.dart
+++ b/lib/icanteen_setup.dart
@@ -106,12 +106,11 @@ class ICanteenSetupScreenState extends State {
keyboardType: TextInputType.visiblePassword,
),
ElevatedButton(
- onPressed: () async => {
+ onPressed: () => {
if (!hasLogin)
{
- await login(),
- Navigator.pop(context),
- widget.loadedCallback()
+ login().then((value) =>
+ {Navigator.pop(context), widget.loadedCallback()})
},
},
child: !hasLogin
From 736d60040cf609d2fe5b06456cb55d8d0e0f54e1 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 12:45:13 +0200
Subject: [PATCH 24/34] New date rendering in timetable
---
lib/timetable.dart | 179 ++++++++++++++++++++++++++-------------------
1 file changed, 103 insertions(+), 76 deletions(-)
diff --git a/lib/timetable.dart b/lib/timetable.dart
index 4adf7b0..12c4deb 100644
--- a/lib/timetable.dart
+++ b/lib/timetable.dart
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
+import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
@@ -191,39 +192,39 @@ class TimeTablePageState extends State {
body: Stack(
children: [
getTimeTable(
- timetables.firstWhere(
- (element) => isSameDay(
- element.date,
- DateTime.now().add(
- Duration(days: daydiff),
- ),
- ),
- orElse: () => tt,
- ),
- daydiff,
- (diff) => {
- setState(
- () {
- daydiff = daydiff + diff;
- userInteracted = true;
- },
- ),
- loadTt(
- DateTime.now().add(
- Duration(days: daydiff),
- ),
- ).then(
- (value) => {
- tt = value,
- setState(
- () {},
+ timetables.firstWhere(
+ (element) => isSameDay(
+ element.date,
+ DateTime.now().add(
+ Duration(days: daydiff),
),
- },
+ ),
+ orElse: () => tt,
),
- },
- AppLocalizations.of(context),
- userInteracted,
- ),
+ daydiff,
+ (diff) => {
+ setState(
+ () {
+ daydiff = daydiff + diff;
+ userInteracted = true;
+ },
+ ),
+ loadTt(
+ DateTime.now().add(
+ Duration(days: daydiff),
+ ),
+ ).then(
+ (value) => {
+ tt = value,
+ setState(
+ () {},
+ ),
+ },
+ ),
+ },
+ AppLocalizations.of(context),
+ userInteracted,
+ context),
],
),
backgroundColor: Theme.of(context).colorScheme.background,
@@ -258,46 +259,8 @@ class TimeTableClass {
final dynamic data;
}
-String getLabel(DateTime date, AppLocalizations? local) {
- DateTime now = DateTime.now();
- DateTime tmr = now.add(const Duration(days: 1));
- if (date.day == now.day && date.month == now.month && date.year == now.year) {
- return "${local!.today}: ${[
- local.monday,
- local.tuesday,
- local.wednesday,
- local.thursday,
- local.friday,
- local.saturday,
- local.sunday
- ][now.weekday - 1]} ${now.day}.${now.month}.${now.year}";
- } else if (date.day == tmr.day &&
- date.month == tmr.month &&
- date.year == tmr.year) {
- return "${local!.tomorrow}: ${[
- local.monday,
- local.tuesday,
- local.wednesday,
- local.thursday,
- local.friday,
- local.saturday,
- local.sunday
- ][tmr.weekday - 1]} ${tmr.day}.${tmr.month}.${tmr.year}";
- } else {
- return "${[
- local?.monday,
- local?.tuesday,
- local?.wednesday,
- local?.thursday,
- local?.friday,
- local?.saturday,
- local?.sunday
- ][date.weekday - 1]} ${date.day}.${date.month}.${date.year}";
- }
-}
-
Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
- AppLocalizations? local, bool userInteracted) {
+ AppLocalizations? local, bool userInteracted, BuildContext context) {
List rows = [];
if (daydiff == 0 && tt.classes.isNotEmpty) {
String endTime = tt.classes.last.endTime;
@@ -388,6 +351,75 @@ Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
],
));
}
+
+ String getPrefix(DateTime date, Locale local, AppLocalizations? loc) {
+ DateTime now = DateTime.now();
+ DateTime today = DateTime.utc(now.year, now.month, now.day);
+ DateTime tomorrow = today.add(const Duration(days: 1));
+ if (date == today) {
+ return loc!.today;
+ } else if (date == tomorrow) {
+ return loc!.tomorrow;
+ } else {
+ return '';
+ }
+ }
+
+ Widget renderDate(DateTime date, Locale local, AppLocalizations? loc) {
+ String prefix = getPrefix(date, local, loc);
+ String weekday = DateFormat('EEEE', local.toString()).format(date);
+ String day = DateFormat('d', local.toString()).format(date);
+ String month = DateFormat('MMMM', local.toString()).format(date);
+
+ if (prefix.isNotEmpty) {
+ return Column(
+ children: [
+ Align(
+ alignment: Alignment.center,
+ child: Text(
+ prefix.toUpperCase(),
+ style: const TextStyle(
+ fontSize: 24,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Text(
+ '$weekday, $day $month',
+ style: const TextStyle(
+ fontSize: 16,
+ color: Colors.grey,
+ ),
+ ),
+ const SizedBox(height: 8),
+ ],
+ );
+ } else {
+ return Column(
+ children: [
+ Align(
+ alignment: Alignment.center,
+ child: Text(
+ weekday.toUpperCase(),
+ style: const TextStyle(
+ fontSize: 24,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Text(
+ '$day $month',
+ style: const TextStyle(
+ fontSize: 16,
+ color: Colors.grey,
+ ),
+ ),
+ const SizedBox(height: 8),
+ ],
+ );
+ }
+ }
+
return Card(
elevation: 5,
child: Padding(
@@ -402,12 +434,7 @@ Widget getTimeTable(TimeTableData tt, int daydiff, Function(int) modifyDayDiff,
},
icon: const Icon(Icons.keyboard_arrow_left)),
const Spacer(),
- Text(
- getLabel(tt.date, local),
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
+ renderDate(tt.date, Localizations.localeOf(context), local),
const Spacer(),
IconButton(
onPressed: () {
From b10dfba4ff0ea9ccfa65bf50563b0ecf0e85b95b Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 12:45:39 +0200
Subject: [PATCH 25/34] Removed weekdays from translations
---
lib/l10n/app_cs.arb | 7 -------
lib/l10n/app_en.arb | 7 -------
lib/l10n/app_sk.arb | 7 -------
3 files changed, 21 deletions(-)
diff --git a/lib/l10n/app_cs.arb b/lib/l10n/app_cs.arb
index 01f1dc2..9be6d6a 100644
--- a/lib/l10n/app_cs.arb
+++ b/lib/l10n/app_cs.arb
@@ -96,13 +96,6 @@
},
"today": "Dnes",
"tomorrow": "Zítra",
- "monday": "Pondělí",
- "tuesday": "Úterý",
- "wednesday": "Středa",
- "thursday": "Čtvrtek",
- "friday": "Pátek",
- "saturday": "Sobota",
- "sunday": "Neděle",
"loadCredentials": "Načítání přihlašovacích údajů",
"loadLoggingIn": "Přihlašování...",
"loadLoggedIn": "Přihlášeno",
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index b21c37b..f2678b5 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -28,13 +28,6 @@
"loginLogin": "Login",
"today": "Today",
"tomorrow": "Tomorrow",
- "monday": "Monday",
- "tuesday": "Tuesday",
- "wednesday": "Wednesday",
- "thursday": "Thursday",
- "friday": "Friday",
- "saturday": "Saturday",
- "sunday": "Sunday",
"loadCredentials": "Loading credentials...",
"loadLoggingIn": "Logging in...",
"loadLoggedIn": "Logged in",
diff --git a/lib/l10n/app_sk.arb b/lib/l10n/app_sk.arb
index 993efd1..8a16bed 100644
--- a/lib/l10n/app_sk.arb
+++ b/lib/l10n/app_sk.arb
@@ -28,13 +28,6 @@
"loginLogin": "Prihlásiť sa",
"today": "Dnes",
"tomorrow": "Zajtra",
- "monday": "Pondelok",
- "tuesday": "Utorok",
- "wednesday": "Streda",
- "thursday": "Štvrtok",
- "friday": "Piatok",
- "saturday": "Sobota",
- "sunday": "Nedeľa",
"loadCredentials": "Načítavam prihlasovacie údaje...",
"loadLoggingIn": "Prihlasovanie...",
"loadLoggedIn": "Prihlásený",
From 95fecef06bbad4339e84b39f003eb4100a7e3428 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 14:33:25 +0200
Subject: [PATCH 26/34] Fix: NoSuchMethodError: Method '+' called on null
---
lib/home.dart | 7 ++-----
lib/messages.dart | 5 ++---
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/home.dart b/lib/home.dart
index 0f77df2..0f33db6 100644
--- a/lib/home.dart
+++ b/lib/home.dart
@@ -639,11 +639,8 @@ class HomePageState extends State {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
- m["owner"]["firstname"] +
- " " +
- m["owner"]["lastname"] +
- ": " +
- m["text"],
+ '${m["owner"]["firstname"]?.trim()} ${m["owner"]["lastname"]?.trim()}: ${m["text"]}'
+ .replaceAll(RegExp(r'\s+'), ' '),
softWrap: false,
overflow: TextOverflow.ellipsis,
),
diff --git a/lib/messages.dart b/lib/messages.dart
index 04602c1..20e1d11 100644
--- a/lib/messages.dart
+++ b/lib/messages.dart
@@ -163,9 +163,8 @@ class TimeTablePageState extends State {
Row(
children: [
Text(
- msg["owner"]["firstname"] +
- " " +
- msg["owner"]["lastname"],
+ '${msg["owner"]["firstname"]?.trim()} ${msg["owner"]["lastname"]?.trim()}'
+ .replaceAll(RegExp(r'\s+'), ' '),
style: const TextStyle(fontSize: 18),
),
const Icon(
From 83146c139f9992d68c6d4e5deef769b01820639f Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 14:48:57 +0200
Subject: [PATCH 27/34] Patch workflow update
---
.github/workflows/build-patch.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml
index 6c58163..6022500 100644
--- a/.github/workflows/build-patch.yml
+++ b/.github/workflows/build-patch.yml
@@ -76,6 +76,6 @@ jobs:
- run: flutter pub get
- run: flutter gen-l10n
- name: 🚀 Shorebird Patch
- run: shorebird patch android --force '--' --dart-define=BVS="Patch ${{ steps.previoustag.outputs.tag }}+${{ github.env.NUMBER_OF_COMMITS_SINCE_TAG }} ShoreBird"
+ run: shorebird patch android --force '--' --dart-define=BVS="Patch ${{ steps.previoustag.outputs.tag }}+${{ env.NUMBER_OF_COMMITS_SINCE_TAG }} ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
\ No newline at end of file
From fdad5cf3aceee8fd57883a174f5a61835c2a5c1a Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 14:49:21 +0200
Subject: [PATCH 28/34] Add selectable text and clickable links to message
---
lib/message.dart | 13 ++++++++++++-
pubspec.lock | 16 ++++++++++++++++
pubspec.yaml | 1 +
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/lib/message.dart b/lib/message.dart
index 2d53065..7f28071 100644
--- a/lib/message.dart
+++ b/lib/message.dart
@@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';
+import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';
import 'package:html_unescape/html_unescape.dart';
import 'package:shared_preferences/shared_preferences.dart';
+import 'package:url_launcher/url_launcher.dart';
import 'package:webview_flutter/webview_flutter.dart';
class MessagePage extends StatefulWidget {
@@ -104,7 +106,10 @@ class MessagePageState extends State {
const SizedBox(
height: 30,
),
- Text(unescape.convert(data["text"])),
+ SelectableLinkify(
+ text: unescape.convert(data["text"]),
+ onOpen: _onOpen,
+ ),
for (Map att in data["attachments"]!)
if (att["name"]!.endsWith(".jpg") ||
att["name"]!.endsWith(".png"))
@@ -207,3 +212,9 @@ class MessagePageState extends State {
);
}
}
+
+Future _onOpen(LinkableElement link) async {
+ if (!await launchUrl(Uri.parse(link.url))) {
+ throw Exception('Could not launch ${link.url}');
+ }
+}
diff --git a/pubspec.lock b/pubspec.lock
index adb1ffe..8347106 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -299,6 +299,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
+ flutter_linkify:
+ dependency: "direct main"
+ description:
+ name: flutter_linkify
+ sha256: "74669e06a8f358fee4512b4320c0b80e51cffc496607931de68d28f099254073"
+ url: "https://pub.dev"
+ source: hosted
+ version: "6.0.0"
flutter_lints:
dependency: "direct dev"
description:
@@ -412,6 +420,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.4"
+ linkify:
+ dependency: transitive
+ description:
+ name: linkify
+ sha256: "4139ea77f4651ab9c315b577da2dd108d9aa0bd84b5d03d33323f1970c645832"
+ url: "https://pub.dev"
+ source: hosted
+ version: "5.0.0"
lints:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 6985dc7..a72ab01 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -28,6 +28,7 @@ dependencies:
url_launcher: ^6.1.12
shorebird_code_push: ^1.1.0
restart_app: ^1.2.1
+ flutter_linkify: ^6.0.0
dependency_overrides:
flutter_pdfview: 1.2.9
dev_dependencies:
From 6c78b1fcee2d88786d11e75929b03b30c528274d Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 14:49:30 +0200
Subject: [PATCH 29/34] Turn on auto update
---
shorebird.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/shorebird.yaml b/shorebird.yaml
index 6ae6501..b14e9f6 100644
--- a/shorebird.yaml
+++ b/shorebird.yaml
@@ -9,4 +9,5 @@ app_id: 0f4dc1a8-0c38-409f-838c-9bca97783f4a
# auto_update controls if Shorebird should automatically update in the background on launch.
# If auto_update: false, you will need to use package:shorebird_code_push to trigger updates.
# https://pub.dev/packages/shorebird_code_push
-# Uncomment the following line to disable automatic updates.
\ No newline at end of file
+# Uncomment the following line to disable automatic updates.
+auto_update: true
\ No newline at end of file
From f89b47c96672b3fe5fa42c753929a858b7ee848b Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 15:31:13 +0200
Subject: [PATCH 30/34] Move discord button up
---
README.md | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index d96d3cc..2813eb7 100644
--- a/README.md
+++ b/README.md
@@ -15,13 +15,13 @@
-[![build-release-android](https://github.com/DislikesSchool/EduPage2/actions/workflows/build-release-apk.yml/badge.svg)](https://github.com/DislikesSchool/EduPage2/actions/workflows/build-release-apk.yml) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/dislikesschool/edupage2) ![Downloads](https://img.shields.io/github/downloads/DislikesSchool/EduPage2/total) ![Contributors](https://img.shields.io/github/contributors/DislikesSchool/EduPage2?color=dark-green) ![Issues](https://img.shields.io/github/issues/DislikesSchool/EduPage2) ![License](https://img.shields.io/github/license/DislikesSchool/EduPage2) [![codecov](https://codecov.io/github/DislikesSchool/EduPage2/branch/master/graph/badge.svg?token=HKP9WFL0LN)](https://codecov.io/github/DislikesSchool/EduPage2) [![Discord](https://img.shields.io/discord/1143488418840584224)](https://discord.gg/xy5nqWa2kQ)
+[![build-release-android](https://github.com/DislikesSchool/EduPage2/actions/workflows/build-release-apk.yml/badge.svg)](https://github.com/DislikesSchool/EduPage2/actions/workflows/build-release-apk.yml) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/dislikesschool/edupage2) ![Downloads](https://img.shields.io/github/downloads/DislikesSchool/EduPage2/total) ![Contributors](https://img.shields.io/github/contributors/DislikesSchool/EduPage2?color=dark-green) ![Issues](https://img.shields.io/github/issues/DislikesSchool/EduPage2) ![License](https://img.shields.io/github/license/DislikesSchool/EduPage2) [![codecov](https://codecov.io/github/DislikesSchool/EduPage2/branch/master/graph/badge.svg?token=HKP9WFL0LN)](https://codecov.io/github/DislikesSchool/EduPage2)
+[![Discord](https://discordapp.com/api/guilds/1143488418840584224/widget.png?style=banner2)](https://discord.gg/xy5nqWa2kQ)
## Table Of Contents
- [Table Of Contents](#table-of-contents)
- [About The Project](#about-the-project)
-- [Join Our Discord!](#join-our-discord)
- [Built With](#built-with)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
@@ -44,10 +44,6 @@ EduPage2 uses local caching on your device, and a caching server with our own pr
**IMPORTANT** EduPage2 is a cutom client for EduPage. We do not have any connection to EduPage.
-## Join Our Discord!
-
-[![Discord](https://discordapp.com/api/guilds/1143488418840584224/widget.png?style=banner2)](https://discord.gg/xy5nqWa2kQ)
-
## Built With
This is a list of all the main tools, libraries and frameworks, that were used in this project
From 0b56314b4e1021035f0e9851ffceaffb4ff49056 Mon Sep 17 00:00:00 2001
From: vyPal <66716025+vyPal@users.noreply.github.com>
Date: Mon, 4 Sep 2023 15:47:20 +0200
Subject: [PATCH 31/34] Create CONTRIBUTING.md
---
CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 CONTRIBUTING.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..961d841
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,54 @@
+# Contributing to EduPage2
+We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
+
+- Reporting a bug
+- Discussing the current state of the code
+- Submitting a fix
+- Proposing new features
+- Becoming a maintainer
+
+## We Develop with Github
+We use github to host code, to track issues and feature requests, as well as accept pull requests.
+
+## We Use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow), So All Code Changes Happen Through Pull Requests
+Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow)). We actively welcome your pull requests:
+
+1. Fork the repo and create your branch from `master`.
+2. If you've added code that should be tested, add tests.
+3. If you've changed APIs, update the documentation.
+4. Ensure the test suite passes.
+5. Make sure your code lints.
+6. Issue that pull request!
+
+## Any contributions you make will be under the GPL-3.0 Software License
+In short, when you submit code changes, your submissions are understood to be under the same [GPL-3.0 License](https://choosealicense.com/licenses/gpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern.
+
+## Report bugs using Github's [issues](https://github.com/DislikesSchool/EduPage2/issues)
+We use GitHub issues to track public bugs. Report a bug by [opening a new issue](); it's that easy!
+
+## Write bug reports with detail, background, and sample code
+[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug report I wrote, and I think it's not a bad model. Here's [another example from Craig Hockenberry](http://www.openradar.me/11905408), an app developer whom I greatly respect.
+
+**Great Bug Reports** tend to have:
+
+- A quick summary and/or background
+- Steps to reproduce
+ - Be specific!
+ - Give sample code if you can. [My stackoverflow question](http://stackoverflow.com/q/12488905/180626) includes sample code that *anyone* with a base R setup can run to reproduce what I was seeing
+- What you expected would happen
+- What actually happens
+- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
+
+People *love* thorough bug reports. I'm not even kidding.
+
+## Use a Consistent Coding Style
+I'm again borrowing these from [Facebook's Guidelines](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
+
+* 2 spaces for indentation rather than tabs
+* You can try running `flutter analyze` for style unification
+
+## License
+By contributing, you agree that your contributions will be licensed under its MIT License.
+
+## References
+This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
From 3a3c5a3ba41c0f30705299db145584e066ef0cc9 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 16:00:41 +0200
Subject: [PATCH 32/34] Add new contributors to readme
---
README.md | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 2813eb7..139d120 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@
- [Contributing](#contributing)
- [Creating A Pull Request](#creating-a-pull-request)
- [License](#license)
-- [Authors](#authors)
+- [Contributors](#contributors)
- [Acknowledgements](#acknowledgements)
## About The Project
@@ -54,6 +54,7 @@ This is a list of all the main tools, libraries and frameworks, that were used i
- [Express.js](https://expressjs.com/)
- [PlanetScale](https://planetscale.com/)
- [Passport.js](https://www.passportjs.org/)
+- [Shorebird](https://shorebird.dev/)
## Getting Started
@@ -102,10 +103,12 @@ Contributions are what make the open source community such an amazing place to b
Distributed under the MIT License. See [LICENSE](https://github.com/DislikesSchool/EduPage2/blob/master/LICENSE) for more information.
-## Authors
+## Contributors
-- **vyPal** - _A highschool student, who is bored_ - [vyPal](https://github.com/vyPal) - _Author of EduPage2_
-- **czmatejt9** - _Friend_ - [czmatejt9](https://github.com/czmatejt9) - _Helped fix bugs_
+- **[vyPal](https://github.com/vyPal)** - _Author of EduPage2_
+- **[WattMann](https://github.com/WattMann)** - _Created Edupage API in golang_
+- **[czmatejt9](https://github.com/czmatejt9)** - _Helped fix bugs_
+- **[SAMUELLL41](https://github.com/SAMUELLL41)** - _Slovak translation_
## Acknowledgements
From 2ba48c62e4d9bf06275b26b2d5465ad8256b9350 Mon Sep 17 00:00:00 2001
From: vyPal
Date: Mon, 4 Sep 2023 19:16:42 +0200
Subject: [PATCH 33/34] Disclaimer update
---
README.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 139d120..3dffdc3 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,7 @@
- [Table Of Contents](#table-of-contents)
- [About The Project](#about-the-project)
+- [Disclaimer](#disclaimer)
- [Built With](#built-with)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
@@ -42,7 +43,13 @@ And that's why we made EduPage2. So far, EduPage2 lacks a pretty big amount of f
EduPage2 uses local caching on your device, and a caching server with our own privte software, which periodically updates data from EduPage, strips it of all useless data (which EduPage includes for some reason), and finally sends out to your device when requested.
-**IMPORTANT** EduPage2 is a cutom client for EduPage. We do not have any connection to EduPage.
+## Disclaimer
+
+**EduPage2** is an open-source project with contributions from multiple individuals and is not affiliated with or endorsed by the creators of EduPage. EduPage is a separate and (possibly) trademarked platform owned by asc Applied Software Consultants, s.r.o.
+
+Please note that while EduPage2 is designed to work as a drop-in replacement or alternative mobile client for EduPage, it is not officially supported by the EduPage team. Any issues or inquiries related to EduPage2 should be directed to the project's [GitHub Issues](https://github.com/DislikesSchool/EduPage2/issues) provided in this repository.
+
+This project is open source and distributed under the [GPL-3.0 license](https://choosealicense.com/licenses/gpl-3.0/), and all contributions are welcome from the community. However, use it responsibly and in compliance with the terms of use of the original EduPage platform.
## Built With
From c946f7c8922b767d636ef58960ab9f5b6bdc181e Mon Sep 17 00:00:00 2001
From: vyPal
Date: Thu, 7 Sep 2023 17:08:00 +0200
Subject: [PATCH 34/34] Fix shorebird to show notification
---
lib/home.dart | 32 +++-----------------------------
shorebird.yaml | 2 +-
2 files changed, 4 insertions(+), 30 deletions(-)
diff --git a/lib/home.dart b/lib/home.dart
index 0f33db6..e47a3ba 100644
--- a/lib/home.dart
+++ b/lib/home.dart
@@ -13,7 +13,7 @@ import 'package:package_info/package_info.dart';
import 'package:restart_app/restart_app.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
-import 'package:shorebird_code_push/shorebird_code_push_web.dart';
+import 'package:shorebird_code_push/shorebird_code_push.dart';
import 'package:url_launcher/url_launcher.dart';
class HomePage extends StatefulWidget {
@@ -189,20 +189,14 @@ class HomePageState extends State {
});
if (isUpdateAvailable) {
- _showUpdateAvailableBanner();
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('No update available'),
- ),
- );
+ _downloadUpdate();
}
}
void _showDownloadingBanner() {
ScaffoldMessenger.of(context).showMaterialBanner(
const MaterialBanner(
- content: Text('Downloading...'),
+ content: Text('Downloading patch...'),
actions: [
SizedBox(
height: 14,
@@ -216,26 +210,6 @@ class HomePageState extends State {
);
}
- void _showUpdateAvailableBanner() {
- ScaffoldMessenger.of(context).showMaterialBanner(
- MaterialBanner(
- content: const Text('Update available'),
- actions: [
- TextButton(
- onPressed: () async {
- ScaffoldMessenger.of(context).hideCurrentMaterialBanner();
- await _downloadUpdate();
-
- if (!mounted) return;
- ScaffoldMessenger.of(context).hideCurrentMaterialBanner();
- },
- child: const Text('Download'),
- ),
- ],
- ),
- );
- }
-
void _showRestartBanner() {
ScaffoldMessenger.of(context).showMaterialBanner(
const MaterialBanner(
diff --git a/shorebird.yaml b/shorebird.yaml
index b14e9f6..8416cd9 100644
--- a/shorebird.yaml
+++ b/shorebird.yaml
@@ -10,4 +10,4 @@ app_id: 0f4dc1a8-0c38-409f-838c-9bca97783f4a
# If auto_update: false, you will need to use package:shorebird_code_push to trigger updates.
# https://pub.dev/packages/shorebird_code_push
# Uncomment the following line to disable automatic updates.
-auto_update: true
\ No newline at end of file
+auto_update: false
\ No newline at end of file