From 99a80f17a15022c13977260e86959f5c4c398e81 Mon Sep 17 00:00:00 2001 From: Shourya Shikhar Date: Sun, 9 Jul 2023 17:10:27 +0530 Subject: [PATCH] fixed unnecessary imports and unnecessary null assertion operators --- example/lib/page/calendar_view.dart | 2 +- lib/controller/month_controller.dart | 1 - lib/handle.dart | 1 - lib/widget/month_page_view.dart | 8 +------- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/example/lib/page/calendar_view.dart b/example/lib/page/calendar_view.dart index 7610b1d..66a1587 100644 --- a/example/lib/page/calendar_view.dart +++ b/example/lib/page/calendar_view.dart @@ -60,7 +60,7 @@ class _CalendarViewPageState extends State { @override void dispose() { - controllers.forEach((f) => f?.dispose()); + controllers.forEach((f) => f.dispose()); super.dispose(); } } diff --git a/lib/controller/month_controller.dart b/lib/controller/month_controller.dart index 6503588..2c66935 100644 --- a/lib/controller/month_controller.dart +++ b/lib/controller/month_controller.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import '../model/month_option.dart'; import '../mini_calendar.dart'; const double SPACING = 0.0; diff --git a/lib/handle.dart b/lib/handle.dart index 6f72537..403bdbf 100644 --- a/lib/handle.dart +++ b/lib/handle.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'model/calendar_i18n_model.dart'; diff --git a/lib/widget/month_page_view.dart b/lib/widget/month_page_view.dart index 1a6c911..302a2a8 100644 --- a/lib/widget/month_page_view.dart +++ b/lib/widget/month_page_view.dart @@ -1,13 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import '../model/calendar_i18n_model.dart'; -import 'month_widget.dart'; -import '../handle.dart'; import '../mini_calendar.dart'; -import '../controller/month_page_controller.dart'; -import '../model/date_month.dart'; -import '../model/month_option.dart'; /// /// 翻页日历
@@ -117,7 +111,7 @@ class _MonthPageViewState extends State> { _monthPageController.positionStream().listen((position) => widget.onMonthChange!(_monthPageController.monthList[position])); } - SchedulerBinding.instance!.addPostFrameCallback((Duration timeStamp) { + SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) { if (widget.onCreated != null) { widget.onCreated!(_monthPageController); }