refactor: palette

This commit is contained in:
Rongjian Zhang
2020-01-27 15:11:51 +08:00
parent cc7a2f7075
commit da16197bb0
35 changed files with 120 additions and 149 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ class MyApp extends StatelessWidget {
brightness: theme.brightness,
primaryColor:
theme.brightness == Brightness.dark ? null : Colors.white,
accentColor: theme.paletteOf(context).primary,
scaffoldBackgroundColor: theme.paletteOf(context).background,
accentColor: theme.palette.primary,
scaffoldBackgroundColor: theme.palette.background,
),
home: Home(),
);
+2 -2
View File
@@ -72,7 +72,7 @@ class _HomeState extends State<Home> {
right: -2,
top: -2,
child: Icon(Octicons.primitive_dot,
color: theme.paletteOf(context).primary, size: 14))
color: theme.palette.primary, size: 14))
],
);
}
@@ -141,7 +141,7 @@ class _HomeState extends State<Home> {
return Scaffold(
body: _buildScreen(active),
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: theme.paletteOf(context).primary,
selectedItemColor: theme.palette.primary,
items: _navigationItems,
currentIndex: active,
type: BottomNavigationBarType.fixed,
+4 -5
View File
@@ -157,14 +157,13 @@ class ThemeModel with ChangeNotifier {
border: Colors.grey.shade700,
);
Palette paletteOf(BuildContext context) {
Palette get palette {
switch (brightness) {
case Brightness.light:
return paletteLight;
case Brightness.dark:
return paletteDark;
case Brightness.light:
default:
throw 'brightnessOf should not return null';
return paletteLight;
}
}
@@ -364,7 +363,7 @@ class ThemeModel with ChangeNotifier {
return Container(
height: 216,
child: CupertinoPicker(
backgroundColor: paletteOf(context).background,
backgroundColor: palette.background,
children: groupItem.items.map((v) => Text(v.text)).toList(),
itemExtent: 40,
scrollController: FixedExtentScrollController(
+4 -5
View File
@@ -134,21 +134,20 @@ class _LongListStatefulScaffoldState<T, K>
child: Container(
padding: CommonStyle.padding,
decoration: BoxDecoration(
border: Border.all(color: theme.paletteOf(context).text),
border: Border.all(color: theme.palette.text),
),
child: Column(
children: <Widget>[
Text('$count hidden items',
style: TextStyle(
color: theme.paletteOf(context).text, fontSize: 15)),
style:
TextStyle(color: theme.palette.text, fontSize: 15)),
Padding(padding: EdgeInsets.only(top: 4)),
loadingMore
? CupertinoActivityIndicator()
: Text(
'Load more...',
style: TextStyle(
color: theme.paletteOf(context).primary,
fontSize: 16),
color: theme.palette.primary, fontSize: 16),
),
],
),
+1 -2
View File
@@ -51,8 +51,7 @@ class _AboutScreenState extends State<AboutScreen> {
SizedBox(height: 12),
Text(
'GitTouch',
style:
TextStyle(fontSize: 20, color: theme.paletteOf(context).text),
style: TextStyle(fontSize: 20, color: theme.palette.text),
),
SizedBox(height: 48),
TableView(items: [
+2 -2
View File
@@ -79,7 +79,7 @@ class CommitsScreen extends StatelessWidget {
payload.messageHeadline,
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).text,
color: theme.palette.text,
),
overflow: TextOverflow.ellipsis,
),
@@ -93,7 +93,7 @@ class CommitsScreen extends StatelessWidget {
Text(
' committed ${timeago.format(payload.committedDate)}',
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 15,
),
),
+2 -2
View File
@@ -84,7 +84,7 @@ class GitlabProjectScreen extends StatelessWidget {
CommonStyle.verticalGap,
if (data.languages.isNotEmpty)
Container(
color: theme.paletteOf(context).background,
color: theme.palette.background,
padding: CommonStyle.padding.copyWith(top: 8, bottom: 8),
child: ClipRRect(
borderRadius: BorderRadius.circular(2),
@@ -131,7 +131,7 @@ class GitlabProjectScreen extends StatelessWidget {
if (data.readme != null)
Container(
padding: CommonStyle.padding,
color: theme.paletteOf(context).background,
color: theme.palette.background,
child: MarkdownView(data.readme),
),
CommonStyle.verticalGap,
+1 -1
View File
@@ -47,7 +47,7 @@ class GitlabProjectActivity extends StatelessWidget {
TextSpan(
text: data.author.name,
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontWeight: FontWeight.w500,
),
),
+3 -4
View File
@@ -13,7 +13,7 @@ class GitlabTodosScreen extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context);
return TextSpan(
text: p.author.name,
style: TextStyle(color: theme.paletteOf(context).primary),
style: TextStyle(color: theme.palette.primary),
);
}
@@ -21,7 +21,7 @@ class GitlabTodosScreen extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context);
return TextSpan(
text: '${p.project.pathWithNamespace}!${p.target.iid}',
style: TextStyle(color: theme.paletteOf(context).primary),
style: TextStyle(color: theme.palette.primary),
);
}
@@ -85,8 +85,7 @@ class GitlabTodosScreen extends StatelessWidget {
child: Text.rich(
TextSpan(
style: TextStyle(
color: theme.paletteOf(context).text,
fontSize: 17),
color: theme.palette.text, fontSize: 17),
children: [
..._buildItem(context, item),
],
+1 -2
View File
@@ -18,8 +18,7 @@ class ImageViewScreen extends StatelessWidget {
title: title,
body: PhotoView(
imageProvider: NetworkImage(url),
backgroundDecoration:
BoxDecoration(color: theme.paletteOf(context).background),
backgroundDecoration: BoxDecoration(color: theme.palette.background),
),
);
}
+4 -4
View File
@@ -427,7 +427,7 @@ mutation {
'$owner / $name',
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
),
),
SizedBox(width: 4),
@@ -435,7 +435,7 @@ mutation {
'#$number',
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
),
),
],
@@ -462,7 +462,7 @@ mutation {
Text(
'${p['changedFiles']} files changed',
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 17,
),
),
@@ -485,7 +485,7 @@ mutation {
),
Icon(
Icons.chevron_right,
color: theme.paletteOf(context).border,
color: theme.palette.border,
),
],
)
+4 -7
View File
@@ -39,8 +39,7 @@ class _LoginScreenState extends State<LoginScreen> {
child: Container(
padding: CommonStyle.padding,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: theme.paletteOf(context).border)),
border: Border(bottom: BorderSide(color: theme.palette.border)),
),
child: Row(
children: <Widget>[
@@ -72,8 +71,7 @@ class _LoginScreenState extends State<LoginScreen> {
child: Container(
padding: EdgeInsets.symmetric(vertical: 20),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: theme.paletteOf(context).border)),
border: Border(bottom: BorderSide(color: theme.palette.border)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -130,8 +128,7 @@ class _LoginScreenState extends State<LoginScreen> {
Text(
'user, repo, read:org, notifications',
style: TextStyle(
fontSize: 16,
color: theme.paletteOf(context).primary),
fontSize: 16, color: theme.palette.primary),
)
],
),
@@ -181,7 +178,7 @@ class _LoginScreenState extends State<LoginScreen> {
// Text(
// 'api, read_user, read_repository',
// style: TextStyle(
// fontSize: 16, color: theme.paletteOf(context).primary),
// fontSize: 16, color: theme.palette.primary),
// )
// ],
// ),
+2 -2
View File
@@ -114,7 +114,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: theme.paletteOf(context).text,
color: theme.palette.text,
),
),
GestureDetector(
@@ -125,7 +125,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
},
child: Icon(
Octicons.check,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
size: 24,
),
),
+1 -1
View File
@@ -152,7 +152,7 @@ class ObjectScreen extends StatelessWidget {
return PhotoView(
imageProvider: NetworkImage(rawUrl),
backgroundDecoration:
BoxDecoration(color: theme.paletteOf(context).background),
BoxDecoration(color: theme.palette.background),
);
case 'md':
case 'markdown':
+10 -10
View File
@@ -62,7 +62,7 @@ class RepositoryScreen extends StatelessWidget {
Widget _buildLanguages(BuildContext context, GhRepoRepository repo) {
final theme = Provider.of<ThemeModel>(context);
return Container(
color: theme.paletteOf(context).background,
color: theme.palette.background,
padding: CommonStyle.padding,
height: 300,
child: SingleChildScrollView(
@@ -84,7 +84,7 @@ class RepositoryScreen extends StatelessWidget {
Text(
edge.node.name,
style: TextStyle(
color: theme.paletteOf(context).text,
color: theme.palette.text,
fontSize: 18,
),
),
@@ -95,7 +95,7 @@ class RepositoryScreen extends StatelessWidget {
child: Text(
'${(edge.size / repo.languages.totalSize * 100).toStringAsFixed(1)}%',
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 18,
),
),
@@ -170,7 +170,7 @@ class RepositoryScreen extends StatelessWidget {
'$owner / $name',
style: TextStyle(
fontSize: 20,
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
),
),
],
@@ -250,7 +250,7 @@ class RepositoryScreen extends StatelessWidget {
Text(
repo.description,
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 17,
),
),
@@ -260,7 +260,7 @@ class RepositoryScreen extends StatelessWidget {
child: Text(
repo.homepageUrl,
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontSize: 17,
),
),
@@ -274,8 +274,8 @@ class RepositoryScreen extends StatelessWidget {
return MyLabel(
name: node.topic.name,
// color: Colors.blue.shade50,
color: theme.paletteOf(context).grayBackground,
textColor: theme.paletteOf(context).primary,
color: theme.palette.grayBackground,
textColor: theme.palette.primary,
);
}).toList(),
)
@@ -314,7 +314,7 @@ class RepositoryScreen extends StatelessWidget {
);
},
child: Container(
// color: theme.paletteOf(context).background,
// color: theme.palette.background,
padding: CommonStyle.padding.copyWith(top: 8, bottom: 8),
child: ClipRRect(
borderRadius: BorderRadius.circular(5),
@@ -410,7 +410,7 @@ class RepositoryScreen extends StatelessWidget {
if (readme != null)
Container(
padding: CommonStyle.padding,
color: theme.paletteOf(context).background,
color: theme.palette.background,
child: MarkdownView(
readme,
basePaths: [owner, name, branch ?? 'master'], // TODO:
+1 -1
View File
@@ -39,7 +39,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
Widget _buildRightWidget(BuildContext context, bool checked) {
final theme = Provider.of<ThemeModel>(context);
if (!checked) return null;
return Icon(Icons.check, color: theme.paletteOf(context).primary, size: 24);
return Icon(Icons.check, color: theme.palette.primary, size: 24);
}
@override
+1 -1
View File
@@ -53,7 +53,7 @@ class TrendingScreen extends StatelessWidget {
Icon(
Octicons.repo,
size: 15,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
),
SizedBox(width: 2),
Text(item.repo.name)
+6 -7
View File
@@ -108,7 +108,7 @@ class UserScreen extends StatelessWidget {
Text(
name,
style: TextStyle(
color: theme.paletteOf(context).text,
color: theme.palette.text,
fontSize: 20,
fontWeight: FontWeight.w600,
),
@@ -118,7 +118,7 @@ class UserScreen extends StatelessWidget {
Text(
login,
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontSize: 18,
),
),
@@ -128,13 +128,13 @@ class UserScreen extends StatelessWidget {
Icon(
Octicons.clock,
size: 16,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
),
SizedBox(width: 4),
Text(
'Joined on ${dateFormat.format(createdAt)}',
style: TextStyle(
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
fontSize: 16,
),
),
@@ -145,7 +145,7 @@ class UserScreen extends StatelessWidget {
Text(
bio,
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 17,
),
)
@@ -256,8 +256,7 @@ class UserScreen extends StatelessWidget {
leftIconData: Octicons.organization,
text: TextContainsOrganization(
p.company,
style: TextStyle(
fontSize: 17, color: theme.paletteOf(context).text),
style: TextStyle(fontSize: 17, color: theme.palette.text),
oneLine: true,
),
),
+3 -3
View File
@@ -104,7 +104,7 @@ class UsersScreen extends StatelessWidget {
Icon(
Octicons.organization,
size: 15,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
),
SizedBox(width: 4),
Text(company),
@@ -117,7 +117,7 @@ class UsersScreen extends StatelessWidget {
Icon(
Octicons.location,
size: 15,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
),
SizedBox(width: 4),
Text(location),
@@ -129,7 +129,7 @@ class UsersScreen extends StatelessWidget {
Icon(
Octicons.clock,
size: 15,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
),
SizedBox(width: 4),
Text('Joined on ${dateFormat.format(createdAt)}'),
+2 -2
View File
@@ -66,7 +66,7 @@ TextSpan createLinkSpan(
return TextSpan(
text: text,
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontWeight: FontWeight.w600,
),
recognizer: TapGestureRecognizer()
@@ -160,7 +160,7 @@ class PrimerBranchName extends StatelessWidget {
child: Text(
name,
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontSize: 14,
height: 1,
fontFamily: CommonStyle.monospace,
+1 -2
View File
@@ -39,8 +39,7 @@ class BlobView extends StatelessWidget {
case 'webp':
return PhotoView(
imageProvider: NetworkImage(payload),
backgroundDecoration:
BoxDecoration(color: theme.paletteOf(context).background),
backgroundDecoration: BoxDecoration(color: theme.palette.background),
);
case 'md':
case 'markdown':
+3 -4
View File
@@ -21,7 +21,7 @@ class BorderView extends StatelessWidget {
margin: EdgeInsets.only(left: leftPadding),
decoration: BoxDecoration(
border: Border(
top: BorderSide(color: theme.paletteOf(context).border, width: 0),
top: BorderSide(color: theme.palette.border, width: 0),
),
),
);
@@ -33,15 +33,14 @@ class BorderView extends StatelessWidget {
width: leftPadding,
height: height,
child: DecoratedBox(
decoration:
BoxDecoration(color: theme.paletteOf(context).background),
decoration: BoxDecoration(color: theme.palette.background),
),
),
Expanded(
child: SizedBox(
height: height,
child: DecoratedBox(
decoration: BoxDecoration(color: theme.paletteOf(context).border),
decoration: BoxDecoration(color: theme.palette.border),
),
),
),
+4 -8
View File
@@ -59,8 +59,7 @@ class CommentItem extends StatelessWidget {
Text(
timeago.format(DateTime.parse(payload['createdAt'])),
style: TextStyle(
color: theme.paletteOf(context).tertiaryText,
fontSize: 13),
color: theme.palette.tertiaryText, fontSize: 13),
),
],
),
@@ -93,8 +92,7 @@ class CommentItem extends StatelessWidget {
SizedBox(width: 4),
Text(numberFormat.format(count),
style: TextStyle(
color: theme.paletteOf(context).primary,
fontSize: 14))
color: theme.palette.primary, fontSize: 14))
],
),
),
@@ -122,11 +120,9 @@ class CommentItem extends StatelessWidget {
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: <Widget>[
Text('+',
style:
TextStyle(color: theme.paletteOf(context).primary)),
Text('+', style: TextStyle(color: theme.palette.primary)),
Icon(Octicons.smiley,
color: theme.paletteOf(context).primary, size: 18),
color: theme.palette.primary, size: 18),
],
),
),
+2 -2
View File
@@ -31,14 +31,14 @@ class EntryItem extends StatelessWidget {
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: theme.paletteOf(context).text,
color: theme.palette.text,
),
),
Text(
text,
style: TextStyle(
fontSize: 14,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontWeight: FontWeight.w500,
),
)
+15 -18
View File
@@ -19,7 +19,7 @@ class EventItem extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context);
return TextSpan(
text: text,
style: TextStyle(color: theme.paletteOf(context).primary),
style: TextStyle(color: theme.palette.primary),
recognizer: TapGestureRecognizer()
..onTap = () {
theme.push(context, url);
@@ -62,7 +62,7 @@ class EventItem extends StatelessWidget {
TextSpan(
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).text,
color: theme.palette.text,
),
children: [
_buildLinkSpan(
@@ -77,7 +77,7 @@ class EventItem extends StatelessWidget {
Text(timeago.format(e.createdAt),
style: TextStyle(
fontSize: 14,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
)),
],
),
@@ -99,7 +99,7 @@ class EventItem extends StatelessWidget {
spans: [
TextSpan(
text: ' ' + e.type,
style: TextStyle(color: theme.paletteOf(context).primary),
style: TextStyle(color: theme.palette.primary),
)
],
card: Text('Woops, ${e.type} not implemented yet'),
@@ -114,15 +114,14 @@ class EventItem extends StatelessWidget {
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: theme.paletteOf(context).grayBackground,
color: theme.palette.grayBackground,
borderRadius: BorderRadius.all(Radius.circular(4))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(
style: TextStyle(
color: theme.paletteOf(context).text, fontSize: 15),
style: TextStyle(color: theme.palette.text, fontSize: 15),
children: [
TextSpan(
text:
@@ -141,7 +140,7 @@ class EventItem extends StatelessWidget {
Text(
commit.sha.substring(0, 7),
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontSize: 15,
fontFamily: CommonStyle.monospace,
),
@@ -152,8 +151,7 @@ class EventItem extends StatelessWidget {
commit.message,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: theme.paletteOf(context).text, fontSize: 15),
style: TextStyle(color: theme.palette.text, fontSize: 15),
),
)
],
@@ -192,7 +190,7 @@ class EventItem extends StatelessWidget {
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: theme.paletteOf(context).grayBackground,
color: theme.palette.grayBackground,
borderRadius: BorderRadius.all(Radius.circular(4))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -207,7 +205,7 @@ class EventItem extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 17,
color: theme.paletteOf(context).text,
color: theme.palette.text,
),
overflow: TextOverflow.ellipsis,
),
@@ -219,9 +217,8 @@ class EventItem extends StatelessWidget {
body,
overflow: TextOverflow.ellipsis,
maxLines: 3,
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
fontSize: 15),
style:
TextStyle(color: theme.palette.secondaryText, fontSize: 15),
),
Row(
children: <Widget>[
@@ -230,20 +227,20 @@ class EventItem extends StatelessWidget {
Text(issue.user.login,
style: TextStyle(
fontSize: 14,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
)),
Expanded(child: Container()),
if (issue.comments != null) ...[
Icon(
Octicons.comment,
size: 14,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
),
SizedBox(width: 4),
Text(issue.comments.toString(),
style: TextStyle(
fontSize: 14,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
)),
]
],
+4 -5
View File
@@ -73,7 +73,7 @@ class IssueItem extends StatelessWidget {
TextSpan(
text: '#${payload['number']}',
style: TextStyle(
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
fontWeight: FontWeight.normal,
),
),
@@ -81,7 +81,7 @@ class IssueItem extends StatelessWidget {
),
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).text,
color: theme.palette.text,
fontWeight: FontWeight.w600,
),
),
@@ -100,7 +100,7 @@ class IssueItem extends StatelessWidget {
DefaultTextStyle(
style: TextStyle(
fontSize: 14,
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
@@ -125,8 +125,7 @@ class IssueItem extends StatelessWidget {
Expanded(child: SizedBox()),
Icon(Octicons.comment,
size: 14,
color:
theme.paletteOf(context).secondaryText),
color: theme.palette.secondaryText),
SizedBox(width: 3),
Text(numberFormat
.format(payload['comments']['totalCount']))
+2 -2
View File
@@ -20,7 +20,7 @@ class ListGroup<T> extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context);
return Container(
decoration: BoxDecoration(
border: Border(top: BorderSide(color: theme.paletteOf(context).border)),
border: Border(top: BorderSide(color: theme.palette.border)),
),
child: itemBuilder(entry.value, entry.key),
);
@@ -33,7 +33,7 @@ class ListGroup<T> extends StatelessWidget {
padding: padding,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: theme.paletteOf(context).border),
border: Border.all(color: theme.palette.border),
borderRadius: BorderRadius.all(Radius.circular(3)),
),
child: Column(
+7 -8
View File
@@ -22,8 +22,8 @@ class MarkdownView extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
final code = Provider.of<CodeModel>(context);
final _basicStyle = TextStyle(
fontSize: 16, color: theme.paletteOf(context).text, height: 1.5);
final _basicStyle =
TextStyle(fontSize: 16, color: theme.palette.text, height: 1.5);
final _hStyle =
_basicStyle.copyWith(fontWeight: FontWeight.w600, height: 1.25);
@@ -71,7 +71,7 @@ class MarkdownView extends StatelessWidget {
},
data: text,
styleSheet: MarkdownStyleSheet(
a: _basicStyle.copyWith(color: theme.paletteOf(context).primary),
a: _basicStyle.copyWith(color: theme.palette.primary),
p: _basicStyle,
code: _basicStyle.copyWith(
fontSize: 16 * 0.85,
@@ -84,12 +84,11 @@ class MarkdownView extends StatelessWidget {
h4: _hStyle,
h5: _hStyle.copyWith(fontSize: 14),
h6: _hStyle.copyWith(
fontSize: 16 * 0.85, color: theme.paletteOf(context).tertiaryText),
fontSize: 16 * 0.85, color: theme.palette.tertiaryText),
em: _basicStyle.copyWith(fontStyle: FontStyle.italic),
strong: _basicStyle.copyWith(fontWeight: FontWeight.w600),
del: const TextStyle(decoration: TextDecoration.lineThrough),
blockquote:
_basicStyle.copyWith(color: theme.paletteOf(context).tertiaryText),
blockquote: _basicStyle.copyWith(color: theme.palette.tertiaryText),
img: _basicStyle,
checkbox: _basicStyle,
blockSpacing: 16,
@@ -107,14 +106,14 @@ class MarkdownView extends StatelessWidget {
),
codeblockPadding: EdgeInsets.all(16),
codeblockDecoration: BoxDecoration(
color: theme.paletteOf(context).grayBackground,
color: theme.palette.grayBackground,
borderRadius: BorderRadius.circular(3),
),
horizontalRuleDecoration: BoxDecoration(
border: Border(
top: BorderSide(
width: 4,
color: theme.paletteOf(context).grayBackground,
color: theme.palette.grayBackground,
),
),
),
+2 -2
View File
@@ -17,7 +17,7 @@ class MutationButton extends StatelessWidget {
return CupertinoButton(
onPressed: onPressed,
minSize: 0,
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
padding: EdgeInsets.symmetric(
horizontal: 12,
vertical: 4,
@@ -27,7 +27,7 @@ class MutationButton extends StatelessWidget {
text,
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).background,
color: theme.palette.background,
),
),
);
+3 -5
View File
@@ -71,9 +71,8 @@ class _NotificationItemState extends State<NotificationItem> {
final theme = Provider.of<ThemeModel>(context);
return Icon(
payload.unread ? Octicons.check : Octicons.primitive_dot,
color: loading
? theme.paletteOf(context).grayBackground
: theme.paletteOf(context).tertiaryText,
color:
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
size: 24,
);
}
@@ -134,8 +133,7 @@ class _NotificationItemState extends State<NotificationItem> {
child: Text(
payload.subject.title,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15, color: theme.paletteOf(context).text),
style: TextStyle(fontSize: 15, color: theme.palette.text),
),
),
Link(child: _buildCheckIcon(), onTap: _markAsRead),
+9 -12
View File
@@ -80,14 +80,14 @@ class RepositoryItem extends StatelessWidget {
text: '$owner / ',
style: TextStyle(
fontSize: 18,
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
),
),
TextSpan(
text: name,
style: TextStyle(
fontSize: 18,
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontWeight: FontWeight.w600,
),
// overflow: TextOverflow.ellipsis,
@@ -100,10 +100,8 @@ class RepositoryItem extends StatelessWidget {
SizedBox(width: 6),
DefaultTextStyle(
child: Icon(iconData,
size: 18,
color: theme.paletteOf(context).secondaryText),
style: TextStyle(
color: theme.paletteOf(context).secondaryText),
size: 18, color: theme.palette.secondaryText),
style: TextStyle(color: theme.palette.secondaryText),
),
]
],
@@ -113,7 +111,7 @@ class RepositoryItem extends StatelessWidget {
Text(
description,
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 16,
),
),
@@ -124,14 +122,13 @@ class RepositoryItem extends StatelessWidget {
note,
style: TextStyle(
fontSize: 14,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
),
),
SizedBox(height: 10),
],
DefaultTextStyle(
style: TextStyle(
color: theme.paletteOf(context).text, fontSize: 14),
style: TextStyle(color: theme.palette.text, fontSize: 14),
child: Row(
children: <Widget>[
if (primaryLanguageName != null) ...[
@@ -152,14 +149,14 @@ class RepositoryItem extends StatelessWidget {
],
if (starCount > 0) ...[
Icon(Octicons.star,
size: 16, color: theme.paletteOf(context).text),
size: 16, color: theme.palette.text),
SizedBox(width: 2),
Text(numberFormat.format(starCount)),
SizedBox(width: 24),
],
if (forkCount > 0) ...[
Icon(Octicons.repo_forked,
size: 16, color: theme.paletteOf(context).text),
size: 16, color: theme.palette.text),
SizedBox(width: 2),
Text(numberFormat.format(forkCount)),
],
+5 -8
View File
@@ -18,8 +18,7 @@ class TableViewHeader extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: Text(
title.toUpperCase(),
style: TextStyle(
color: theme.paletteOf(context).secondaryText, fontSize: 13),
style: TextStyle(color: theme.palette.secondaryText, fontSize: 13),
),
);
}
@@ -72,7 +71,7 @@ class TableView extends StatelessWidget {
if (leftWidget == null && hasIcon) {
leftWidget = Icon(
item.leftIconData,
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
size: 20,
);
}
@@ -81,8 +80,7 @@ class TableView extends StatelessWidget {
onTap: item.onTap,
url: item.url,
child: DefaultTextStyle(
style: TextStyle(
fontSize: 17, color: theme.paletteOf(context).text),
style: TextStyle(fontSize: 17, color: theme.palette.text),
overflow: TextOverflow.ellipsis,
child: Container(
height: 44,
@@ -97,7 +95,7 @@ class TableView extends StatelessWidget {
DefaultTextStyle(
style: TextStyle(
fontSize: 17,
color: theme.paletteOf(context).tertiaryText,
color: theme.palette.tertiaryText,
),
child: item.rightWidget,
),
@@ -106,8 +104,7 @@ class TableView extends StatelessWidget {
if ((item.onTap != null || item.url != null) &&
!item.hideRightChevron)
Icon(CupertinoIcons.right_chevron,
size: 20,
color: theme.paletteOf(context).tertiaryText)
size: 20, color: theme.palette.tertiaryText)
else
SizedBox(width: 2),
SizedBox(width: 8),
+3 -4
View File
@@ -34,8 +34,7 @@ class TimelineEventItem extends StatelessWidget {
Expanded(
child: Text.rich(
TextSpan(
style:
TextStyle(color: theme.paletteOf(context).text, fontSize: 16),
style: TextStyle(color: theme.palette.text, fontSize: 16),
children: [
// TODO: actor is null
createUserSpan(context, actor),
@@ -288,12 +287,12 @@ class TimelineItem extends StatelessWidget {
TextSpan(text: ' branch from '),
TextSpan(
text: (p['beforeCommit']['oid'] as String).substring(0, 7),
style: TextStyle(color: theme.paletteOf(context).primary),
style: TextStyle(color: theme.palette.primary),
),
TextSpan(text: ' to '),
TextSpan(
text: (p['afterCommit']['oid'] as String).substring(0, 7),
style: TextStyle(color: theme.paletteOf(context).primary),
style: TextStyle(color: theme.palette.primary),
),
],
),
+3 -3
View File
@@ -46,7 +46,7 @@ class UserItem extends StatelessWidget {
// Text(
// name ?? login,
// style: TextStyle(
// color: theme.paletteOf(context).text,
// color: theme.palette.text,
// fontSize: 18,
// ),
// ),
@@ -54,7 +54,7 @@ class UserItem extends StatelessWidget {
Text(
login,
style: TextStyle(
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
fontSize: 18,
fontWeight: FontWeight.w600,
),
@@ -65,7 +65,7 @@ class UserItem extends StatelessWidget {
if (bio != null)
DefaultTextStyle(
style: TextStyle(
color: theme.paletteOf(context).secondaryText,
color: theme.palette.secondaryText,
fontSize: 16,
),
child: bio,
+1 -1
View File
@@ -22,7 +22,7 @@ class UserName extends StatelessWidget {
login,
style: TextStyle(
fontWeight: FontWeight.w600,
color: theme.paletteOf(context).primary,
color: theme.palette.primary,
),
),
),