improvement: style tweaks

This commit is contained in:
Rongjian Zhang 2020-01-12 16:18:37 +08:00
parent 16bd98c099
commit abd9cd6c44
2 changed files with 22 additions and 12 deletions

View File

@ -1,12 +1,14 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:git_touch/models/github.dart';
import 'package:git_touch/models/theme.dart';
import 'package:git_touch/scaffolds/tab_stateful.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:http/http.dart' as http;
import 'package:git_touch/widgets/repository_item.dart';
import 'package:provider/provider.dart';
class TrendingScreen extends StatelessWidget {
Widget build(BuildContext context) {
@ -20,6 +22,7 @@ class TrendingScreen extends StatelessWidget {
return json.decode(res.body) as List;
},
bodyBuilder: (payload, activeTab) {
final theme = Provider.of<ThemeModel>(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: join(
@ -47,7 +50,11 @@ class TrendingScreen extends StatelessWidget {
avatarUrl: item.avatar,
bio: Row(
children: <Widget>[
Icon(Octicons.repo, size: 17),
Icon(
Octicons.repo,
size: 17,
color: theme.palette.secondaryText,
),
SizedBox(width: 2),
Text(item.repo.name, style: TextStyle(fontSize: 17))
],

View File

@ -28,7 +28,6 @@ class UserItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
return Link(
url: '/$login',
child: Container(
@ -44,19 +43,23 @@ class UserItem extends StatelessWidget {
children: <Widget>[
Row(
children: <Widget>[
Text(
name ?? login,
style: TextStyle(
color: theme.palette.primary,
fontSize: 17,
fontWeight: FontWeight.w500,
if (name != null) ...[
Text(
name,
style: TextStyle(
color: theme.palette.primary,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
SizedBox(width: 4),
SizedBox(width: 8),
],
Text(
'($login)',
login,
style: TextStyle(
color: theme.palette.secondaryText, fontSize: 16),
color: theme.palette.secondaryText,
fontSize: 16,
),
),
],
),