1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-08 23:58:46 +01:00

40 lines
771 B
Dart
Raw Normal View History

2019-09-02 20:40:20 +08:00
import 'package:flutter/material.dart';
2019-12-26 18:00:36 +08:00
import 'package:git_touch/models/github.dart';
import 'package:tuple/tuple.dart';
import '../utils/utils.dart';
class NotificationGroup {
2021-05-16 15:16:35 +08:00
String? fullName;
2019-12-26 18:00:36 +08:00
List<GithubNotificationItem> items = [];
2021-05-16 15:16:35 +08:00
Tuple2<String, String>? _repo;
2019-12-26 18:00:36 +08:00
String get owner {
if (_repo == null) {
2021-05-16 15:16:35 +08:00
_repo = parseRepositoryFullName(fullName!);
2019-09-03 11:56:25 +08:00
}
2021-05-16 15:16:35 +08:00
return _repo!.item1;
2019-12-26 18:00:36 +08:00
}
2019-09-03 11:56:25 +08:00
2019-12-26 18:00:36 +08:00
String get name {
if (_repo == null) {
2021-05-16 15:16:35 +08:00
_repo = parseRepositoryFullName(fullName!);
2019-12-26 18:00:36 +08:00
}
2021-05-16 15:16:35 +08:00
return _repo!.item2;
2019-09-03 11:56:25 +08:00
}
2019-12-26 18:00:36 +08:00
String get key => '_$hashCode';
NotificationGroup(this.fullName);
2019-09-03 11:56:25 +08:00
}
2019-09-02 20:40:20 +08:00
class NotificationModel with ChangeNotifier {
int _count = 0;
int get count => _count;
setCount(int v) {
_count = v;
notifyListeners();
}
}