fix: entry item style

This commit is contained in:
Rongjian Zhang 2022-10-04 20:18:04 +08:00
parent 4c2a7177eb
commit 633b58d36f
11 changed files with 34 additions and 28 deletions

View File

@ -62,9 +62,7 @@ class MyApp extends StatelessWidget {
theme: CupertinoThemeData(
brightness: theme.brightness,
primaryColor: antTheme.colorPrimary,
scaffoldBackgroundColor: theme.brightness == Brightness.dark
? const Color(0x00ff2629)
: const Color(0xfffafbfc),
scaffoldBackgroundColor: antTheme.colorBox,
textTheme: CupertinoTextThemeData(
textStyle: TextStyle(
fontSize: antTheme.fontSizeMain,

View File

@ -116,17 +116,17 @@ class GeRepoScreen extends StatelessWidget {
Row(
children: <Widget>[
EntryItem(
count: p.watchersCount,
count: p.watchersCount!,
text: 'Watchers',
url: '/gitee/$owner/$name/watchers',
),
EntryItem(
count: p.stargazersCount,
count: p.stargazersCount!,
text: 'Stars',
url: '/gitee/$owner/$name/stargazers',
),
EntryItem(
count: p.forksCount,
count: p.forksCount!,
text: 'Forks',
url: '/gitee/$owner/$name/forks',
),

View File

@ -65,22 +65,22 @@ class GeUserScreen extends StatelessWidget {
CommonStyle.border,
Row(children: [
EntryItem(
count: user.publicRepos,
count: user.publicRepos!,
text: 'Repositories',
url: '/gitee/$login?tab=repositories',
),
EntryItem(
count: user.stared,
count: user.stared!,
text: 'Stars',
url: '/gitee/$login?tab=stars',
),
EntryItem(
count: user.followers,
count: user.followers!,
text: 'Followers',
url: '/gitee/$login?tab=followers',
),
EntryItem(
count: user.following,
count: user.following!,
text: 'Following',
url: '/gitee/$login?tab=following',
),

View File

@ -103,7 +103,6 @@ class _User extends StatelessWidget {
]
],
),
CommonStyle.border,
AntList(
children: [
if (p.company != null)

View File

@ -121,19 +121,19 @@ class GlProjectScreen extends StatelessWidget {
future: memberCountFuture,
builder: (context, snapshot) {
return EntryItem(
count: snapshot.data,
count: snapshot.data!,
text: AppLocalizations.of(context)!.members,
url: '/gitlab/projects/$id/members',
);
},
),
EntryItem(
count: p.starCount,
count: p.starCount!,
text: AppLocalizations.of(context)!.stars,
url: '/gitlab/projects/$id/starrers',
),
EntryItem(
count: p.forksCount,
count: p.forksCount!,
text: AppLocalizations.of(context)!.forks, // TODO:
),
],

View File

@ -76,15 +76,15 @@ class GoRepoScreen extends StatelessWidget {
children: <Widget>[
// TODO: when API is available
EntryItem(
count: p.watchersCount,
count: p.watchersCount!,
text: 'Watchers',
),
EntryItem(
count: p.starsCount,
count: p.starsCount!,
text: 'Stars',
),
EntryItem(
count: p.forksCount,
count: p.forksCount!,
text: 'Forks',
),
],

View File

@ -65,16 +65,17 @@ class GtRepoScreen extends StatelessWidget {
Row(
children: <Widget>[
EntryItem(
count: 0, // TODO:
text: 'Watchers',
url: '/gitea/$owner/$name/watchers',
),
EntryItem(
count: p.starsCount,
count: p.starsCount!,
text: 'Stars',
url: '/gitea/$owner/$name/stargazers',
),
EntryItem(
count: p.forksCount,
count: p.forksCount!,
text: 'Forks',
url: '/gitea/$owner/$name/forks',
),

View File

@ -111,7 +111,7 @@ class GtUserScreen extends StatelessWidget {
CommonStyle.border,
Row(children: [
EntryItem(
count: p.userRepoCount,
count: p.userRepoCount!,
text: 'Repositories',
url: '/gitea/$login?tab=repositories',
),

View File

@ -39,6 +39,7 @@ class StorageKeys {
}
class CommonStyle {
CommonStyle._();
static const padding = EdgeInsets.all(12);
static const border = BorderView();
static const verticalGap = SizedBox(height: 18);

View File

@ -17,7 +17,7 @@ class BorderView extends StatelessWidget {
margin: EdgeInsets.only(left: leftPadding),
decoration: BoxDecoration(
border: Border(
top: BorderSide(color: AntTheme.of(context).colorBorder, width: 0),
top: BorderSide(color: AntTheme.of(context).colorBorder, width: 1),
),
),
);

View File

@ -1,7 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/cupertino.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/link.dart';
class EntryItem extends StatelessWidget {
const EntryItem({
@ -15,11 +14,19 @@ class EntryItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = AntTheme.of(context);
return Expanded(
child: LinkWidget(
url: url,
child: Container(
padding: const EdgeInsets.symmetric(vertical: 14),
child: Container(
color: theme.colorBackground,
child: AntButton(
block: true,
size: AntButtonSize.large,
fill: AntButtonFill.none,
color: theme.colorPrimary,
onClick: () {
if (url != null) context.pushUrl(url!);
},
child: Column(
children: <Widget>[
Text(
@ -27,14 +34,14 @@ class EntryItem extends StatelessWidget {
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: AntTheme.of(context).colorText,
color: theme.colorText,
),
),
Text(
text,
style: TextStyle(
fontSize: 14,
color: AntTheme.of(context).colorTextSecondary,
color: theme.colorTextSecondary,
fontWeight: FontWeight.w500,
),
)