Skip to content

Commit

Permalink
Merge pull request #239 from sliverappbar/fix/dart-analysis
Browse files Browse the repository at this point in the history
chore: remove Dart Analysis warnings
  • Loading branch information
violet-dev authored Oct 14, 2023
2 parents ce754ee + 692a75f commit c99837c
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 57 deletions.
2 changes: 1 addition & 1 deletion lib/component/hitomi/title_cluster.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class HitomiTitleCluster {
});

// Group By Same Lists
var gg = groupBy(groups, (x) => (x as List<int>).join(','));
var gg = groupBy(groups, (group) => group.join(','));
var ds = DisjointSet(titles.length);

// Join groups
Expand Down
16 changes: 8 additions & 8 deletions lib/pages/article_info/article_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,10 @@ class PreviewAreaWidget extends StatelessWidget {
},
);
}
return Row(
return const Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [
children: [
SizedBox(
width: 100,
height: 100,
Expand Down Expand Up @@ -686,10 +686,10 @@ class __InfoAreaWidgetState extends State<_InfoAreaWidget> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
const Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [
children: [
SizedBox(
width: 100,
height: 100,
Expand Down Expand Up @@ -824,13 +824,13 @@ class __InfoAreaWidgetState extends State<_InfoAreaWidget> {
);
},
splashColor: Colors.white,
child: ListTile(
child: const ListTile(
// dense: true,
// contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: const [Text('Write Comment')],
children: [Text('Write Comment')],
),
),
);
Expand Down Expand Up @@ -966,10 +966,10 @@ class __InfoAreaWidgetState extends State<_InfoAreaWidget> {
},
);
}
return Row(
return const Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [
children: [
SizedBox(
width: 100,
height: 100,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/artist_info/article_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ class _ArticleListPageState extends State<ArticleListPage> {
elevation: 100,
clipBehavior: Clip.antiAliasWithSaveLayer,
child: InkWell(
child: SizedBox(
child: const SizedBox(
height: 48,
width: 48,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
MdiIcons.formatListText,
color: Colors.grey,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/bookmark/group/group_article_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ class _GroupArticleListPageState extends State<GroupArticleListPage> {
elevation: !Settings.themeFlat ? 100 : 0,
clipBehavior: Clip.antiAliasWithSaveLayer,
child: InkWell(
child: SizedBox(
child: const SizedBox(
height: 48,
width: 48,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
MdiIcons.formatListText,
color: Colors.grey,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/community/community_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ class _CommunityPageState extends State<CommunityPage>
height: double.infinity,
width: 88,
child: _logining
? SizedBox(
? const SizedBox(
height: 48,
width: 48,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
SizedBox(
height: 30,
width: 30,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/community/user_status_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ class _UserStatusCardState extends ThemeSwitchableState<UserStatusCard>
height: double.infinity,
width: 88,
child: _logining
? SizedBox(
? const SizedBox(
height: 48,
width: 48,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
SizedBox(
height: 30,
width: 30,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/community/user_status_card_dead.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ class _UserStatusCardState extends State<UserStatusCard>
height: double.infinity,
width: 88,
child: _logining
? SizedBox(
? const SizedBox(
height: 48,
width: 48,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
SizedBox(
height: 30,
width: 30,
Expand Down
7 changes: 3 additions & 4 deletions lib/pages/database_download/decompress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ class P7zip {
final devicePlugin = DeviceInfoPlugin();
final deviceInfo = await devicePlugin.androidInfo;

final supportedAbis =
deviceInfo.supportedAbis.where((abi) => abi != null).cast<String>();
final targetAbi =
supportedAbis.firstWhere((abi) => libraryAbis.contains(abi));
final targetAbi = deviceInfo.supportedAbis.firstWhere(
(abi) => libraryAbis.contains(abi),
);
final sharedLibraryPath = 'assets/p7zip/$targetAbi/lib7zr.so';
final sharedLibraryContent = await rootBundle.load(sharedLibraryPath);

Expand Down
8 changes: 4 additions & 4 deletions lib/pages/download/download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,12 @@ class _DownloadPageState extends ThemeSwitchableState<DownloadPage>
clipBehavior: Clip.antiAliasWithSaveLayer,
child: InkWell(
onTap: _featuresOnTap,
child: SizedBox(
child: const SizedBox(
height: 64,
width: 64,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
MdiIcons.hammerWrench,
color: Colors.grey,
Expand Down Expand Up @@ -605,12 +605,12 @@ class _DownloadPageState extends ThemeSwitchableState<DownloadPage>
onTap: _alignOnTap,
onDoubleTap: _alignDoubleTap,
onLongPress: _alignLongPress,
child: SizedBox(
child: const SizedBox(
height: 64,
width: 64,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
MdiIcons.formatListText,
color: Colors.grey,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/main/info/lab/artist_search/artist_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ class _ArtistSearchState extends State<ArtistSearch> {
}

titleArea() {
return Row(
return const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
children: [
Text('Artist Search',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/main/info/lab/bookmark/bookmarks_article_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ class _GroupArticleListPageState extends State<LabGroupArticleListPage> {
elevation: !Settings.themeFlat ? 100 : 0,
clipBehavior: Clip.antiAliasWithSaveLayer,
child: InkWell(
child: SizedBox(
child: const SizedBox(
height: 48,
width: 48,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
MdiIcons.formatListText,
color: Colors.grey,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/main/info/lab/recent_user_record.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class _LabUserRecentRecordsState extends State<LabUserRecentRecords> {
);
},
)
: Column(
children: const <Widget>[
: const Column(
children: <Widget>[
Expanded(
child: Align(
alignment: Alignment.center,
Expand Down
8 changes: 4 additions & 4 deletions lib/pages/main/info/lab/statistics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ class _StatisticsState extends State<Statistics> {
_heatMap(),
],
)
: Column(
children: const <Widget>[
: const Column(
children: <Widget>[
Expanded(
child: Align(
alignment: Alignment.center,
Expand Down Expand Up @@ -445,9 +445,9 @@ class _StatisticsState extends State<Statistics> {
Container(
height: 16,
),
Row(
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
children: [
Text('나의 통계',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/main/info/violet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class VioletPage extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
width: 250,
height: 190,
child: Column(
children: const <Widget>[
child: const Column(
children: <Widget>[
Text(''),
Text(
'Violet',
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/search/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ class _SearchPageState extends ThemeSwitchableState<SearchPage>
final alignOverlay = InkWell(
onTap: alignOnTap,
onLongPress: alignLongPress,
child: SizedBox(
child: const SizedBox(
height: 64,
width: 64,
child: Stack(
alignment: Alignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
MdiIcons.formatListText,
color: Colors.grey,
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/settings/db_rebuild_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class _DBRebuildPagePageState extends State<DBRebuildPage> {
child: SizedBox(
width: 280,
height: (56 * 4 + 16).toDouble(),
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
child: const Padding(
padding: EdgeInsets.fromLTRB(0, 8, 0, 8),
child: Stack(
children: const [
children: [
Center(
child: CircularProgressIndicator(),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/settings/import_from_eh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class _ImportFromEHPageState extends State<ImportFromEHPage> {
child: SizedBox(
width: 280,
height: (56 * 4 + 16).toDouble(),
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
child: const Padding(
padding: EdgeInsets.fromLTRB(0, 8, 0, 8),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
Expand All @@ -70,7 +70,7 @@ class _ImportFromEHPageState extends State<ImportFromEHPage> {
// ],
// ),
child: Stack(
children: const [
children: [
Center(
child: CircularProgressIndicator(),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/settings/libviolet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class LibvioletPage extends StatelessWidget {
padding: EdgeInsets.fromLTRB(12, 12, 0, 0),
child: Text('What is libviolet?'),
),
expanded: Padding(
padding: const EdgeInsets.fromLTRB(16, 4, 16, 4),
expanded: const Padding(
padding: EdgeInsets.fromLTRB(16, 4, 16, 4),
child: Column(
children: const [
children: [
Text(
'Libviolet is a very fast download library implemented based on Rust. '
'This download library allows downloads up to the network maximum download speed.',
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/splash/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -629,13 +629,13 @@ class _SplashPageState extends State<SplashPage> {
child: InkWell(
customBorder: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8.0))),
child: SizedBox(
child: const SizedBox(
width: 150,
height: 50,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
children: <Widget>[
Icon(
Icons.language,
size: 35,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/viewer/overlay/viewer_thumbnails.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ class _ViewerThumbnailState extends State<ViewerThumbnail> {
},
);
}
return Row(
return const Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [
children: [
SizedBox(
width: 100,
height: 100,
Expand Down
6 changes: 3 additions & 3 deletions lib/settings/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class Settings {
if (Platform.isAndroid) {
var deviceInfoPlugin = DeviceInfoPlugin();
final androidInfo = await deviceInfoPlugin.androidInfo;
if (androidInfo.version.sdkInt! >= 30) tUseInnerStorage = true;
if (androidInfo.version.sdkInt >= 30) tUseInnerStorage = true;
}

await prefs.setBool('userinnerstorage', tUseInnerStorage);
Expand All @@ -237,7 +237,7 @@ class Settings {
final String path = await ExtStorage.getExternalStorageDirectory();

var androidInfo = await DeviceInfoPlugin().androidInfo;
var sdkInt = androidInfo.version.sdkInt!;
var sdkInt = androidInfo.version.sdkInt;

if (sdkInt >= 30 && prefs.getBool('android30downpath') == null) {
await prefs.setBool('android30downpath', true);
Expand Down Expand Up @@ -394,7 +394,7 @@ class Settings {

static Future<String> getDefaultDownloadPath() async {
var androidInfo = await DeviceInfoPlugin().androidInfo;
var sdkInt = androidInfo.version.sdkInt!;
var sdkInt = androidInfo.version.sdkInt;

if (sdkInt >= 30) {
var ext = await getExternalStorageDirectory();
Expand Down

0 comments on commit c99837c

Please sign in to comment.