mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 16:25:17 +00:00
Load group information
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import 'package:comunic/helpers/groups_helper.dart';
|
||||
import 'package:comunic/helpers/preferences_helper.dart';
|
||||
import 'package:comunic/models/advanced_group_info.dart';
|
||||
|
||||
/// Forez group helper
|
||||
///
|
||||
@ -6,6 +8,8 @@ import 'package:comunic/helpers/preferences_helper.dart';
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
AdvancedGroupInfo _forezGroup;
|
||||
|
||||
class ForezGroupHelper {
|
||||
static Future<void> setId(int groupID) async {
|
||||
(await PreferencesHelper.getInstance())
|
||||
@ -16,4 +20,14 @@ class ForezGroupHelper {
|
||||
return (await PreferencesHelper.getInstance())
|
||||
.getInt(PreferencesKeyList.FOREZ_GROUP);
|
||||
}
|
||||
|
||||
static Future<void> refreshInfo() async {
|
||||
final res = await GroupsHelper().getAdvancedInfo(await getId());
|
||||
assert(res.status == GetAdvancedInfoStatus.SUCCESS);
|
||||
_forezGroup = res.info;
|
||||
}
|
||||
|
||||
static AdvancedGroupInfo getGroup() => _forezGroup;
|
||||
}
|
||||
|
||||
AdvancedGroupInfo get forezGroup => ForezGroupHelper.getGroup();
|
||||
|
Reference in New Issue
Block a user