1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-20 20:13:55 +01:00
git-touch-android-ios-app/lib/models/notification.dart
2019-12-26 18:00:36 +08:00

40 lines
765 B
Dart

import 'package:flutter/material.dart';
import 'package:git_touch/models/github.dart';
import 'package:tuple/tuple.dart';
import '../utils/utils.dart';
class NotificationGroup {
String fullName;
List<GithubNotificationItem> items = [];
Tuple2<String, String> _repo;
String get owner {
if (_repo == null) {
_repo = parseRepositoryFullName(fullName);
}
return _repo.item1;
}
String get name {
if (_repo == null) {
_repo = parseRepositoryFullName(fullName);
}
return _repo.item2;
}
String get key => '_$hashCode';
NotificationGroup(this.fullName);
}
class NotificationModel with ChangeNotifier {
int _count = 0;
int get count => _count;
setCount(int v) {
_count = v;
notifyListeners();
}
}