opt: unnecessary_non_null_assertion (#1762)

This commit is contained in:
My-Responsitories
2025-12-03 17:35:42 +08:00
committed by GitHub
parent b7a277a57c
commit 2b3ec77e92
89 changed files with 249 additions and 247 deletions

View File

@@ -30,9 +30,9 @@ class _WhisperPageState extends State<WhisperPage> {
actions: [
Obx(() {
final outsideItem = _controller.outsideItem.value;
if (outsideItem?.isNotEmpty == true) {
if (outsideItem != null && outsideItem.isNotEmpty) {
return Row(
children: outsideItem!.map((e) {
children: outsideItem.map((e) {
return IconButton(
tooltip: e.hasTitle() ? e.title : null,
onPressed: () => e.type.action(
@@ -49,10 +49,10 @@ class _WhisperPageState extends State<WhisperPage> {
}),
Obx(() {
final threeDotItems = _controller.threeDotItems.value;
if (threeDotItems?.isNotEmpty == true) {
if (threeDotItems != null && threeDotItems.isNotEmpty) {
return PopupMenuButton(
itemBuilder: (context) {
return threeDotItems!
return threeDotItems
.map(
(e) => PopupMenuItem(
onTap: () => e.type.action(
@@ -105,9 +105,9 @@ class _WhisperPageState extends State<WhisperPage> {
itemBuilder: (context, index) => const WhisperItemSkeleton(),
),
Success(:var response) =>
response?.isNotEmpty == true
response != null && response.isNotEmpty
? SliverList.separated(
itemCount: response!.length,
itemCount: response.length,
itemBuilder: (context, index) {
if (index == response.length - 1) {
_controller.onLoadMore();