mirror of
https://github.com/git-touch/git-touch
synced 2025-03-23 06:30:17 +01:00
refactor: common padding
This commit is contained in:
parent
ae5660061c
commit
a9d5cfef55
@ -115,7 +115,7 @@ class _LongListScaffoldState<T, K> extends State<LongListScaffold<T, K>> {
|
||||
payload.leadingItems.length +
|
||||
payload.trailingItems.length;
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: commonItemPadding,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: ExactAssetImage('images/progressive-disclosure-line.png',
|
||||
@ -127,7 +127,7 @@ class _LongListScaffoldState<T, K> extends State<LongListScaffold<T, K>> {
|
||||
child: Link(
|
||||
onTap: _loadMore,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black12),
|
||||
),
|
||||
|
@ -5,6 +5,7 @@ import 'package:flutter_highlight/theme_map.dart';
|
||||
import 'package:git_touch/models/code.dart';
|
||||
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:git_touch/widgets/table_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@ -95,7 +96,7 @@ class CodeThemeScreen extends StatelessWidget {
|
||||
fontSize: codeProvider.fontSize.toDouble(),
|
||||
fontFamily: codeProvider.fontFamilyUsed,
|
||||
),
|
||||
padding: const EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -90,7 +90,7 @@ class CommitsScreen extends StatelessWidget {
|
||||
return Link(
|
||||
url: payload['url'],
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: commonItemPadding,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
@ -355,7 +355,7 @@ mutation {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/auth.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:provider/provider.dart';
|
||||
import '../widgets/link.dart';
|
||||
@ -24,7 +25,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
settings.setActiveAccountIndex(index);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: Colors.black12)),
|
||||
),
|
||||
|
@ -116,7 +116,7 @@ class ObjectScreen extends StatelessWidget {
|
||||
case 'md':
|
||||
case 'markdown':
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: commonItemPadding,
|
||||
child: MarkdownView(payload['text']),
|
||||
);
|
||||
case 'png':
|
||||
@ -133,7 +133,7 @@ class ObjectScreen extends StatelessWidget {
|
||||
payload['text'],
|
||||
language: _language,
|
||||
theme: themeMap[codeProvider.theme],
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
textStyle: TextStyle(
|
||||
fontSize: codeProvider.fontSize.toDouble(),
|
||||
fontFamily: codeProvider.fontFamilyUsed),
|
||||
|
@ -26,8 +26,6 @@ class RepositoryScreen extends StatelessWidget {
|
||||
final String name;
|
||||
final String branch;
|
||||
|
||||
static const _languageBarPadding = 10.0;
|
||||
|
||||
RepositoryScreen(this.owner, this.name, {this.branch});
|
||||
RepositoryScreen.fromFullName(String fullName, {this.branch})
|
||||
: owner = fullName.split('/')[0],
|
||||
@ -213,7 +211,8 @@ class RepositoryScreen extends StatelessWidget {
|
||||
var readme = payload.data[1] as String;
|
||||
|
||||
final langWidth = MediaQuery.of(context).size.width -
|
||||
_languageBarPadding * 2 -
|
||||
commonItemPadding.left -
|
||||
commonItemPadding.right -
|
||||
(data['languages']['edges'] as List).length +
|
||||
1;
|
||||
|
||||
@ -246,7 +245,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
if ((data['languages']['edges'] as List).isNotEmpty)
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.all(_languageBarPadding),
|
||||
padding: commonItemPadding.copyWith(top: 8, bottom: 8),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
child: SizedBox(
|
||||
@ -370,7 +369,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
verticalGap,
|
||||
if (readme != null)
|
||||
Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: commonItemPadding,
|
||||
color: Colors.white,
|
||||
child: MarkdownView(readme),
|
||||
),
|
||||
|
@ -127,7 +127,7 @@ class UserScreen extends StatelessWidget {
|
||||
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
reverse: true,
|
||||
|
@ -125,7 +125,7 @@ bool isNotNullOrEmpty(String text) {
|
||||
}
|
||||
|
||||
const borderView = BorderView();
|
||||
const verticalGap = SizedBox(height: 20);
|
||||
const verticalGap = SizedBox(height: 18);
|
||||
|
||||
String getBranchQueryKey(String branch, {bool withParams = false}) {
|
||||
if (branch == null) return 'defaultBranchRef';
|
||||
@ -171,3 +171,5 @@ launchUrl(String url) async {
|
||||
// TODO: fallback
|
||||
}
|
||||
}
|
||||
|
||||
const commonItemPadding = EdgeInsets.all(12);
|
||||
|
@ -72,7 +72,7 @@ class EventItem extends StatelessWidget {
|
||||
screenBuilder: screenBuilder,
|
||||
url: url,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: commonItemPadding,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
@ -49,7 +49,7 @@ class IssueItem extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: commonItemPadding,
|
||||
// color: payload.unread ? Colors.white : Colors.black12,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -126,7 +126,7 @@ class RepositoryItem extends StatelessWidget {
|
||||
? null
|
||||
: (_) => RepositoryScreen(payload['owner']['login'], payload['name']),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
@ -302,7 +302,7 @@ class TimelineItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: commonItemPadding,
|
||||
child: _buildByType(context),
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/screens/organization.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';
|
||||
@ -46,7 +47,7 @@ class UserItem extends StatelessWidget {
|
||||
: (_) =>
|
||||
isOrganization ? OrganizationScreen(login) : UserScreen(login),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: commonItemPadding,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
Loading…
x
Reference in New Issue
Block a user