style: import sort format

This commit is contained in:
Rongjian Zhang 2022-10-03 18:21:22 +08:00
parent e45b8fa134
commit df946c514a
26 changed files with 13 additions and 37 deletions

View File

@ -3,7 +3,8 @@ import 'package:json_annotation/json_annotation.dart';
part 'account.g.dart'; part 'account.g.dart';
@JsonSerializable(includeIfNull: false) @JsonSerializable(includeIfNull: false)
class Account { // For Bitbucket class Account {
// For Bitbucket
// equals(Account a) { // equals(Account a) {
// final uri = Uri.parse(domain); // final uri = Uri.parse(domain);

View File

@ -1,4 +1,5 @@
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'bitbucket.g.dart'; part 'bitbucket.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)

View File

@ -6,7 +6,6 @@ part 'github.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEvent { class GithubEvent {
GithubEvent(); GithubEvent();
factory GithubEvent.fromJson(Map<String, dynamic> json) => factory GithubEvent.fromJson(Map<String, dynamic> json) =>
@ -31,7 +30,6 @@ class GithubEvent {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEventUser { class GithubEventUser {
GithubEventUser(); GithubEventUser();
factory GithubEventUser.fromJson(Map<String, dynamic> json) => factory GithubEventUser.fromJson(Map<String, dynamic> json) =>
@ -42,7 +40,6 @@ class GithubEventUser {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEventRepo { class GithubEventRepo {
GithubEventRepo(); GithubEventRepo();
factory GithubEventRepo.fromJson(Map<String, dynamic> json) => factory GithubEventRepo.fromJson(Map<String, dynamic> json) =>
@ -80,7 +77,6 @@ class GithubEventPayload {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEventIssue { class GithubEventIssue {
GithubEventIssue(); GithubEventIssue();
factory GithubEventIssue.fromJson(Map<String, dynamic> json) => factory GithubEventIssue.fromJson(Map<String, dynamic> json) =>
@ -100,7 +96,6 @@ class GithubEventIssue {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEventComment { class GithubEventComment {
GithubEventComment(); GithubEventComment();
factory GithubEventComment.fromJson(Map<String, dynamic> json) => factory GithubEventComment.fromJson(Map<String, dynamic> json) =>
@ -113,7 +108,6 @@ class GithubEventComment {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEventCommit { class GithubEventCommit {
GithubEventCommit(); GithubEventCommit();
factory GithubEventCommit.fromJson(Map<String, dynamic> json) => factory GithubEventCommit.fromJson(Map<String, dynamic> json) =>
@ -124,7 +118,6 @@ class GithubEventCommit {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubEventRelease { class GithubEventRelease {
GithubEventRelease(); GithubEventRelease();
factory GithubEventRelease.fromJson(Map<String, dynamic> json) => factory GithubEventRelease.fromJson(Map<String, dynamic> json) =>
@ -136,7 +129,6 @@ class GithubEventRelease {
// Notification // Notification
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubNotificationItem { class GithubNotificationItem {
GithubNotificationItem(); GithubNotificationItem();
factory GithubNotificationItem.fromJson(Map<String, dynamic> json) => factory GithubNotificationItem.fromJson(Map<String, dynamic> json) =>
@ -155,7 +147,6 @@ class GithubNotificationItem {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubNotificationItemSubject { class GithubNotificationItemSubject {
GithubNotificationItemSubject(); GithubNotificationItemSubject();
factory GithubNotificationItemSubject.fromJson(Map<String, dynamic> json) => factory GithubNotificationItemSubject.fromJson(Map<String, dynamic> json) =>
@ -173,7 +164,6 @@ class GithubNotificationItemSubject {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubNotificationItemRepo { class GithubNotificationItemRepo {
GithubNotificationItemRepo(); GithubNotificationItemRepo();
factory GithubNotificationItemRepo.fromJson(Map<String, dynamic> json) => factory GithubNotificationItemRepo.fromJson(Map<String, dynamic> json) =>
@ -343,7 +333,6 @@ class GistFiles {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GithubGistsItem { class GithubGistsItem {
GithubGistsItem(); GithubGistsItem();
factory GithubGistsItem.fromJson(Map<String, dynamic> json) => factory GithubGistsItem.fromJson(Map<String, dynamic> json) =>
_$GithubGistsItemFromJson(json); _$GithubGistsItemFromJson(json);

View File

@ -1,11 +1,9 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:git_touch/models/github.dart'; import 'package:git_touch/models/github.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
import 'package:git_touch/utils/utils.dart';
class NotificationGroup { class NotificationGroup {
NotificationGroup(this.fullName); NotificationGroup(this.fullName);
String? fullName; String? fullName;
List<GithubNotificationItem> items = []; List<GithubNotificationItem> items = [];

View File

@ -3,7 +3,6 @@ import 'package:git_touch/models/theme.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class CommonScaffold extends StatelessWidget { class CommonScaffold extends StatelessWidget {
const CommonScaffold({ const CommonScaffold({
required this.title, required this.title,
required this.body, required this.body,

View File

@ -4,7 +4,6 @@ import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/scaffolds/utils.dart'; import 'package:git_touch/scaffolds/utils.dart';
class RefreshStatefulScaffold<T> extends StatefulWidget { class RefreshStatefulScaffold<T> extends StatefulWidget {
const RefreshStatefulScaffold({ const RefreshStatefulScaffold({
required this.title, required this.title,
required this.bodyBuilder, required this.bodyBuilder,

View File

@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart';
import 'package:git_touch/scaffolds/common.dart'; import 'package:git_touch/scaffolds/common.dart';
class SingleScaffold extends StatelessWidget { class SingleScaffold extends StatelessWidget {
const SingleScaffold({ const SingleScaffold({
required this.title, required this.title,
required this.body, required this.body,

View File

@ -3,7 +3,6 @@ import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/scaffolds/utils.dart'; import 'package:git_touch/scaffolds/utils.dart';
class TabScaffold extends StatelessWidget { class TabScaffold extends StatelessWidget {
const TabScaffold({ const TabScaffold({
required this.title, required this.title,
required this.body, required this.body,

View File

@ -4,7 +4,6 @@ import 'package:git_touch/scaffolds/tab.dart';
import 'package:git_touch/scaffolds/utils.dart'; import 'package:git_touch/scaffolds/utils.dart';
class TabStatefulScaffold<T> extends StatefulWidget { class TabStatefulScaffold<T> extends StatefulWidget {
const TabStatefulScaffold({ const TabStatefulScaffold({
required this.title, required this.title,
required this.bodyBuilder, required this.bodyBuilder,

View File

@ -3,7 +3,6 @@ import 'package:git_touch/widgets/error_reload.dart';
import 'package:git_touch/widgets/loading.dart'; import 'package:git_touch/widgets/loading.dart';
class RefreshWrapper extends StatelessWidget { class RefreshWrapper extends StatelessWidget {
const RefreshWrapper({ const RefreshWrapper({
required this.onRefresh, required this.onRefresh,
required this.body, required this.body,
@ -26,7 +25,6 @@ class RefreshWrapper extends StatelessWidget {
} }
class ErrorLoadingWrapper extends StatelessWidget { class ErrorLoadingWrapper extends StatelessWidget {
const ErrorLoadingWrapper({ const ErrorLoadingWrapper({
required this.error, required this.error,
required this.loading, required this.loading,

View File

@ -1,5 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; import 'dart:convert';
import 'package:antd_mobile/antd_mobile.dart';
import 'package:filesize/filesize.dart'; import 'package:filesize/filesize.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:flutter_gen/gen_l10n/S.dart';

View File

@ -1,6 +1,7 @@
import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/auth.dart';

View File

@ -7,7 +7,6 @@ import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class GeUsersScreen extends StatelessWidget { class GeUsersScreen extends StatelessWidget {
const GeUsersScreen.followers(String login) const GeUsersScreen.followers(String login)
: api = '/users/$login/followers', : api = '/users/$login/followers',
title = 'Followers'; title = 'Followers';

View File

@ -6,7 +6,6 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/blob_view.dart'; import 'package:git_touch/widgets/blob_view.dart';
class GistObjectScreen extends StatelessWidget { class GistObjectScreen extends StatelessWidget {
const GistObjectScreen(this.login, this.id, this.file, const GistObjectScreen(this.login, this.id, this.file,
{this.raw, this.content}); {this.raw, this.content});
final String login; final String login;

View File

@ -10,7 +10,6 @@ import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
class GlIssueScreen extends StatelessWidget { class GlIssueScreen extends StatelessWidget {
const GlIssueScreen(this.projectId, this.iid, {this.isMr = false}); const GlIssueScreen(this.projectId, this.iid, {this.isMr = false});
final int projectId; final int projectId;
final int iid; final int iid;

View File

@ -1,5 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; import 'dart:convert';
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/models/auth.dart'; import 'package:git_touch/models/auth.dart';

View File

@ -7,7 +7,6 @@ import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class GoUsersScreen extends StatelessWidget { class GoUsersScreen extends StatelessWidget {
const GoUsersScreen.followers(String login) const GoUsersScreen.followers(String login)
: api = '/users/$login/followers', : api = '/users/$login/followers',
title = 'Followers'; title = 'Followers';

View File

@ -1,5 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';import 'dart:convert'; import 'dart:convert';
import 'package:antd_mobile/antd_mobile.dart';
import 'package:filesize/filesize.dart'; import 'package:filesize/filesize.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart'; import 'package:flutter_gen/gen_l10n/S.dart';

View File

@ -8,7 +8,6 @@ import 'package:provider/provider.dart';
import 'package:timeago/timeago.dart' as timeago; import 'package:timeago/timeago.dart' as timeago;
class GtUsersScreen extends StatelessWidget { class GtUsersScreen extends StatelessWidget {
const GtUsersScreen.followers(String login) const GtUsersScreen.followers(String login)
: api = '/users/$login/followers', : api = '/users/$login/followers',
title = 'Followers'; title = 'Followers';

View File

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:path/path.dart' as p; import 'package:path/path.dart' as p;
extension MyString<T extends String> on String { extension MyString<T extends String> on String {

View File

@ -1,7 +1,6 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class AppBarTitle extends StatelessWidget { class AppBarTitle extends StatelessWidget {
const AppBarTitle(this.text); const AppBarTitle(this.text);
final String? text; final String? text;

View File

@ -30,7 +30,6 @@ class ContributionDay {
} }
class ContributionWidget extends StatelessWidget { class ContributionWidget extends StatelessWidget {
ContributionWidget({required this.weeks}) { ContributionWidget({required this.weeks}) {
int? maxCount; int? maxCount;
for (final week in weeks!) { for (final week in weeks!) {

View File

@ -2,7 +2,6 @@ import 'package:flutter/widgets.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
class ErrorReload extends StatelessWidget { class ErrorReload extends StatelessWidget {
const ErrorReload({required this.text, required this.onTap}); const ErrorReload({required this.text, required this.onTap});
final String text; final String text;
final Function onTap; final Function onTap;

View File

@ -10,7 +10,6 @@ enum IssueIconState {
} }
class IssueIcon extends StatelessWidget { class IssueIcon extends StatelessWidget {
const IssueIcon(this.state, {this.size}); const IssueIcon(this.state, {this.size});
final IssueIconState state; final IssueIconState state;
final double? size; final double? size;

View File

@ -1,7 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class Loading extends StatelessWidget { class Loading extends StatelessWidget {
const Loading({this.more = false}); const Loading({this.more = false});
final bool more; final bool more;

View File

@ -2,7 +2,6 @@ import 'package:flutter/widgets.dart';
import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/utils/utils.dart';
class TextWithAt extends StatelessWidget { class TextWithAt extends StatelessWidget {
const TextWithAt({ const TextWithAt({
required this.text, required this.text,
required this.linkFactory, required this.linkFactory,