1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-07 11:13:21 +01:00

improvement: dark mode style

This commit is contained in:
Rongjian Zhang 2020-01-14 13:51:53 +08:00
parent a1bf2555b7
commit 70ef6d3173
6 changed files with 18 additions and 23 deletions

View File

@ -350,7 +350,7 @@ class ThemeModel with ChangeNotifier {
return Container( return Container(
height: 216, height: 216,
child: CupertinoPicker( child: CupertinoPicker(
backgroundColor: CupertinoColors.white, backgroundColor: palette.background,
children: groupItem.items.map((v) => Text(v.text)).toList(), children: groupItem.items.map((v) => Text(v.text)).toList(),
itemExtent: 40, itemExtent: 40,
scrollController: FixedExtentScrollController( scrollController: FixedExtentScrollController(

View File

@ -8,11 +8,11 @@ import 'package:git_touch/scaffolds/refresh_stateful.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/app_bar_title.dart'; import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/avatar.dart'; import 'package:git_touch/widgets/avatar.dart';
import 'package:git_touch/widgets/label.dart';
import 'package:git_touch/widgets/mutation_button.dart'; import 'package:git_touch/widgets/mutation_button.dart';
import 'package:git_touch/widgets/link.dart'; import 'package:git_touch/widgets/link.dart';
import 'package:git_touch/widgets/markdown_view.dart'; import 'package:git_touch/widgets/markdown_view.dart';
import 'package:git_touch/widgets/table_view.dart'; import 'package:git_touch/widgets/table_view.dart';
import 'package:primer/primer.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:git_touch/models/theme.dart'; import 'package:git_touch/models/theme.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
@ -191,20 +191,11 @@ class RepositoryScreen extends StatelessWidget {
spacing: 4, spacing: 4,
runSpacing: 4, runSpacing: 4,
children: repo.repositoryTopics.nodes.map((node) { children: repo.repositoryTopics.nodes.map((node) {
return Container( return MyLabel(
padding: name: node.topic.name,
EdgeInsets.symmetric(vertical: 4, horizontal: 8), // color: Colors.blue.shade50,
decoration: BoxDecoration( color: theme.palette.grayBackground,
color: PrimerColors.blue000, textColor: theme.palette.primary,
borderRadius: BorderRadius.all(Radius.circular(4)),
),
child: Text(
node.topic.name,
style: TextStyle(
fontSize: 15,
color: theme.palette.primary,
),
),
); );
}).toList(), }).toList(),
) )

View File

@ -91,7 +91,7 @@ class IssueItem extends StatelessWidget {
runSpacing: 4, runSpacing: 4,
children: (payload['labels']['nodes'] as List) children: (payload['labels']['nodes'] as List)
.map((label) { .map((label) {
return Label( return MyLabel(
name: label['name'], name: label['name'],
cssColor: label['color'], cssColor: label['color'],
); );

View File

@ -1,15 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
class Label extends StatelessWidget { class MyLabel extends StatelessWidget {
final String name; final String name;
final Color color; final Color color;
final String cssColor; final String cssColor;
final Color textColor;
Label({ MyLabel({
@required this.name, @required this.name,
this.color, this.color,
this.cssColor, this.cssColor,
this.textColor,
}); });
@override @override
@ -25,8 +27,8 @@ class Label extends StatelessWidget {
name, name,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
color: getFontColorByBrightness(_color), color: textColor ?? getFontColorByBrightness(_color),
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
), ),
), ),
); );

View File

@ -68,9 +68,11 @@ class _NotificationItemState extends State<NotificationItem> {
} }
Widget _buildCheckIcon() { Widget _buildCheckIcon() {
final theme = Provider.of<ThemeModel>(context);
return Icon( return Icon(
payload.unread ? Octicons.check : Octicons.primitive_dot, payload.unread ? Octicons.check : Octicons.primitive_dot,
color: loading ? Colors.black12 : Colors.black45, color:
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
size: 24, size: 24,
); );
} }

View File

@ -68,7 +68,7 @@ class TimelineItem extends StatelessWidget {
InlineSpan _buildLabel(p) { InlineSpan _buildLabel(p) {
return WidgetSpan( return WidgetSpan(
child: Label( child: MyLabel(
name: p['label']['name'], name: p['label']['name'],
cssColor: p['label']['color'], cssColor: p['label']['color'],
), ),