Skip to content

Commit 3fade53

Browse files
authored
Merge pull request #261 from rokwire/release/v1.3.2
Release/v1.3.2
2 parents 3e3d6e4 + 57f5fcb commit 3fade53

File tree

10 files changed

+68
-13
lines changed

10 files changed

+68
-13
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [1.3.2] - 2023-02-16
10+
### Changed
11+
- Delete poll notification is not a lifecycle notification any more [#2173](https://github.com/rokwire/illinois-app/issues/2173).
12+
### Fixed
13+
- Clear unread notifications count when logged out.
14+
- Formatting date times when using device local time zone [#240](https://github.com/rokwire/app-flutter-plugin/issues/240).
15+
### Added
16+
- Added hint in VerticalTitleValueSection [#2892](https://github.com/rokwire/illinois-app/issues/2892).
17+
- Load poll by id [#2645](https://github.com/rokwire/illinois-app/issues/2645).
18+
19+
## [1.3.1] - 2023-01-03
20+
### Deleted
21+
- Removed category from inbox message model [#237](https://github.com/rokwire/app-flutter-plugin/issues/237).
22+
923
## [1.3.0] - 2022-12-22
1024
### Fixed
1125
- Fix launchUrlString LaunchMode [#167](https://github.com/rokwire/app-flutter-plugin/issues/167).

SECURITY.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ Patches for [ **illinois-app** ] will only be applied to the following versions:
66

77
| Version | Supported |
88
| ------- | ------------------ |
9+
| 1.3.2 | :white_check_mark: |
910
| 1.3.0 | :white_check_mark: |
1011
| 1.2.4 | :white_check_mark: |
11-
| 1.2.3 | :white_check_mark: |
12-
| 1.2.2 | :white_check_mark: |
1312
| 1.2.0 | :white_check_mark: |
1413
| 1.1.0 | :white_check_mark: |
1514
| 1.0.2 | :white_check_mark: |
16-
| 1.0.1 | :white_check_mark: |
17-
| 1.0.0 | :white_check_mark: |
1815
| < 1.1.0 | :x: |
1916

2017
## Reporting a Bug or Vulnerability

example/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ packages:
687687
path: ".."
688688
relative: true
689689
source: path
690-
version: "1.3.0"
690+
version: "1.3.2"
691691
shared_preferences:
692692
dependency: transitive
693693
description:

ios/rokwire_plugin.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'rokwire_plugin'
7-
s.version = '1.3.0'
7+
s.version = '1.3.2'
88
s.summary = 'Rokwire Flutter plugin'
99
s.description = <<-DESC
1010
Rokwire Flutter plugin

lib/model/inbox.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class InboxMessage {
88
final String? messageId;
99
final int? priority;
1010
final String? topic;
11-
final String? category;
1211

1312
final DateTime? dateCreatedUtc;
1413
final DateTime? dateUpdatedUtc;
@@ -24,7 +23,7 @@ class InboxMessage {
2423
final InboxSender? sender;
2524
final List<InboxRecepient>? recepients;
2625

27-
InboxMessage({this.messageId, this.priority, this.topic, this.category,
26+
InboxMessage({this.messageId, this.priority, this.topic,
2827
this.dateCreatedUtc, this.dateUpdatedUtc, this.dateSentUtc,
2928
this.subject, this.body, this.data,
3029
this.mute, this.read,
@@ -36,7 +35,6 @@ class InboxMessage {
3635
messageId: JsonUtils.stringValue(json['id']),
3736
priority: JsonUtils.intValue(json['priority']),
3837
topic: JsonUtils.stringValue(json['topic']),
39-
category: JsonUtils.stringValue(json['category']),
4038

4139
dateCreatedUtc: DateTimeUtils.dateTimeFromString(JsonUtils.stringValue(json['date_created'])),
4240
dateUpdatedUtc: DateTimeUtils.dateTimeFromString(JsonUtils.stringValue(json['date_updated'])),

lib/service/app_datetime.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ class AppDateTime with Service {
125125
format = iso8601DateTimeFormat;
126126
}
127127
DateFormat dateFormat = DateFormat(format, locale);
128-
if (ignoreTimeZone! || useDeviceLocalTimeZone) {
128+
if (ignoreTimeZone!) {
129129
formattedDateTime = dateFormat.format(dateTime);
130+
} else if (useDeviceLocalTimeZone) {
131+
DateTime? dt = (dateTime.isUtc) ? getDeviceTimeFromUtcTime(dateTime) : dateTime;
132+
formattedDateTime = (dt != null) ? dateFormat.format(dt) : null;
130133
} else {
131134
timezone.Location? uniLocation = universityLocation;
132135
timezone.TZDateTime? tzDateTime = (uniLocation != null) ? timezone.TZDateTime.from(dateTime, uniLocation) : null;

lib/service/inbox.dart

+3
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ class Inbox with Service implements NotificationsListener {
404404
debugPrint('Failed to retrieve unread messages count. Reason: $responseCode, $responseBody');
405405
}
406406
}
407+
else {
408+
_applyUnreadMessagesCount(0);
409+
}
407410
}
408411

409412
void _applyUnreadMessagesCount(int? unreadMessagesCount){

lib/service/polls.dart

+20-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ class Polls with Service implements NotificationsListener {
4242
static const String notifyResultsChanged = "edu.illinois.rokwire.poll.resultschanged"; // poll updated
4343
static const String notifyVoteChanged = "edu.illinois.rokwire.poll.votechanged"; // poll updated
4444
static const String notifyStatusChanged = "edu.illinois.rokwire.poll.statuschnaged"; // poll closed, results could be presented
45+
static const String notifyDeleted = "edu.illinois.rokwire.poll.deleted";
4546

4647
static const String notifyLifecycleCreate = "edu.illinois.rokwire.poll.lifecycle.create";
4748
static const String notifyLifecycleOpen = "edu.illinois.rokwire.poll.lifecycle.open";
4849
static const String notifyLifecycleClose = "edu.illinois.rokwire.poll.lifecycle.close";
4950
static const String notifyLifecycleVote = "edu.illinois.rokwire.poll.lifecycle.vote";
50-
static const String notifyLifecycleDelete = "edu.illinois.rokwire.poll.lifecycle.delete";
5151

5252
final Map<String, PollChunk> _pollChunks = <String, PollChunk>{};
5353

@@ -281,8 +281,8 @@ class Polls with Service implements NotificationsListener {
281281
PollChunk? pollChunk = _pollChunks[pollId];
282282
if (pollChunk != null) {
283283
removePollChunk(pollChunk);
284-
NotificationService().notify(notifyLifecycleDelete, pollChunk.poll);
285284
}
285+
NotificationService().notify(notifyDeleted, pollId);
286286
}
287287
else {
288288
throw PollsException(PollsError.serverResponse, '${response?.statusCode} ${response?.body}');
@@ -326,6 +326,24 @@ class Polls with Service implements NotificationsListener {
326326
return null;
327327
}
328328

329+
Future<Poll?> loadById(String pollId) async {
330+
if (!enabled) {
331+
debugPrint('Failed to load poll with id "$pollId". Missing polls url');
332+
return null;
333+
}
334+
String url = '${Config().quickPollsUrl}/polls/$pollId';
335+
Response? response = await Network().get(url, auth: Auth2());
336+
int responseCode = response?.statusCode ?? -1;
337+
String? responseBody = response?.body;
338+
if (responseCode == 200) {
339+
Poll? poll = Poll.fromJson(JsonUtils.decodeMap(responseBody));
340+
return poll;
341+
} else {
342+
debugPrint('Failed to load poll with id "$pollId". Reason: $responseCode, $responseBody');
343+
return null;
344+
}
345+
}
346+
329347
bool presentPollId(String? pollId) {
330348
if (enabled && presentPoll == null) {
331349
PollChunk? pollChunk = _pollChunks[pollId];

lib/ui/widgets/section.dart

+22
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ class VerticalTitleValueSection extends StatelessWidget {
3030
final Color? valueTextColor;
3131
final TextStyle? valueTextStyle;
3232

33+
final String? hint;
34+
final String? hintFontFamily;
35+
final double hintFontSize;
36+
final Color? hintTextColor;
37+
final TextStyle? hintTextStyle;
38+
3339
final BoxBorder? border;
3440
final Color? borderColor;
3541
final double borderWidth;
@@ -50,6 +56,12 @@ class VerticalTitleValueSection extends StatelessWidget {
5056
this.valueTextColor,
5157
this.valueTextStyle,
5258

59+
this.hint,
60+
this.hintFontFamily,
61+
this.hintFontSize = 12,
62+
this.hintTextColor,
63+
this.hintTextStyle,
64+
5365
this.border,
5466
this.borderColor,
5567
this.borderWidth = 3,
@@ -76,6 +88,15 @@ class VerticalTitleValueSection extends StatelessWidget {
7688
@protected TextStyle get defaultValueTextStyle => TextStyle(fontFamily: displayValueFontFamily, fontSize: valueFontSize, color: displayValueTextColor);
7789
@protected TextStyle get displayValueTextStyle => valueTextStyle ?? defaultValueTextStyle;
7890

91+
@protected Color? get defaultHintTextColor => Styles().colors?.textBackground;
92+
@protected Color? get displayHintTextColor => hintTextColor ?? defaultHintTextColor;
93+
94+
@protected String? get defaultHintFontFamily => Styles().fontFamilies?.regular;
95+
@protected String? get displayHintFontFamily => hintFontFamily ?? defaultHintFontFamily;
96+
97+
@protected TextStyle get defaultHintTextStyle => TextStyle(fontFamily: displayHintFontFamily, fontSize: hintFontSize, color: displayHintTextColor);
98+
@protected TextStyle get displayHintTextStyle => hintTextStyle ?? defaultHintTextStyle;
99+
79100
@protected Color get defaultBorderColor => Styles().colors?.fillColorSecondary ?? Colors.transparent;
80101
@protected Color get displayBorderColor => borderColor ?? defaultBorderColor;
81102

@@ -94,6 +115,7 @@ class VerticalTitleValueSection extends StatelessWidget {
94115
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
95116
(title != null) ? Row(children: [Expanded(child: Text(title ?? '', style: displayTitleTextStyle,))]) : Container(),
96117
(value != null) ? Row(children: [Expanded(child: Text(value ?? '', style: displayValueTextStyle))]) : Container(),
118+
(hint != null) ? Row(children: [Expanded(child: Text(hint ?? '', style: displayHintTextStyle))]) : Container(),
97119
],),
98120
),
99121
),

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: rokwire_plugin
22
description: Rokwire Flutter plugin
3-
version: 1.3.0
3+
version: 1.3.2
44
homepage:
55

66
environment:

0 commit comments

Comments
 (0)