git-touch-android-ios-app/lib/models/notification.dart

40 lines
765 B
Dart
Raw Normal View History

2019-09-02 14:40:20 +02:00
import 'package:flutter/material.dart';
2019-12-26 11:00:36 +01:00
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);
2019-09-03 05:56:25 +02:00
}
2019-12-26 11:00:36 +01:00
return _repo.item1;
}
2019-09-03 05:56:25 +02:00
2019-12-26 11:00:36 +01:00
String get name {
if (_repo == null) {
_repo = parseRepositoryFullName(fullName);
}
return _repo.item2;
2019-09-03 05:56:25 +02:00
}
2019-12-26 11:00:36 +01:00
String get key => '_$hashCode';
NotificationGroup(this.fullName);
2019-09-03 05:56:25 +02:00
}
2019-09-02 14:40:20 +02:00
class NotificationModel with ChangeNotifier {
int _count = 0;
int get count => _count;
setCount(int v) {
_count = v;
notifyListeners();
}
}