mirror of
https://github.com/git-touch/git-touch
synced 2025-03-07 20:57:44 +01:00
fix: dark mode for notification screen
This commit is contained in:
parent
2bc130b91a
commit
743d359665
@ -103,6 +103,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||
BuildContext context,
|
||||
MapEntry<String, NotificationGroup> entry,
|
||||
Map<String, NotificationGroup> groupMap) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final group = entry.value;
|
||||
return ListGroup(
|
||||
title: Row(
|
||||
@ -110,7 +111,11 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
group.fullName,
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.palette.text,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
@ -120,7 +125,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||
},
|
||||
child: Icon(
|
||||
Octicons.check,
|
||||
color: Colors.black45,
|
||||
color: theme.palette.tertiaryText,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../models/theme.dart';
|
||||
import '../widgets/empty.dart';
|
||||
|
||||
var borderColor = Color.fromRGBO(27, 31, 35, .15);
|
||||
|
||||
class ListGroup<T> extends StatelessWidget {
|
||||
final Widget title;
|
||||
final List<T> items;
|
||||
@ -16,10 +16,11 @@ class ListGroup<T> extends StatelessWidget {
|
||||
this.padding = const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||
});
|
||||
|
||||
Widget _buildItem(MapEntry<int, T> entry) {
|
||||
Widget _buildItem(BuildContext context, MapEntry<int, T> entry) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(top: BorderSide(color: borderColor)),
|
||||
border: Border(top: BorderSide(color: theme.palette.border)),
|
||||
),
|
||||
child: itemBuilder(entry.value, entry.key),
|
||||
);
|
||||
@ -27,25 +28,26 @@ class ListGroup<T> extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return Container(
|
||||
padding: padding,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: borderColor),
|
||||
border: Border.all(color: theme.palette.border),
|
||||
borderRadius: BorderRadius.all(Radius.circular(3)),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
color: Color(0xfff6f8fa),
|
||||
padding: EdgeInsets.all(8),
|
||||
child: title,
|
||||
),
|
||||
Container(padding: EdgeInsets.all(8), child: title),
|
||||
items.isEmpty
|
||||
? EmptyWidget()
|
||||
: Column(
|
||||
children: items.asMap().entries.map(_buildItem).toList())
|
||||
children: items
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => _buildItem(context, e))
|
||||
.toList())
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -7,6 +7,8 @@ import 'package:git_touch/models/auth.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
|
||||
import '../models/theme.dart';
|
||||
|
||||
class NotificationItem extends StatefulWidget {
|
||||
final GithubNotificationItem payload;
|
||||
final Function markAsRead;
|
||||
@ -111,6 +113,7 @@ class _NotificationItemState extends State<NotificationItem> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return Link(
|
||||
url: _url,
|
||||
onTap: _markAsRead,
|
||||
@ -128,7 +131,7 @@ class _NotificationItemState extends State<NotificationItem> {
|
||||
child: Text(
|
||||
payload.subject.title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15),
|
||||
style: TextStyle(fontSize: 15, color: theme.palette.text),
|
||||
),
|
||||
),
|
||||
Link(child: _buildCheckIcon(), onTap: _markAsRead),
|
||||
|
Loading…
x
Reference in New Issue
Block a user