mirror of
https://github.com/git-touch/git-touch
synced 2025-01-31 08:04:51 +01:00
feat: dart theme style tweak
This commit is contained in:
parent
d4efab4af2
commit
6a872fc977
@ -111,10 +111,10 @@ class ThemeModel with ChangeNotifier {
|
||||
);
|
||||
case Brightness.dark:
|
||||
return Palette(
|
||||
primary: PrimerColors.blue500,
|
||||
text: PrimerColors.gray400,
|
||||
secondaryText: PrimerColors.gray500,
|
||||
tertiaryText: PrimerColors.gray600,
|
||||
primary: PrimerColors.blue400,
|
||||
text: PrimerColors.gray300,
|
||||
secondaryText: PrimerColors.gray400,
|
||||
tertiaryText: PrimerColors.gray500,
|
||||
background: PrimerColors.black,
|
||||
border: PrimerColors.gray900,
|
||||
);
|
||||
|
@ -104,6 +104,8 @@ class _LongListStatefulScaffoldState<T, K>
|
||||
}
|
||||
|
||||
Widget _buildItem(BuildContext context, int index) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
if (index % 2 == 1) {
|
||||
return CommonStyle.border;
|
||||
}
|
||||
@ -131,19 +133,20 @@ class _LongListStatefulScaffoldState<T, K>
|
||||
child: Container(
|
||||
padding: CommonStyle.padding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black12),
|
||||
border: Border.all(color: theme.palette.text),
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text('$count hidden items',
|
||||
style: TextStyle(color: Colors.black87, fontSize: 15)),
|
||||
style:
|
||||
TextStyle(color: theme.palette.text, fontSize: 15)),
|
||||
Padding(padding: EdgeInsets.only(top: 4)),
|
||||
loadingMore
|
||||
? CupertinoActivityIndicator()
|
||||
: Text(
|
||||
'Load more...',
|
||||
style:
|
||||
TextStyle(color: Colors.blueAccent, fontSize: 16),
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary, fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1,16 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/screens/gitlab/issue.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/avatar.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class GitlabTodosScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return RefreshStatefulScaffold(
|
||||
title: Text('Todos'),
|
||||
fetchData: () {
|
||||
@ -39,7 +41,7 @@ class GitlabTodosScreen extends StatelessWidget {
|
||||
TextSpan(
|
||||
text: item['author']['name'],
|
||||
style: TextStyle(
|
||||
color: PrimerColors.blue500,
|
||||
color: theme.palette.primary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
|
@ -5,7 +5,6 @@ import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/single.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../widgets/link.dart';
|
||||
import '../widgets/loading.dart';
|
||||
@ -23,18 +22,19 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
String _gitlabDomain = 'https://gitlab.com';
|
||||
|
||||
Widget _buildAccountItem(int index) {
|
||||
final settings = Provider.of<AuthModel>(context);
|
||||
final account = settings.accounts[index];
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final account = auth.accounts[index];
|
||||
|
||||
return Link(
|
||||
onTap: () {
|
||||
// Navigator.of(context).pop();
|
||||
settings.setActiveAccountIndex(index);
|
||||
auth.setActiveAccountIndex(index);
|
||||
},
|
||||
child: Container(
|
||||
padding: CommonStyle.padding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: Colors.black12)),
|
||||
border: Border(bottom: BorderSide(color: theme.palette.border)),
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
@ -50,7 +50,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
(index == settings.activeAccountIndex)
|
||||
(index == auth.activeAccountIndex)
|
||||
? Icon(Icons.check)
|
||||
: Container(),
|
||||
],
|
||||
@ -60,11 +60,13 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
}
|
||||
|
||||
Widget _buildAddItem({String text, Function onTap}) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Link(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: Colors.black12)),
|
||||
border: Border(bottom: BorderSide(color: theme.palette.border)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -81,6 +83,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return SingleScaffold(
|
||||
title: AppBarTitle('Select account'),
|
||||
@ -120,7 +123,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
Text(
|
||||
'user, repo, read:org',
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: PrimerColors.blue500),
|
||||
fontSize: 16, color: theme.palette.primary),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -170,7 +173,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
Text(
|
||||
'api, read_user, read_repository',
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: PrimerColors.blue500),
|
||||
fontSize: 16, color: theme.palette.primary),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -176,6 +176,8 @@ class RepositoryScreen extends StatelessWidget {
|
||||
(repo['languages']['edges'] as List).length +
|
||||
1;
|
||||
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
@ -204,7 +206,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
CommonStyle.verticalGap,
|
||||
if ((repo['languages']['edges'] as List).isNotEmpty)
|
||||
Container(
|
||||
color: Colors.white,
|
||||
color: theme.palette.background,
|
||||
padding: CommonStyle.padding.copyWith(top: 8, bottom: 8),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
@ -333,7 +335,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
if (readme != null)
|
||||
Container(
|
||||
padding: CommonStyle.padding,
|
||||
color: Colors.white,
|
||||
color: theme.palette.background,
|
||||
child: MarkdownView(
|
||||
readme,
|
||||
basePaths: [owner, name, branch ?? 'master'], // TODO:
|
||||
|
@ -18,7 +18,6 @@ import 'package:git_touch/models/auth.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:git_touch/widgets/action_button.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
|
||||
class UserScreen extends StatelessWidget {
|
||||
final String login;
|
||||
@ -187,6 +186,7 @@ class UserScreen extends StatelessWidget {
|
||||
var user = data[0];
|
||||
var contributions = data[1];
|
||||
final isOrganization = user['__typename'] == 'Organization';
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@ -250,10 +250,11 @@ class UserScreen extends StatelessWidget {
|
||||
if (!isOrganization && isNotNullOrEmpty(user['company']))
|
||||
TableViewItem(
|
||||
leftIconData: Octicons.organization,
|
||||
text: TextContainsOrganization(user['company'],
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: PrimerColors.gray900),
|
||||
overflow: TextOverflow.ellipsis),
|
||||
text: TextContainsOrganization(
|
||||
user['company'],
|
||||
style: TextStyle(fontSize: 16, color: theme.palette.text),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
if (isNotNullOrEmpty(user['location']))
|
||||
TableViewItem(
|
||||
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/screens/repository.dart';
|
||||
import 'package:git_touch/screens/user.dart';
|
||||
import 'package:git_touch/widgets/border_view.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
|
@ -40,6 +40,8 @@ class CommentItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
@ -57,7 +59,8 @@ class CommentItem extends StatelessWidget {
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
timeago.format(DateTime.parse(payload['createdAt'])),
|
||||
style: TextStyle(color: Colors.black54, fontSize: 13),
|
||||
style: TextStyle(
|
||||
color: theme.palette.tertiaryText, fontSize: 13),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -90,7 +93,7 @@ class CommentItem extends StatelessWidget {
|
||||
SizedBox(width: 4),
|
||||
Text(numberFormat.format(count),
|
||||
style: TextStyle(
|
||||
color: PrimerColors.blue500, fontSize: 14))
|
||||
color: theme.palette.primary, fontSize: 14))
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -118,9 +121,9 @@ class CommentItem extends StatelessWidget {
|
||||
child: Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('+', style: TextStyle(color: PrimerColors.blue500)),
|
||||
Text('+', style: TextStyle(color: theme.palette.primary)),
|
||||
Icon(Octicons.smiley,
|
||||
color: PrimerColors.blue500, size: 18),
|
||||
color: theme.palette.primary, size: 18),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/screens/user.dart';
|
||||
import 'package:git_touch/widgets/avatar.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:timeago/timeago.dart' as timeago;
|
||||
import '../utils/utils.dart';
|
||||
import '../widgets/link.dart';
|
||||
@ -40,6 +41,8 @@ class IssueItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Link(
|
||||
screenBuilder: (context) {
|
||||
return IssueScreen(
|
||||
@ -75,12 +78,13 @@ class IssueItem extends StatelessWidget {
|
||||
TextSpan(text: payload['title'] + ' '),
|
||||
TextSpan(
|
||||
text: '#${payload['number']}',
|
||||
style: TextStyle(color: PrimerColors.gray500),
|
||||
style:
|
||||
TextStyle(color: theme.palette.tertiaryText),
|
||||
),
|
||||
]),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: PrimerColors.blue500,
|
||||
color: theme.palette.primary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -112,7 +116,7 @@ class IssueItem extends StatelessWidget {
|
||||
),
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 13, color: PrimerColors.gray700),
|
||||
fontSize: 13, color: theme.palette.secondaryText),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
@ -136,7 +140,8 @@ class IssueItem extends StatelessWidget {
|
||||
if (payload['comments']['totalCount'] > 0) ...[
|
||||
Expanded(child: SizedBox()),
|
||||
Icon(Octicons.comment,
|
||||
size: 13, color: PrimerColors.gray700),
|
||||
size: 13,
|
||||
color: theme.palette.secondaryText),
|
||||
SizedBox(width: 4),
|
||||
Text(numberFormat
|
||||
.format(payload['comments']['totalCount']))
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'dart:core';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'comment_item.dart';
|
||||
import 'user_name.dart';
|
||||
|
||||
class TimelineEventItem extends StatelessWidget {
|
||||
final String actor;
|
||||
@ -23,6 +24,8 @@ class TimelineEventItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
SizedBox(width: 6),
|
||||
@ -30,12 +33,15 @@ class TimelineEventItem extends StatelessWidget {
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(style: TextStyle(color: Colors.black), children: [
|
||||
// TODO: actor is null
|
||||
createUserSpan(context, actor),
|
||||
textSpan,
|
||||
// TextSpan(text: ' ' + TimeAgo.formatFromString(item['createdAt']))
|
||||
]),
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: theme.palette.text),
|
||||
children: [
|
||||
// TODO: actor is null
|
||||
createUserSpan(context, actor),
|
||||
textSpan,
|
||||
// TextSpan(text: ' ' + TimeAgo.formatFromString(item['createdAt']))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -240,7 +246,7 @@ class TimelineItem extends StatelessWidget {
|
||||
case 'PullRequestReview':
|
||||
return TimelineEventItem(
|
||||
actor: payload['author']['login'],
|
||||
iconColor: Color(0xff28a745),
|
||||
iconColor: PrimerColors.green500,
|
||||
iconData: Octicons.check,
|
||||
textSpan: _buildReviewText(context, payload),
|
||||
item: payload,
|
||||
@ -252,7 +258,7 @@ class TimelineItem extends StatelessWidget {
|
||||
return TimelineEventItem(
|
||||
actor: payload['actor']['login'],
|
||||
iconData: Octicons.git_merge,
|
||||
iconColor: Color(0xff6f42c1),
|
||||
iconColor: PrimerColors.purple500,
|
||||
textSpan: TextSpan(children: [
|
||||
TextSpan(text: ' merged commit '),
|
||||
TextSpan(text: payload['commit']['oid'].substring(0, 8)),
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/screens/user.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/avatar.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:git_touch/widgets/text_contains_organization.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
const userGqlChunk = '''
|
||||
login
|
||||
@ -37,6 +38,8 @@ class UserItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return Link(
|
||||
screenBuilder: inUserScreen ? null : (_) => UserScreen(login),
|
||||
child: Container(
|
||||
@ -56,7 +59,7 @@ class UserItem extends StatelessWidget {
|
||||
Text(
|
||||
name ?? login,
|
||||
style: TextStyle(
|
||||
color: PrimerColors.blue500,
|
||||
color: theme.palette.primary,
|
||||
fontSize: inUserScreen ? 18 : 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@ -65,7 +68,7 @@ class UserItem extends StatelessWidget {
|
||||
Text(
|
||||
login,
|
||||
style: TextStyle(
|
||||
color: PrimerColors.gray700,
|
||||
color: theme.palette.secondaryText,
|
||||
fontSize: inUserScreen ? 16 : 14),
|
||||
),
|
||||
],
|
||||
@ -75,7 +78,7 @@ class UserItem extends StatelessWidget {
|
||||
TextContainsOrganization(
|
||||
bio,
|
||||
style: TextStyle(
|
||||
color: PrimerColors.gray700,
|
||||
color: theme.palette.secondaryText,
|
||||
fontSize: inUserScreen ? 15 : 14),
|
||||
),
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user