style: fix apply
This commit is contained in:
parent
9b914ff1f1
commit
d8f38d34aa
|
@ -26,6 +26,10 @@ linter:
|
|||
always_use_package_imports: true
|
||||
sort_constructors_first: true
|
||||
sort_unnamed_constructors_first: true
|
||||
avoid_types_on_closure_parameters: true
|
||||
omit_local_variable_types: true
|
||||
prefer_final_in_for_each: true
|
||||
prefer_final_locals: true
|
||||
|
||||
analyzer:
|
||||
exclude:
|
||||
|
|
|
@ -143,7 +143,7 @@ class _HomeState extends State<Home> {
|
|||
|
||||
Widget _buildNotificationIcon(BuildContext context, IconData iconData) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
int count = Provider.of<NotificationModel>(context).count;
|
||||
final count = Provider.of<NotificationModel>(context).count;
|
||||
if (count == 0) {
|
||||
return Icon(iconData);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ void main() async {
|
|||
ChangeNotifierProvider(create: (context) => authModel),
|
||||
ChangeNotifierProvider(create: (context) => codeModel),
|
||||
],
|
||||
child: MyApp(),
|
||||
child: const MyApp(),
|
||||
));
|
||||
},
|
||||
);
|
||||
|
|
|
@ -238,7 +238,7 @@ class AuthModel with ChangeNotifier {
|
|||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
late http.Response res;
|
||||
Map<String, String> headers = {
|
||||
final headers = <String, String>{
|
||||
'Authorization': 'token $token',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
};
|
||||
|
@ -342,7 +342,7 @@ class AuthModel with ChangeNotifier {
|
|||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
late http.Response res;
|
||||
Map<String, String> headers = {
|
||||
final headers = <String, String>{
|
||||
'Authorization': 'token $token',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
};
|
||||
|
@ -418,7 +418,7 @@ class AuthModel with ChangeNotifier {
|
|||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
http.Response res;
|
||||
Map<String, String> headers = {
|
||||
final headers = <String, String>{
|
||||
'Authorization': 'token $token',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
};
|
||||
|
@ -612,11 +612,11 @@ class AuthModel with ChangeNotifier {
|
|||
Fimber.e('getUriLinksStream failed', ex: err);
|
||||
});
|
||||
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
// Read accounts
|
||||
try {
|
||||
String? str = prefs.getString(StorageKeys.accounts);
|
||||
final str = prefs.getString(StorageKeys.accounts);
|
||||
// Fimber.d('read accounts: $str');
|
||||
_accounts = (json.decode(str ?? '[]') as List)
|
||||
.map((item) => Account.fromJson(item))
|
||||
|
|
|
@ -39,11 +39,11 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<void> init() async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
var vh = prefs.getString(StorageKeys.codeTheme);
|
||||
var vdh = prefs.getString(StorageKeys.codeThemeDark);
|
||||
var vs = prefs.getInt(StorageKeys.iCodeFontSize);
|
||||
var vf = prefs.getString(StorageKeys.codeFontFamily);
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final vh = prefs.getString(StorageKeys.codeTheme);
|
||||
final vdh = prefs.getString(StorageKeys.codeThemeDark);
|
||||
final vs = prefs.getInt(StorageKeys.iCodeFontSize);
|
||||
final vf = prefs.getString(StorageKeys.codeFontFamily);
|
||||
|
||||
Fimber.d('read code: $vh, $vs, $vf');
|
||||
if (themeMap.keys.contains(vh)) {
|
||||
|
@ -63,7 +63,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setTheme(String v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(StorageKeys.codeTheme, v);
|
||||
Fimber.d('write code theme: $v');
|
||||
|
@ -73,7 +73,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setThemeDark(String v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(StorageKeys.codeThemeDark, v);
|
||||
Fimber.d('write code theme dark: $v');
|
||||
|
@ -83,7 +83,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setFontSize(int v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setInt(StorageKeys.iCodeFontSize, v);
|
||||
Fimber.d('write code font size: $v');
|
||||
|
@ -93,7 +93,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setFontFamily(String v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(StorageKeys.codeFontFamily, v);
|
||||
Fimber.d('write code font family: $v');
|
||||
|
|
|
@ -353,8 +353,8 @@ class GithubGistsItem {
|
|||
Map<String, GistFiles>? files;
|
||||
GithubEventUser? owner;
|
||||
List<GistFiles> get fileNames {
|
||||
List<GistFiles> filenames = [];
|
||||
files!.forEach((String key, GistFiles value) {
|
||||
final filenames = <GistFiles>[];
|
||||
files!.forEach((key, value) {
|
||||
filenames.add(value);
|
||||
});
|
||||
return filenames;
|
||||
|
|
|
@ -58,14 +58,14 @@ class SelectorItem<T> {
|
|||
class StaticRoute extends PageRouteBuilder {
|
||||
StaticRoute({this.builder})
|
||||
: super(
|
||||
pageBuilder: (BuildContext context, Animation<double> animation,
|
||||
Animation<double> secondaryAnimation) {
|
||||
pageBuilder: (context, animation,
|
||||
secondaryAnimation) {
|
||||
return builder!(context);
|
||||
},
|
||||
transitionsBuilder: (BuildContext context,
|
||||
Animation<double> animation,
|
||||
Animation<double> secondaryAnimation,
|
||||
Widget child) {
|
||||
transitionsBuilder: (context,
|
||||
animation,
|
||||
secondaryAnimation,
|
||||
child) {
|
||||
return child;
|
||||
},
|
||||
);
|
||||
|
|
|
@ -65,7 +65,7 @@ class _ListStatefulScaffoldState<T, K>
|
|||
loading = true;
|
||||
});
|
||||
try {
|
||||
final ListPayload<T, K> p = await widget.fetch(null);
|
||||
final p = await widget.fetch(null);
|
||||
items = p.items.toList();
|
||||
cursor = p.cursor;
|
||||
hasMore = p.hasMore;
|
||||
|
@ -87,7 +87,7 @@ class _ListStatefulScaffoldState<T, K>
|
|||
loadingMore = true;
|
||||
});
|
||||
try {
|
||||
ListPayload<T, K> p = await widget.fetch(cursor);
|
||||
final p = await widget.fetch(cursor);
|
||||
items.addAll(p.items);
|
||||
cursor = p.cursor;
|
||||
hasMore = p.hasMore;
|
||||
|
|
|
@ -89,7 +89,7 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
loadingMore = true;
|
||||
});
|
||||
try {
|
||||
LongListPayload<T?, K> p = await widget.onLoadMore(payload!.cursor);
|
||||
final LongListPayload<T?, K> p = await widget.onLoadMore(payload!.cursor);
|
||||
payload!.totalCount = p.totalCount;
|
||||
payload!.cursor = p.cursor;
|
||||
payload!.leadingItems.addAll(p.leadingItems);
|
||||
|
@ -109,12 +109,12 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
return CommonStyle.border;
|
||||
}
|
||||
|
||||
int realIndex = index ~/ 2;
|
||||
final realIndex = index ~/ 2;
|
||||
|
||||
if (realIndex < payload!.leadingItems.length) {
|
||||
return widget.itemBuilder(payload!.leadingItems[realIndex]);
|
||||
} else if (realIndex == payload!.leadingItems.length) {
|
||||
var count = payload!.totalCount -
|
||||
final count = payload!.totalCount -
|
||||
payload!.leadingItems.length +
|
||||
payload!.trailingItems!.length;
|
||||
return Container(
|
||||
|
@ -153,7 +153,7 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
}
|
||||
|
||||
int get _itemCount {
|
||||
int count = payload!.leadingItems.length + payload!.trailingItems!.length;
|
||||
var count = payload!.leadingItems.length + payload!.trailingItems!.length;
|
||||
if (payload!.totalCount > count) {
|
||||
count++;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<Widget> slivers = [CupertinoSliverRefreshControl(onRefresh: _refresh)];
|
||||
final slivers = <Widget>[CupertinoSliverRefreshControl(onRefresh: _refresh)];
|
||||
if (payload != null) {
|
||||
slivers.add(
|
||||
SliverToBoxAdapter(child: widget.headerBuilder(payload!.header)),
|
||||
|
|
|
@ -34,7 +34,7 @@ class BbIssuesScreen extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
itemBuilder: (v) {
|
||||
int issueNumber =
|
||||
final issueNumber =
|
||||
int.parse(v.issueLink!.replaceFirst(RegExp(r'.*\/'), ''));
|
||||
return IssueItem(
|
||||
avatarUrl: v.reporter!.avatarUrl,
|
||||
|
|
|
@ -29,7 +29,7 @@ class BbPullsScreen extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
itemBuilder: (v) {
|
||||
int pullNumber =
|
||||
final pullNumber =
|
||||
int.parse(v.pullRequestLink!.replaceFirst(RegExp(r'.*\/'), ''));
|
||||
return IssueItem(
|
||||
avatarUrl: v.author!.avatarUrl,
|
||||
|
|
|
@ -35,8 +35,8 @@ class MyApp extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var codeProvider = Provider.of<CodeModel>(context);
|
||||
var theme = Provider.of<ThemeModel>(context);
|
||||
final codeProvider = Provider.of<CodeModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return SingleScaffold(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.codeTheme),
|
||||
|
@ -76,7 +76,7 @@ class MyApp extends StatelessWidget {
|
|||
items: CodeModel.fontFamilies
|
||||
.map((v) => PickerItem(v, text: v))
|
||||
.toList(),
|
||||
onChange: (String? value) {
|
||||
onChange: (value) {
|
||||
codeProvider.setFontFamily(value!);
|
||||
},
|
||||
),
|
||||
|
|
|
@ -83,7 +83,7 @@ class GePullScreen extends StatelessWidget {
|
|||
final theme = context.read<ThemeModel>();
|
||||
var additions = 0;
|
||||
var deletions = 0;
|
||||
for (var file in files) {
|
||||
for (final file in files) {
|
||||
additions += int.parse(file.additions!);
|
||||
deletions += int.parse(file.deletions!);
|
||||
}
|
||||
|
|
|
@ -58,14 +58,14 @@ class GeRepoScreen extends StatelessWidget {
|
|||
await auth.fetchGitee('/repos/$owner/$name/branches').then((v) {
|
||||
return [for (var branch in v) GiteeBranch.fromJson(branch)];
|
||||
});
|
||||
bool isStarred = await auth
|
||||
final isStarred = await auth
|
||||
.fetchGitee('/user/starred/$owner/$name', requestType: 'NO CONTENT')
|
||||
.then((v) => v.statusCode == HttpStatus.noContent);
|
||||
bool isWatching = await auth
|
||||
final isWatching = await auth
|
||||
.fetchGitee('/user/subscriptions/$owner/$name',
|
||||
requestType: 'NO CONTENT')
|
||||
.then((v) => v.statusCode == HttpStatus.noContent);
|
||||
StatusPayload statusPayload = StatusPayload(isWatching, isStarred);
|
||||
final statusPayload = StatusPayload(isWatching, isStarred);
|
||||
return Tuple4(repo, readmeData, branches, statusPayload);
|
||||
},
|
||||
bodyBuilder: (t, setData) {
|
||||
|
@ -88,7 +88,7 @@ class GeRepoScreen extends StatelessWidget {
|
|||
active: t.item4.isWatching,
|
||||
text: t.item4.isWatching ? 'Ignore' : 'Watch',
|
||||
onTap: () async {
|
||||
final String watchType =
|
||||
final watchType =
|
||||
t.item4.isWatching ? 'ignoring' : 'watching';
|
||||
await context.read<AuthModel>().fetchGitee(
|
||||
'/user/subscriptions/$owner/$name?watch_type=$watchType',
|
||||
|
|
|
@ -41,7 +41,7 @@ class _GeSearchScreenState extends State<GeSearchScreen> {
|
|||
Future<void> _query() async {
|
||||
if (_loading || _keyword.isEmpty) return;
|
||||
|
||||
var keyword = _controller!.text;
|
||||
final keyword = _controller!.text;
|
||||
setState(() {
|
||||
_loading = true;
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ class GhContributorsScreen extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
itemBuilder: (v) {
|
||||
final String? login = v.login;
|
||||
final login = v.login;
|
||||
return ContributorItem(
|
||||
avatarUrl: v.avatarUrl,
|
||||
commits: v.contributions,
|
||||
|
|
|
@ -95,7 +95,7 @@ class GhIssueScreen extends StatelessWidget {
|
|||
b.vars.number = number;
|
||||
b.vars.cursor = cursor;
|
||||
});
|
||||
OperationResponse<GIssueData, GIssueVars?> res =
|
||||
final OperationResponse<GIssueData, GIssueVars?> res =
|
||||
await context.read<AuthModel>().gqlClient.request(req).first;
|
||||
return res.data!.repository!;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class GhNewsScreenState extends State<GhNewsScreen> {
|
|||
Future.microtask(() async {
|
||||
// Check if there are unread notification items.
|
||||
// 1 item is enough since count is not displayed for now.
|
||||
var items = await context
|
||||
final items = await context
|
||||
.read<AuthModel>()
|
||||
.ghClient
|
||||
.getJSON('/notifications?per_page=1');
|
||||
|
|
|
@ -31,9 +31,9 @@ class GhNotificationScreenState extends State<GhNotificationScreen> {
|
|||
context.read<NotificationModel>().setCount(ns.length);
|
||||
}
|
||||
|
||||
Map<String, NotificationGroup> groupMap = {};
|
||||
final groupMap = <String, NotificationGroup>{};
|
||||
|
||||
for (var item in ns) {
|
||||
for (final item in ns) {
|
||||
final repo = item.repository!.fullName ?? ''; // TODO: nullable
|
||||
if (groupMap[repo] == null) {
|
||||
groupMap[repo] = NotificationGroup(repo);
|
||||
|
@ -57,7 +57,7 @@ class GhNotificationScreenState extends State<GhNotificationScreen> {
|
|||
schema +=
|
||||
'${group.key}: repository(owner: "${group.owner}", name: "${group.name}") {';
|
||||
|
||||
for (var item in group.items) {
|
||||
for (final item in group.items) {
|
||||
switch (item.subject!.type) {
|
||||
case 'Issue':
|
||||
schema += '''
|
||||
|
@ -83,13 +83,13 @@ ${item.key}: pullRequest(number: ${item.subject!.number}) {
|
|||
if (schema == '{}') return groupMap;
|
||||
|
||||
// Fimber.d(schema);
|
||||
var data = await context.read<AuthModel>().query(schema);
|
||||
final data = await context.read<AuthModel>().query(schema);
|
||||
groupMap.forEach((repo, group) {
|
||||
for (var item in group.items) {
|
||||
var groupData = data[group.key];
|
||||
for (final item in group.items) {
|
||||
final groupData = data[group.key];
|
||||
if (groupData == null) continue;
|
||||
|
||||
var itemData = data[group.key][item.key];
|
||||
final itemData = data[group.key][item.key];
|
||||
if (itemData != null) {
|
||||
item.state = itemData['state'];
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ class _GhSearchScreenState extends State<GhSearchScreen> {
|
|||
Future<void> _query() async {
|
||||
if (_loading || _keyword.isEmpty) return;
|
||||
|
||||
var keyword = _controller!.text;
|
||||
final keyword = _controller!.text;
|
||||
setState(() {
|
||||
_loading = true;
|
||||
});
|
||||
|
|
|
@ -42,7 +42,7 @@ class _GlSearchScreenState extends State<GlSearchScreen> {
|
|||
Future<void> _query() async {
|
||||
if (_loading || _keyword.isEmpty) return;
|
||||
|
||||
var keyword = _controller!.text;
|
||||
final keyword = _controller!.text;
|
||||
setState(() {
|
||||
_loading = true;
|
||||
});
|
||||
|
|
|
@ -47,12 +47,11 @@ class GoRepoScreen extends StatelessWidget {
|
|||
return utf8.decode(res.bodyBytes).normalizedHtml;
|
||||
});
|
||||
final readmeData = MarkdownViewData(context, md: md, html: html);
|
||||
List<GogsBranch> branches =
|
||||
final branches =
|
||||
await auth.fetchGogs('/repos/$owner/$name/branches').then((v) {
|
||||
if (v is! List) {
|
||||
return [];
|
||||
} // Valid API Response only returned if repo contains >= 2 branches
|
||||
return [for (var branch in v) GogsBranch.fromJson(branch)];
|
||||
return [
|
||||
for (var branch in (v is List ? v : [])) GogsBranch.fromJson(branch)
|
||||
]; // Valid API Response only returned if repo contains >= 2 branches
|
||||
});
|
||||
|
||||
return Tuple3(repo, readmeData, branches);
|
||||
|
|
|
@ -32,7 +32,7 @@ class GtUserScreen extends StatelessWidget {
|
|||
final heatmapItems = [
|
||||
for (final v in userHeatmap) GiteaHeatmapItem.fromJson(v)
|
||||
];
|
||||
List<List<ContributionDay>> heatmapWeeks = [[]];
|
||||
final heatmapWeeks = <List<ContributionDay>>[[]];
|
||||
for (var i = 0; i < heatmapItems.length; i++) {
|
||||
if (i > 0 &&
|
||||
heatmapItems[i].timestamp! - heatmapItems[i - 1].timestamp! > 86400) {
|
||||
|
|
|
@ -48,10 +48,10 @@ class CommonStyle {
|
|||
}
|
||||
|
||||
Color getFontColorByBrightness(Color color) {
|
||||
var grayscale = color.red * 0.3 + color.green * 0.59 + color.blue * 0.11;
|
||||
final grayscale = color.red * 0.3 + color.green * 0.59 + color.blue * 0.11;
|
||||
// Fimber.d('color: $color, $grayscale');
|
||||
|
||||
var showWhite = grayscale < 128;
|
||||
final showWhite = grayscale < 128;
|
||||
return showWhite ? AntTheme.white : AntTheme.text;
|
||||
}
|
||||
|
||||
|
@ -90,12 +90,12 @@ class GithubPalette {
|
|||
const PAGE_SIZE = 30;
|
||||
|
||||
var createWarning =
|
||||
(String text) => Text(text, style: const TextStyle(color: AntTheme.danger));
|
||||
(text) => Text(text, style: const TextStyle(color: AntTheme.danger));
|
||||
var warningSpan =
|
||||
const TextSpan(text: 'xxx', style: TextStyle(color: AntTheme.danger));
|
||||
|
||||
List<T> join<T>(T seperator, List<T> xs) {
|
||||
List<T> result = [];
|
||||
final result = <T>[];
|
||||
xs.asMap().forEach((index, x) {
|
||||
if (x == null) return;
|
||||
|
||||
|
@ -109,7 +109,7 @@ List<T> join<T>(T seperator, List<T> xs) {
|
|||
}
|
||||
|
||||
List<T> joinAll<T>(T seperator, List<List<T>> xss) {
|
||||
List<T> result = [];
|
||||
final result = <T>[];
|
||||
xss.asMap().forEach((index, x) {
|
||||
if (x.isEmpty) return;
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ class ContributionWidget extends StatelessWidget {
|
|||
|
||||
ContributionWidget({required this.weeks}) {
|
||||
int? maxCount;
|
||||
for (var week in weeks!) {
|
||||
for (var day in week) {
|
||||
for (final week in weeks!) {
|
||||
for (final day in week) {
|
||||
if (day.count != null) {
|
||||
if (maxCount == null) {
|
||||
for (var week in weeks!) {
|
||||
for (var day in week) {
|
||||
for (final week in weeks!) {
|
||||
for (final day in week) {
|
||||
maxCount = max(day.count!, maxCount ?? 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -308,7 +308,7 @@ class EventItem extends StatelessWidget {
|
|||
]);
|
||||
case 'CheckSuiteEvent':
|
||||
// Needs checks permission
|
||||
String conclusion = '';
|
||||
var conclusion = '';
|
||||
switch (e.payload!.checkSuite!.conclusion) {
|
||||
case 'success':
|
||||
case 'failure':
|
||||
|
@ -387,9 +387,9 @@ class EventItem extends StatelessWidget {
|
|||
],
|
||||
);
|
||||
case 'GollumEvent':
|
||||
String pageNamesCreated = '';
|
||||
String pageNamesEdited = '';
|
||||
for (GithubPagesItem page in e.payload!.pages!) {
|
||||
var pageNamesCreated = '';
|
||||
var pageNamesEdited = '';
|
||||
for (final page in e.payload!.pages!) {
|
||||
if (page.action == 'edited') {
|
||||
pageNamesEdited += ', ${page.pageName!}';
|
||||
} else {
|
||||
|
@ -409,7 +409,7 @@ class EventItem extends StatelessWidget {
|
|||
context: context,
|
||||
spans: [TextSpan(text: ' $pageNamesCreated\n$pageNamesEdited ')]);
|
||||
case 'InstallationEvent':
|
||||
String? action = e.payload!.action;
|
||||
var action = e.payload!.action;
|
||||
if (action == 'new_permissions_accepted') {
|
||||
action = AppLocalizations.of(context)!.newPermissionsAccepted;
|
||||
}
|
||||
|
@ -422,19 +422,19 @@ class EventItem extends StatelessWidget {
|
|||
],
|
||||
);
|
||||
case 'InstallationRepositoriesEvent':
|
||||
List<GithubNotificationItemRepo> repositoriesAdded =
|
||||
final repositoriesAdded =
|
||||
e.payload!.installation!.repositoriesAdded!;
|
||||
List<GithubNotificationItemRepo> repositoriesRemoved =
|
||||
final repositoriesRemoved =
|
||||
e.payload!.installation!.repositoriesRemoved!;
|
||||
String addedRepos = '';
|
||||
String removedRepos = '';
|
||||
for (GithubNotificationItemRepo repo in repositoriesAdded) {
|
||||
var addedRepos = '';
|
||||
var removedRepos = '';
|
||||
for (final repo in repositoriesAdded) {
|
||||
addedRepos += '${repo.fullName!}, ';
|
||||
}
|
||||
for (GithubNotificationItemRepo repo in repositoriesRemoved) {
|
||||
for (final repo in repositoriesRemoved) {
|
||||
removedRepos += '${repo.fullName!}, ';
|
||||
}
|
||||
String finalListOfRepos = '';
|
||||
var finalListOfRepos = '';
|
||||
if (addedRepos != '') {
|
||||
finalListOfRepos +=
|
||||
'${AppLocalizations.of(context)!.wereAddedTo(addedRepos, e.payload!.installation!.id.toString())}\n ';
|
||||
|
@ -531,7 +531,7 @@ class EventItem extends StatelessWidget {
|
|||
],
|
||||
);
|
||||
case 'ProjectCardEvent':
|
||||
String? action = e.payload!.action;
|
||||
var action = e.payload!.action;
|
||||
if (action == 'converted') {
|
||||
action = ' ${AppLocalizations.of(context)!.convertProjectCard} ';
|
||||
} else {
|
||||
|
|
|
@ -92,7 +92,7 @@ class MarkdownFlutterView extends StatelessWidget {
|
|||
final EdgeInsetsGeometry padding;
|
||||
|
||||
static Map<String, String?>? matchPattern(String url, String pattern) {
|
||||
var uri = Uri.parse(url);
|
||||
final uri = Uri.parse(url);
|
||||
return UriParser(UriTemplate(pattern)).match(uri)?.parameters;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ class MarkdownFlutterView extends StatelessWidget {
|
|||
'/{owner}/{name}',
|
||||
'/{login}'
|
||||
];
|
||||
for (var p in matchedPaths) {
|
||||
for (final p in matchedPaths) {
|
||||
final m = matchPattern(url, p);
|
||||
if (m != null) {
|
||||
context.pushUrl(
|
||||
|
|
|
@ -21,8 +21,8 @@ class TextWithAt extends StatelessWidget {
|
|||
final matches = _reg.allMatches(text).map((m) => m.group(0)).toList();
|
||||
final chunks = text.split(_reg);
|
||||
|
||||
List<TextSpan> spans = [];
|
||||
for (var index in List.generate(matches.length, (i) => (i))) {
|
||||
final spans = <TextSpan>[];
|
||||
for (final index in List.generate(matches.length, (i) => (i))) {
|
||||
if (chunks[index].isNotEmpty) {
|
||||
spans.add(TextSpan(text: chunks[index]));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue