mirror of
https://github.com/git-touch/git-touch
synced 2025-02-26 16:27:50 +01:00
refactor: common styles
This commit is contained in:
parent
141b80adaa
commit
e6a6b026f6
@ -27,7 +27,7 @@ class CodeModel with ChangeNotifier {
|
|||||||
int get fontSize => _fontSize;
|
int get fontSize => _fontSize;
|
||||||
String get fontFamily => _fontFamily;
|
String get fontFamily => _fontFamily;
|
||||||
String get fontFamilyUsed =>
|
String get fontFamilyUsed =>
|
||||||
_fontFamily == 'System' ? monospaceFont : _fontFamily;
|
_fontFamily == 'System' ? CommonStyle.monospace : _fontFamily;
|
||||||
|
|
||||||
init() async {
|
init() async {
|
||||||
var prefs = await SharedPreferences.getInstance();
|
var prefs = await SharedPreferences.getInstance();
|
||||||
|
@ -142,7 +142,7 @@ class _ListStatefulScaffoldState<T, K>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (index % 2 == 1) {
|
if (index % 2 == 1) {
|
||||||
return borderView;
|
return CommonStyle.border;
|
||||||
}
|
}
|
||||||
|
|
||||||
return widget.itemBuilder(items[index ~/ 2]);
|
return widget.itemBuilder(items[index ~/ 2]);
|
||||||
|
@ -103,7 +103,7 @@ class _LongListScaffoldState<T, K> extends State<LongListScaffold<T, K>> {
|
|||||||
|
|
||||||
Widget _buildItem(BuildContext context, int index) {
|
Widget _buildItem(BuildContext context, int index) {
|
||||||
if (index % 2 == 1) {
|
if (index % 2 == 1) {
|
||||||
return borderView;
|
return CommonStyle.border;
|
||||||
}
|
}
|
||||||
|
|
||||||
int realIndex = index ~/ 2;
|
int realIndex = index ~/ 2;
|
||||||
@ -115,7 +115,7 @@ class _LongListScaffoldState<T, K> extends State<LongListScaffold<T, K>> {
|
|||||||
payload.leadingItems.length +
|
payload.leadingItems.length +
|
||||||
payload.trailingItems.length;
|
payload.trailingItems.length;
|
||||||
return Container(
|
return Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: ExactAssetImage('images/progressive-disclosure-line.png',
|
image: ExactAssetImage('images/progressive-disclosure-line.png',
|
||||||
@ -127,7 +127,7 @@ class _LongListScaffoldState<T, K> extends State<LongListScaffold<T, K>> {
|
|||||||
child: Link(
|
child: Link(
|
||||||
onTap: _loadMore,
|
onTap: _loadMore,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.black12),
|
border: Border.all(color: Colors.black12),
|
||||||
),
|
),
|
||||||
|
@ -4,12 +4,14 @@ import 'package:git_touch/scaffolds/common.dart';
|
|||||||
class SingleScaffold extends StatelessWidget {
|
class SingleScaffold extends StatelessWidget {
|
||||||
final Widget title;
|
final Widget title;
|
||||||
final Widget body;
|
final Widget body;
|
||||||
final Widget trailing;
|
final Widget action;
|
||||||
|
final Color backgroundColor;
|
||||||
|
|
||||||
SingleScaffold({
|
SingleScaffold({
|
||||||
@required this.title,
|
@required this.title,
|
||||||
@required this.body,
|
@required this.body,
|
||||||
this.trailing,
|
this.action,
|
||||||
|
this.backgroundColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -17,7 +19,8 @@ class SingleScaffold extends StatelessWidget {
|
|||||||
return CommonScaffold(
|
return CommonScaffold(
|
||||||
title: title,
|
title: title,
|
||||||
body: Scrollbar(child: SingleChildScrollView(child: body)),
|
body: Scrollbar(child: SingleChildScrollView(child: body)),
|
||||||
action: trailing,
|
action: action,
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ class CodeThemeScreen extends StatelessWidget {
|
|||||||
fontSize: codeProvider.fontSize.toDouble(),
|
fontSize: codeProvider.fontSize.toDouble(),
|
||||||
fontFamily: codeProvider.fontFamilyUsed,
|
fontFamily: codeProvider.fontFamilyUsed,
|
||||||
),
|
),
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -90,7 +90,7 @@ class CommitsScreen extends StatelessWidget {
|
|||||||
return Link(
|
return Link(
|
||||||
url: payload['url'],
|
url: payload['url'],
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -44,7 +44,7 @@ class CreditsScreen extends StatelessWidget {
|
|||||||
title: Text('Credits'),
|
title: Text('Credits'),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(
|
TableView(
|
||||||
headerText: 'packages',
|
headerText: 'packages',
|
||||||
items: projects.map((t) {
|
items: projects.map((t) {
|
||||||
@ -54,7 +54,7 @@ class CreditsScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(
|
TableView(
|
||||||
headerText: 'fonts',
|
headerText: 'fonts',
|
||||||
items: fonts.map((font) {
|
items: fonts.map((font) {
|
||||||
|
@ -355,7 +355,7 @@ mutation {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -383,7 +383,7 @@ mutation {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
settings.setActiveAccountIndex(index);
|
settings.setActiveAccountIndex(index);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(bottom: BorderSide(color: Colors.black12)),
|
border: Border(bottom: BorderSide(color: Colors.black12)),
|
||||||
),
|
),
|
||||||
|
@ -116,7 +116,7 @@ class ObjectScreen extends StatelessWidget {
|
|||||||
case 'md':
|
case 'md':
|
||||||
case 'markdown':
|
case 'markdown':
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: MarkdownView(payload['text']),
|
child: MarkdownView(payload['text']),
|
||||||
);
|
);
|
||||||
case 'png':
|
case 'png':
|
||||||
@ -133,7 +133,7 @@ class ObjectScreen extends StatelessWidget {
|
|||||||
payload['text'],
|
payload['text'],
|
||||||
language: _language,
|
language: _language,
|
||||||
theme: themeMap[codeProvider.theme],
|
theme: themeMap[codeProvider.theme],
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
textStyle: TextStyle(
|
textStyle: TextStyle(
|
||||||
fontSize: codeProvider.fontSize.toDouble(),
|
fontSize: codeProvider.fontSize.toDouble(),
|
||||||
fontFamily: codeProvider.fontFamilyUsed),
|
fontFamily: codeProvider.fontFamilyUsed),
|
||||||
|
@ -39,10 +39,10 @@ class OrganizationScreen extends StatelessWidget {
|
|||||||
if (items.isEmpty) return [];
|
if (items.isEmpty) return [];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
if (title != null) TableViewHeader(title),
|
if (title != null) TableViewHeader(title),
|
||||||
...join(
|
...join(
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
items.map((item) {
|
items.map((item) {
|
||||||
return RepositoryItem(item);
|
return RepositoryItem(item);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
@ -112,7 +112,7 @@ class OrganizationScreen extends StatelessWidget {
|
|||||||
avatarUrl: data['avatarUrl'],
|
avatarUrl: data['avatarUrl'],
|
||||||
bio: data['description'],
|
bio: data['description'],
|
||||||
),
|
),
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
Row(children: <Widget>[
|
Row(children: <Widget>[
|
||||||
EntryItem(
|
EntryItem(
|
||||||
count: data['pinnableItems']['totalCount'],
|
count: data['pinnableItems']['totalCount'],
|
||||||
@ -126,7 +126,7 @@ class OrganizationScreen extends StatelessWidget {
|
|||||||
screenBuilder: (context) => UsersScreen.members(login),
|
screenBuilder: (context) => UsersScreen.members(login),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(
|
TableView(
|
||||||
hasIcon: true,
|
hasIcon: true,
|
||||||
items: [
|
items: [
|
||||||
|
@ -211,8 +211,8 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
var readme = payload.data[1] as String;
|
var readme = payload.data[1] as String;
|
||||||
|
|
||||||
final langWidth = MediaQuery.of(context).size.width -
|
final langWidth = MediaQuery.of(context).size.width -
|
||||||
commonItemPadding.left -
|
CommonStyle.padding.left -
|
||||||
commonItemPadding.right -
|
CommonStyle.padding.right -
|
||||||
(data['languages']['edges'] as List).length +
|
(data['languages']['edges'] as List).length +
|
||||||
1;
|
1;
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
RepositoryItem(data, inRepoScreen: true),
|
RepositoryItem(data, inRepoScreen: true),
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
EntryItem(
|
EntryItem(
|
||||||
@ -241,11 +241,11 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
if ((data['languages']['edges'] as List).isNotEmpty)
|
if ((data['languages']['edges'] as List).isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
padding: commonItemPadding.copyWith(top: 8, bottom: 8),
|
padding: CommonStyle.padding.copyWith(top: 8, bottom: 8),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@ -304,7 +304,7 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(
|
TableView(
|
||||||
hasIcon: true,
|
hasIcon: true,
|
||||||
items: [
|
items: [
|
||||||
@ -366,14 +366,14 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
if (readme != null)
|
if (readme != null)
|
||||||
Container(
|
Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: MarkdownView(readme),
|
child: MarkdownView(readme),
|
||||||
),
|
),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -6,6 +6,7 @@ import 'package:git_touch/screens/credits.dart';
|
|||||||
import 'package:git_touch/screens/repository.dart';
|
import 'package:git_touch/screens/repository.dart';
|
||||||
import 'package:git_touch/utils/utils.dart';
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||||
|
import 'package:primer/primer.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:launch_review/launch_review.dart';
|
import 'package:launch_review/launch_review.dart';
|
||||||
import '../widgets/table_view.dart';
|
import '../widgets/table_view.dart';
|
||||||
@ -23,16 +24,17 @@ class SettingsScreen extends StatelessWidget {
|
|||||||
|
|
||||||
return SingleScaffold(
|
return SingleScaffold(
|
||||||
title: AppBarTitle('Settings'),
|
title: AppBarTitle('Settings'),
|
||||||
|
backgroundColor: PrimerColors.gray000,
|
||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(headerText: 'ACCOUNTS', items: [
|
TableView(headerText: 'ACCOUNTS', items: [
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
text: Text('Switch to another account'),
|
text: Text('Switch to another account'),
|
||||||
screenBuilder: (_) => LoginScreen(),
|
screenBuilder: (_) => LoginScreen(),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(headerText: 'THEME', items: [
|
TableView(headerText: 'THEME', items: [
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
text: Text('Material'),
|
text: Text('Material'),
|
||||||
@ -57,7 +59,7 @@ class SettingsScreen extends StatelessWidget {
|
|||||||
hideRightChevron: true,
|
hideRightChevron: true,
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(headerText: 'ABOUT', items: [
|
TableView(headerText: 'ABOUT', items: [
|
||||||
TableViewItem(
|
TableViewItem(
|
||||||
text: Text('Source Code'),
|
text: Text('Source Code'),
|
||||||
|
@ -23,7 +23,7 @@ class TrendingScreen extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: join(
|
children: join(
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
payload.map<Widget>((item) {
|
payload.map<Widget>((item) {
|
||||||
switch (activeTab) {
|
switch (activeTab) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -87,7 +87,7 @@ class _TrendingScreenState extends State<TrendingScreen> {
|
|||||||
onRefresh: _refresh,
|
onRefresh: _refresh,
|
||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: join(borderView, _buildItems()).toList(),
|
children: join(CommonStyle.border, _buildItems()).toList(),
|
||||||
),
|
),
|
||||||
activeTab: _activeTab,
|
activeTab: _activeTab,
|
||||||
onTabSwitch: (int index) {
|
onTabSwitch: (int index) {
|
||||||
|
@ -86,10 +86,10 @@ class UserScreen extends StatelessWidget {
|
|||||||
if (items.isEmpty) return [];
|
if (items.isEmpty) return [];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
if (title != null) TableViewHeader(title),
|
if (title != null) TableViewHeader(title),
|
||||||
...join(
|
...join(
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
items.map((item) {
|
items.map((item) {
|
||||||
return RepositoryItem(item);
|
return RepositoryItem(item);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
@ -127,7 +127,7 @@ class UserScreen extends StatelessWidget {
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
reverse: true,
|
reverse: true,
|
||||||
@ -191,7 +191,7 @@ class UserScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
UserItem.fromData(data, inUserScreen: true),
|
UserItem.fromData(data, inUserScreen: true),
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
Row(children: <Widget>[
|
Row(children: <Widget>[
|
||||||
EntryItem(
|
EntryItem(
|
||||||
count: data['repositories']['totalCount'],
|
count: data['repositories']['totalCount'],
|
||||||
@ -214,9 +214,9 @@ class UserScreen extends StatelessWidget {
|
|||||||
screenBuilder: (context) => UsersScreen.following(login),
|
screenBuilder: (context) => UsersScreen.following(login),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
_buildContributions(contributions),
|
_buildContributions(contributions),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
TableView(
|
TableView(
|
||||||
hasIcon: true,
|
hasIcon: true,
|
||||||
items: [
|
items: [
|
||||||
@ -261,7 +261,7 @@ class UserScreen extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
..._buildRepos(data),
|
..._buildRepos(data),
|
||||||
verticalGap,
|
CommonStyle.verticalGap,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -12,8 +12,6 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
export 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
export 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||||
|
|
||||||
final monospaceFont = Platform.isIOS ? 'Menlo' : 'monospace'; // FIXME:
|
|
||||||
|
|
||||||
class StorageKeys {
|
class StorageKeys {
|
||||||
static const accounts = 'accounts';
|
static const accounts = 'accounts';
|
||||||
static const account = 'account';
|
static const account = 'account';
|
||||||
@ -22,6 +20,13 @@ class StorageKeys {
|
|||||||
static const newsFilter = 'news.filter';
|
static const newsFilter = 'news.filter';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CommonStyle {
|
||||||
|
static const padding = EdgeInsets.all(12);
|
||||||
|
static const border = BorderView();
|
||||||
|
static const verticalGap = SizedBox(height: 18);
|
||||||
|
static final monospace = Platform.isIOS ? 'Menlo' : 'monospace'; // FIXME:
|
||||||
|
}
|
||||||
|
|
||||||
Color convertColor(String cssHex) {
|
Color convertColor(String cssHex) {
|
||||||
if (cssHex == null) {
|
if (cssHex == null) {
|
||||||
return Color(0xffcccccc); // Default color
|
return Color(0xffcccccc); // Default color
|
||||||
@ -124,9 +129,6 @@ bool isNotNullOrEmpty(String text) {
|
|||||||
return text != null && text.isNotEmpty;
|
return text != null && text.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
const borderView = BorderView();
|
|
||||||
const verticalGap = SizedBox(height: 18);
|
|
||||||
|
|
||||||
String getBranchQueryKey(String branch, {bool withParams = false}) {
|
String getBranchQueryKey(String branch, {bool withParams = false}) {
|
||||||
if (branch == null) return 'defaultBranchRef';
|
if (branch == null) return 'defaultBranchRef';
|
||||||
return 'ref' + (withParams ? '(qualifiedName: "$branch")' : '');
|
return 'ref' + (withParams ? '(qualifiedName: "$branch")' : '');
|
||||||
@ -155,7 +157,7 @@ class PrimerBranchName extends StatelessWidget {
|
|||||||
color: PrimerColors.blue500,
|
color: PrimerColors.blue500,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
height: 1,
|
height: 1,
|
||||||
fontFamily: monospaceFont,
|
fontFamily: CommonStyle.monospace,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -171,5 +173,3 @@ launchUrl(String url) async {
|
|||||||
// TODO: fallback
|
// TODO: fallback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const commonItemPadding = EdgeInsets.all(12);
|
|
||||||
|
@ -72,7 +72,7 @@ class EventItem extends StatelessWidget {
|
|||||||
screenBuilder: screenBuilder,
|
screenBuilder: screenBuilder,
|
||||||
url: url,
|
url: url,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -309,7 +309,7 @@ class EventItem extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: PrimerColors.blue500,
|
color: PrimerColors.blue500,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
fontFamily: monospaceFont,
|
fontFamily: CommonStyle.monospace,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 6),
|
SizedBox(width: 6),
|
||||||
|
@ -49,7 +49,7 @@ class IssueItem extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
// color: payload.unread ? Colors.white : Colors.black12,
|
// color: payload.unread ? Colors.white : Colors.black12,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -78,7 +78,7 @@ class MarkdownView extends StatelessWidget {
|
|||||||
code: _basicStyle.copyWith(
|
code: _basicStyle.copyWith(
|
||||||
fontSize: 16 * 0.85,
|
fontSize: 16 * 0.85,
|
||||||
height: 1.45,
|
height: 1.45,
|
||||||
fontFamily: monospaceFont,
|
fontFamily: CommonStyle.monospace,
|
||||||
),
|
),
|
||||||
h1: _hStyle.copyWith(fontSize: 32),
|
h1: _hStyle.copyWith(fontSize: 32),
|
||||||
h2: _hStyle.copyWith(fontSize: 24),
|
h2: _hStyle.copyWith(fontSize: 24),
|
||||||
|
@ -126,7 +126,7 @@ class RepositoryItem extends StatelessWidget {
|
|||||||
? null
|
? null
|
||||||
: (_) => RepositoryScreen(payload['owner']['login'], payload['name']),
|
: (_) => RepositoryScreen(payload['owner']['login'], payload['name']),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -13,7 +13,6 @@ class TableViewHeader extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: PrimerColors.gray100,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
child: Text(
|
child: Text(
|
||||||
title.toUpperCase(),
|
title.toUpperCase(),
|
||||||
@ -117,10 +116,10 @@ class TableView extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (headerText != null) TableViewHeader(headerText),
|
if (headerText != null) TableViewHeader(headerText),
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
...join(BorderView(leftPadding: _leftPadding),
|
...join(BorderView(leftPadding: _leftPadding),
|
||||||
items.map(_buildItem).toList()),
|
items.map(_buildItem).toList()),
|
||||||
borderView,
|
CommonStyle.border,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ class TimelineItem extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: _buildByType(context),
|
child: _buildByType(context),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class UserItem extends StatelessWidget {
|
|||||||
: (_) =>
|
: (_) =>
|
||||||
isOrganization ? OrganizationScreen(login) : UserScreen(login),
|
isOrganization ? OrganizationScreen(login) : UserScreen(login),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: commonItemPadding,
|
padding: CommonStyle.padding,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user