fix: entry item style
This commit is contained in:
parent
4c2a7177eb
commit
633b58d36f
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
|
|
|
@ -103,7 +103,6 @@ class _User extends StatelessWidget {
|
|||
]
|
||||
],
|
||||
),
|
||||
CommonStyle.border,
|
||||
AntList(
|
||||
children: [
|
||||
if (p.company != null)
|
||||
|
|
|
@ -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:
|
||||
),
|
||||
],
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
],
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue