Optimize mobile - Avoid creating unnecessary widgets (#268)

* Avoid creating unnecessary widgets

* more flexible null handling and runtime errors prevention
This commit is contained in:
xpwmaosldk
2022-07-01 10:08:49 +09:00
committed by GitHub
parent 992f792c0a
commit c4ef523564
29 changed files with 369 additions and 450 deletions

View File

@@ -56,7 +56,7 @@ class AlbumInfoCard extends HookConsumerWidget {
);
}
return Container();
return const SizedBox();
}
_buildImageFilter() {
@@ -151,7 +151,11 @@ class AlbumInfoCard extends HookConsumerWidget {
),
child: null,
),
Positioned(bottom: 10, left: 25, child: _buildSelectedTextBox())
Positioned(
bottom: 10,
left: 25,
child: _buildSelectedTextBox(),
)
],
),
Padding(
@@ -176,8 +180,7 @@ class AlbumInfoCard extends HookConsumerWidget {
Padding(
padding: const EdgeInsets.only(top: 2.0),
child: Text(
albumInfo.assetCount.toString() +
(albumInfo.isAll ? " (ALL)" : ""),
'${albumInfo.assetCount} ${(albumInfo.isAll ? " (ALL)" : "")}',
style: TextStyle(
fontSize: 12, color: Colors.grey[600]),
),