master
章文轩 3 years ago
parent b36def9c64
commit 4f50105cac

@ -2,241 +2,201 @@
<library name="Dart Packages" type="DartPackagesLibraryType">
<properties>
<option name="packageNameToDirsMap">
<entry key="archive">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13/lib" />
</list>
</value>
</entry>
<entry key="args">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0/lib" />
</list>
</value>
</entry>
<entry key="async">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/async-2.6.1/lib" />
</list>
</value>
</entry>
<entry key="boolean_selector">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib" />
</list>
</value>
</entry>
<entry key="charcode">
<entry key="characters">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0/lib" />
</list>
</value>
</entry>
<entry key="collection">
<entry key="charcode">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/charcode-1.2.0/lib" />
</list>
</value>
</entry>
<entry key="convert">
<entry key="clock">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib" />
</list>
</value>
</entry>
<entry key="crypto">
<entry key="collection">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib" />
</list>
</value>
</entry>
<entry key="cupertino_icons">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib" />
</list>
</value>
</entry>
<entry key="flutter">
<entry key="fake_async">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib" />
</list>
</value>
</entry>
<entry key="flutter_test">
<entry key="flutter">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter_test/lib" />
<option value="/Applications/sdk/flutter/packages/flutter/lib" />
</list>
</value>
</entry>
<entry key="image">
<entry key="flutter_test">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12/lib" />
<option value="/Applications/sdk/flutter/packages/flutter_test/lib" />
</list>
</value>
</entry>
<entry key="matcher">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.10/lib" />
</list>
</value>
</entry>
<entry key="meta">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0/lib" />
</list>
</value>
</entry>
<entry key="nested">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/nested-1.0.0/lib" />
</list>
</value>
</entry>
<entry key="path">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4/lib" />
</list>
</value>
</entry>
<entry key="petitparser">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib" />
</list>
</value>
</entry>
<entry key="provider">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/provider-4.1.3/lib" />
</list>
</value>
</entry>
<entry key="quiver">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/provider-6.0.3/lib" />
</list>
</value>
</entry>
<entry key="sky_engine">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/pkg/sky_engine/lib" />
<option value="/Applications/sdk/flutter/bin/cache/pkg/sky_engine/lib" />
</list>
</value>
</entry>
<entry key="source_span">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib" />
</list>
</value>
</entry>
<entry key="stack_trace">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib" />
</list>
</value>
</entry>
<entry key="stream_channel">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib" />
</list>
</value>
</entry>
<entry key="string_scanner">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib" />
</list>
</value>
</entry>
<entry key="term_glyph">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib" />
</list>
</value>
</entry>
<entry key="test_api">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/test_api-0.3.0/lib" />
</list>
</value>
</entry>
<entry key="typed_data">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib" />
</list>
</value>
</entry>
<entry key="vector_math">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib" />
</list>
</value>
</entry>
<entry key="xml">
<value>
<list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1/lib" />
<option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0/lib" />
</list>
</value>
</entry>
</option>
</properties>
<CLASSES>
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/provider-4.1.3/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/pkg/sky_engine/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter/lib" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter_test/lib" />
<root url="file:///Applications/sdk/flutter/bin/cache/pkg/sky_engine/lib" />
<root url="file:///Applications/sdk/flutter/packages/flutter/lib" />
<root url="file:///Applications/sdk/flutter/packages/flutter_test/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/async-2.6.1/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/charcode-1.2.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.10/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/nested-1.0.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/provider-6.0.3/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/test_api-0.3.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />

@ -1,27 +1,26 @@
<component name="libraryTable">
<library name="Dart SDK">
<CLASSES>
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/async" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/cli" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/collection" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/convert" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/core" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/developer" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/ffi" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/html" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/indexed_db" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/io" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/isolate" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/js" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/js_util" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/math" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/mirrors" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/svg" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/typed_data" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/wasm" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_gl" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_sql" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/cli" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/ffi" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/html" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/indexed_db" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/js" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/js_util" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/svg" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/typed_data" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/web_gl" />
<root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/web_sql" />
</CLASSES>
<JAVADOC />
<SOURCES />

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -5,19 +5,35 @@
<config />
</shared>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="18463f0e-cf10-4ee2-975b-376476396e12" name="Default Changelist" comment="">
<list default="true" id="18463f0e-cf10-4ee2-975b-376476396e12" name="Default Changelist" comment="Default Changelist">
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_SDK.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_SDK.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/pubspec.lock" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/cache_data.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/cache_data.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/calendar_provider.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/calendar_provider.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/configuration.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/configuration.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/controller.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/controller.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/model/date_model.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/model/date_model.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/utils/LogUtil.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils/LogUtil.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/utils/date_util.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils/date_util.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/utils/lunar_util.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils/lunar_util.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/utils/math_util.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils/math_util.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/utils/solar_term_util.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils/solar_term_util.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/base_day_view.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/base_day_view.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/base_week_bar.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/base_week_bar.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/calendar_view.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/calendar_view.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/default_week_bar.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/default_week_bar.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/month_view.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/month_view.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/month_view_pager.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/month_view_pager.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/only_one_pointer_widget.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/only_one_pointer_widget.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/week_view.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/week_view.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/widget/week_view_pager.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/widget/week_view_pager.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.lock" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -25,18 +41,22 @@
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_2_XL_API_28" />
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1dLYXgUqXFRhtM2vVF7WEPgjPS2" />
<component name="ProjectReloadState">
<option name="STATE" value="1" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="android.sdk.path" value="$USER_HOME$/Library/Android/sdk" />
<property name="android.sdk.path" value="$PROJECT_DIR$/../Library/Android/sdk" />
<property name="dart.analysis.tool.window.force.activate" value="false" />
<property name="io.flutter.reload.alreadyRun" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
@ -66,6 +86,7 @@
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration">
<configuration />
</component>
@ -84,13 +105,12 @@
<map>
<entry key="MAIN">
<value>
<State>
<option name="COLUMN_ORDER" />
</State>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService">
<state width="1858" height="156" key="GridCell.Tab.0.bottom" timestamp="1595297133366">

@ -1,62 +1,48 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.1"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
charcode:
version: "2.1.0"
characters:
dependency: transitive
description:
name: charcode
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
collection:
version: "1.1.0"
charcode:
dependency: transitive
description:
name: collection
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.12"
convert:
version: "1.2.0"
clock:
dependency: transitive
description:
name: convert
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto:
version: "1.1.0"
collection:
dependency: transitive
description:
name: crypto
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
@ -64,6 +50,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
@ -81,62 +74,41 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.12"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.6"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.8"
version: "1.3.0"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.4"
version: "1.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
version: "1.8.0"
provider:
dependency: transitive
description:
name: provider
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.3"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
version: "6.0.3"
sky_engine:
dependency: transitive
description: flutter
@ -148,63 +120,56 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.15"
version: "0.3.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.6.1"
version: "2.1.0"
sdks:
dart: ">=2.7.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.16.0"

@ -7,15 +7,15 @@ class CacheData {
//
CacheData._();
static CacheData _instance;
static CacheData? _instance;
static CacheData get instance => _instance;
static CacheData? get instance => _instance;
Map<DateModel, List<DateModel>> monthListCache = Map();
Map<DateModel, List<DateModel>?> monthListCache = Map();
Map<DateModel, List<DateModel>> weekListCache = Map();
static CacheData getInstance() {
static CacheData? getInstance() {
if (_instance == null) {
_instance = new CacheData._();
}

@ -16,13 +16,13 @@ import 'model/date_model.dart';
* rebuild
*/
class CalendarProvider extends ChangeNotifier {
double _totalHeight; //
HashSet<DateModel> selectedDateList = new HashSet<DateModel>(); //,
DateModel _selectDateModel; //
ItemContainerState lastClickItemState;
DateModel _lastClickDateModel;
double? _totalHeight; //
HashSet<DateModel?>? selectedDateList = new HashSet<DateModel?>(); //,
DateModel? _selectDateModel; //
ItemContainerState? lastClickItemState;
DateModel? _lastClickDateModel;
double get totalHeight => _totalHeight;
double? get totalHeight => _totalHeight;
ValueNotifier<int> _generation =
new ValueNotifier(0); //int
@ -33,7 +33,7 @@ class CalendarProvider extends ChangeNotifier {
_generation = value;
}
set totalHeight(double value) {
set totalHeight(double? value) {
_totalHeight = value;
}
@ -42,17 +42,17 @@ class CalendarProvider extends ChangeNotifier {
notifyListeners();
}
DateModel get lastClickDateModel =>
DateModel? get lastClickDateModel =>
_lastClickDateModel; //
set lastClickDateModel(DateModel value) {
set lastClickDateModel(DateModel? value) {
_lastClickDateModel = value;
print("lastClickDateModel:$lastClickDateModel");
}
DateModel get selectDateModel => _selectDateModel;
DateModel? get selectDateModel => _selectDateModel;
set selectDateModel(DateModel value) {
set selectDateModel(DateModel? value) {
_selectDateModel = value;
LogUtil.log(
TAG: this.runtimeType,
@ -63,12 +63,12 @@ class CalendarProvider extends ChangeNotifier {
//lastClickDateModelindex
int get weekPageIndex {
//index
DateModel dateModel = lastClickDateModel;
DateTime firstWeek = calendarConfiguration.weekList[0].getDateTime();
DateModel? dateModel = lastClickDateModel;
DateTime firstWeek = calendarConfiguration!.weekList![0].getDateTime();
int index = 0;
for (int i = 0; i < calendarConfiguration.weekList.length; i++) {
for (int i = 0; i < calendarConfiguration!.weekList!.length; i++) {
DateTime nextWeek = firstWeek.add(Duration(days: 7));
if (dateModel.getDateTime().isBefore(nextWeek)) {
if (dateModel!.getDateTime().isBefore(nextWeek)) {
index = i;
break;
} else {
@ -84,12 +84,12 @@ class CalendarProvider extends ChangeNotifier {
//lastClickDateModelindex
int get monthPageIndex {
//index
DateModel dateModel = lastClickDateModel;
DateModel? dateModel = lastClickDateModel;
int index = 0;
for (int i = 0; i < calendarConfiguration.monthList.length - 1; i++) {
DateTime preMonth = calendarConfiguration.monthList[i].getDateTime();
DateTime nextMonth = calendarConfiguration.monthList[i + 1].getDateTime();
if (!dateModel.getDateTime().isBefore(preMonth) &&
for (int i = 0; i < calendarConfiguration!.monthList!.length - 1; i++) {
DateTime preMonth = calendarConfiguration!.monthList![i].getDateTime();
DateTime nextMonth = calendarConfiguration!.monthList![i + 1].getDateTime();
if (!dateModel!.getDateTime().isBefore(preMonth) &&
!dateModel.getDateTime().isAfter(nextMonth)) {
index = i;
break;
@ -102,37 +102,37 @@ class CalendarProvider extends ChangeNotifier {
return index + 1;
}
ValueNotifier<bool> expandStatus; //
late ValueNotifier<bool> expandStatus; //
//
CalendarConfiguration calendarConfiguration;
CalendarConfiguration? calendarConfiguration;
void weekAndMonthViewChange(int mode) {}
void initData({
Set<DateModel> selectedDateList,
DateModel selectDateModel,
CalendarConfiguration calendarConfiguration,
EdgeInsetsGeometry padding,
EdgeInsetsGeometry margin,
double itemSize,
double verticalSpacing,
DayWidgetBuilder dayWidgetBuilder,
WeekBarItemWidgetBuilder weekBarItemWidgetBuilder,
Set<DateModel>? selectedDateList,
DateModel? selectDateModel,
required CalendarConfiguration calendarConfiguration,
EdgeInsetsGeometry? padding,
EdgeInsetsGeometry? margin,
double? itemSize,
double? verticalSpacing,
DayWidgetBuilder? dayWidgetBuilder,
WeekBarItemWidgetBuilder? weekBarItemWidgetBuilder,
}) {
LogUtil.log(TAG: this.runtimeType, message: "CalendarProvider initData");
this.calendarConfiguration = calendarConfiguration;
print(
"calendarConfiguration.defaultSelectedDateList:${calendarConfiguration.defaultSelectedDateList}");
this
.selectedDateList
.addAll(this.calendarConfiguration.defaultSelectedDateList);
this.selectDateModel = this.calendarConfiguration.selectDateModel;
this.calendarConfiguration.padding = padding;
this.calendarConfiguration.margin = margin;
this.calendarConfiguration.itemSize = itemSize;
this.calendarConfiguration.verticalSpacing = verticalSpacing;
this.calendarConfiguration.dayWidgetBuilder = dayWidgetBuilder;
this.calendarConfiguration.weekBarItemWidgetBuilder =
.selectedDateList!
.addAll(this.calendarConfiguration!.defaultSelectedDateList!);
this.selectDateModel = this.calendarConfiguration!.selectDateModel;
this.calendarConfiguration!.padding = padding;
this.calendarConfiguration!.margin = margin;
this.calendarConfiguration!.itemSize = itemSize;
this.calendarConfiguration!.verticalSpacing = verticalSpacing;
this.calendarConfiguration!.dayWidgetBuilder = dayWidgetBuilder;
this.calendarConfiguration!.weekBarItemWidgetBuilder =
weekBarItemWidgetBuilder;
//lastClickDateModelitem
@ -152,16 +152,16 @@ class CalendarProvider extends ChangeNotifier {
//itemitemSize/7/7paddingmargin
if (calendarConfiguration.itemSize == null) {
MediaQueryData mediaQueryData =
MediaQueryData.fromWindow(WidgetsBinding.instance.window);
MediaQueryData.fromWindow(WidgetsBinding.instance!.window);
if (mediaQueryData.orientation == Orientation.landscape) {
calendarConfiguration.itemSize = (mediaQueryData.size.height -
calendarConfiguration.padding.vertical -
calendarConfiguration.margin.vertical) /
calendarConfiguration.padding!.vertical -
calendarConfiguration.margin!.vertical) /
7;
} else {
calendarConfiguration.itemSize = (mediaQueryData.size.width -
calendarConfiguration.padding.horizontal -
calendarConfiguration.margin.horizontal) /
calendarConfiguration.padding!.horizontal -
calendarConfiguration.margin!.horizontal) /
7;
}
} else {
@ -174,11 +174,11 @@ class CalendarProvider extends ChangeNotifier {
calendarConfiguration.showMode ==
CalendarConstants.MODE_SHOW_MONTH_AND_WEEK) {
int lineCount = DateUtil.getMonthViewLineCount(
calendarConfiguration.nowYear,
calendarConfiguration.nowMonth,
calendarConfiguration.nowYear!,
calendarConfiguration.nowMonth!,
calendarConfiguration.offset);
totalHeight = calendarConfiguration.itemSize * (lineCount) +
calendarConfiguration.verticalSpacing * (lineCount - 1);
totalHeight = calendarConfiguration.itemSize! * (lineCount) +
calendarConfiguration.verticalSpacing! * (lineCount - 1);
} else {
totalHeight = calendarConfiguration.itemSize;
}
@ -187,8 +187,8 @@ class CalendarProvider extends ChangeNotifier {
//退
void clearData() {
LogUtil.log(TAG: this.runtimeType, message: "CalendarProvider clearData");
CacheData.getInstance().clearData();
selectedDateList.clear();
CacheData.getInstance()!.clearData();
selectedDateList!.clear();
selectDateModel = null;
calendarConfiguration = null;
}

@ -13,74 +13,74 @@ import 'model/date_model.dart';
*/
class CalendarConfiguration {
//,MODE_SINGLE_SELECTMODE_MULTI_SELECT
CalendarSelectedMode selectMode;
CalendarSelectedMode? selectMode;
//
int showMode;
int? showMode;
//
int minYear;
int maxYear;
int? minYear;
int? maxYear;
//
int minYearMonth;
int maxYearMonth;
int? minYearMonth;
int? maxYearMonth;
//
int nowYear;
int nowMonth;
int? nowYear;
int? nowMonth;
//,
int minSelectYear;
int minSelectMonth;
int minSelectDay;
int? minSelectYear;
int? minSelectMonth;
int? minSelectDay;
int maxSelectYear;
int maxSelectMonth;
int maxSelectDay; //
int? maxSelectYear;
int? maxSelectMonth;
int? maxSelectDay; //
DateModel selectDateModel; //item
HashSet<DateModel> defaultSelectedDateList; //set
int maxMultiSelectCount; //
Map<DateModel, Object> extraDataMap = new Map(); //
DateModel? selectDateModel; //item
HashSet<DateModel?>? defaultSelectedDateList; //set
int? maxMultiSelectCount; //
Map<DateModel, Object>? extraDataMap = new Map(); //
/**
* UI
*/
double itemSize; ///7
double verticalSpacing; //item10
BoxDecoration boxDecoration; //
EdgeInsetsGeometry padding;
EdgeInsetsGeometry margin;
double? itemSize; ///7
double? verticalSpacing; //item10
BoxDecoration? boxDecoration; //
EdgeInsetsGeometry? padding;
EdgeInsetsGeometry? margin;
//
DayWidgetBuilder dayWidgetBuilder; //item
WeekBarItemWidgetBuilder weekBarItemWidgetBuilder; //weekbar
DayWidgetBuilder? dayWidgetBuilder; //item
WeekBarItemWidgetBuilder? weekBarItemWidgetBuilder; //weekbar
/**
*
*/
//
OnMonthChange monthChange; // ,multiMonthChanges
OnCalendarSelect calendarSelect; //
OnCalendarSelect unCalendarSelect; //
OnMultiSelectOutOfRange multiSelectOutOfRange; //
OnMultiSelectOutOfSize multiSelectOutOfSize; //
OnMonthChange? monthChange; // ,multiMonthChanges
OnCalendarSelect? calendarSelect; //
OnCalendarSelect? unCalendarSelect; //
late OnMultiSelectOutOfRange multiSelectOutOfRange; //
OnMultiSelectOutOfSize? multiSelectOutOfSize; //
ObserverList<OnMonthChange> monthChangeListeners =
ObserverList<OnMonthChange>? monthChangeListeners =
ObserverList<OnMonthChange>(); //
ObserverList<OnWeekChange> weekChangeListeners =
ObserverList<OnWeekChange>? weekChangeListeners =
ObserverList<OnWeekChange>(); //
/**
*
*/
List<DateModel> monthList = new List(); //list
List<DateModel> weekList = new List(); //list
PageController monthController; //controller
PageController weekController; //controller
DateModel minSelectDate;
DateModel maxSelectDate;
List<DateModel>? monthList = []; //list
List<DateModel>? weekList = [] ; //list
PageController? monthController; //controller
PageController? weekController; //controller
DateModel? minSelectDate;
DateModel? maxSelectDate;
/// first day offset
/// first day = (first day of month or week) + offset

@ -22,17 +22,17 @@ class CalendarController {
static const Map<DateModel, Object> EMPTY_MAP = {};
static const Duration DEFAULT_DURATION = const Duration(milliseconds: 500);
CalendarConfiguration calendarConfiguration;
late CalendarConfiguration calendarConfiguration;
CalendarProvider calendarProvider = CalendarProvider();
/**
*
*/
List<DateModel> monthList = new List(); //list
List<DateModel> weekList = new List(); //list
PageController monthController; //controller
PageController weekController; //controller
List<DateModel> monthList = []; //list
List<DateModel> weekList = []; //list
PageController? monthController; //controller
PageController? weekController; //controller
CalendarController(
{CalendarSelectedMode selectMode = CalendarSelectedMode.singleSelect,
@ -41,8 +41,8 @@ class CalendarController {
int maxYear = 2055,
int minYearMonth = 1,
int maxYearMonth = 12,
int nowYear,
int nowMonth,
int? nowYear,
int? nowMonth,
int minSelectYear = 1971,
int minSelectMonth = 1,
int minSelectDay = 1,
@ -50,7 +50,7 @@ class CalendarController {
int maxSelectMonth = 12,
int maxSelectDay = 30,
Set<DateTime> selectedDateTimeList = EMPTY_SET, //item
DateModel selectDateModel, //item
DateModel? selectDateModel, //item
int maxMultiSelectCount = 9999,
Map<DateModel, Object> extraDataMap = EMPTY_MAP,
int offset = 0 //
@ -84,8 +84,8 @@ class CalendarController {
selectDateModel: selectDateModel,
offset: offset);
calendarConfiguration.defaultSelectedDateList = new HashSet<DateModel>();
calendarConfiguration.defaultSelectedDateList
calendarConfiguration.defaultSelectedDateList = new HashSet<DateModel?>();
calendarConfiguration.defaultSelectedDateList!
.addAll(selectedDateTimeList.map((dateTime) {
return DateModel.fromDateTime(dateTime);
}).toSet());
@ -94,13 +94,13 @@ class CalendarController {
calendarProvider.selectedDateList =
calendarConfiguration.defaultSelectedDateList;
calendarConfiguration.minSelectDate = DateModel.fromDateTime(DateTime(
calendarConfiguration.minSelectYear,
calendarConfiguration.minSelectMonth,
calendarConfiguration.minSelectDay));
calendarConfiguration.minSelectYear!,
calendarConfiguration.minSelectMonth!,
calendarConfiguration.minSelectDay!));
calendarConfiguration.maxSelectDate = DateModel.fromDateTime(DateTime(
calendarConfiguration.maxSelectYear,
calendarConfiguration.maxSelectMonth,
calendarConfiguration.maxSelectDay));
calendarConfiguration.maxSelectYear!,
calendarConfiguration.maxSelectMonth!,
calendarConfiguration.maxSelectDay!));
LogUtil.log(
TAG: this.runtimeType,
@ -116,24 +116,24 @@ class CalendarController {
void _weekAndMonthViewChange(
int showMode,
) {
int minYear = calendarConfiguration.minYear;
int maxYear = calendarConfiguration.maxYear;
int minYearMonth = calendarConfiguration.minYearMonth;
int maxYearMonth = calendarConfiguration.maxYearMonth;
int nowYear = calendarConfiguration.nowYear;
int nowMonth = calendarConfiguration.nowMonth;
int? minYear = calendarConfiguration.minYear;
int? maxYear = calendarConfiguration.maxYear;
int? minYearMonth = calendarConfiguration.minYearMonth;
int? maxYearMonth = calendarConfiguration.maxYearMonth;
int? nowYear = calendarConfiguration.nowYear;
int? nowMonth = calendarConfiguration.nowMonth;
if (showMode != CalendarConstants.MODE_SHOW_ONLY_WEEK) {
//pageController,initialPage
int initialPage = 0;
int nowMonthIndex = 0;
monthList.clear();
for (int i = minYear; i <= maxYear; i++) {
for (int i = minYear!; i <= maxYear!; i++) {
for (int j = 1; j <= 12; j++) {
if (i == minYear && j < minYearMonth) {
if (i == minYear && j < minYearMonth!) {
continue;
}
if (i == maxYear && j > maxYearMonth) {
if (i == maxYear && j > maxYearMonth!) {
continue;
}
DateModel dateModel = new DateModel();
@ -166,13 +166,13 @@ class CalendarController {
nowYear = DateTime.now().year;
nowMonth = DateTime.now().month;
}
DateTime nowTime = new DateTime(nowYear, nowMonth, 15);
DateTime firstDayOfMonth = DateTime(minYear, minYearMonth, 1);
DateTime nowTime = new DateTime(nowYear!, nowMonth!, 15);
DateTime firstDayOfMonth = DateTime(minYear!, minYearMonth!, 1);
//
DateTime firstWeekDate =
firstDayOfMonth.add(Duration(days: -(firstDayOfMonth.weekday - 1)));
DateTime lastDay = DateTime(maxYear, maxYearMonth,
DateTime lastDay = DateTime(maxYear!, maxYearMonth!,
DateUtil.getMonthDaysCount(maxYear, maxYearMonth));
int temp = -1;
for (DateTime dateTime = firstWeekDate;
@ -210,13 +210,13 @@ class CalendarController {
//
void addWeekChangeListener(OnWeekChange listener) {
this.calendarConfiguration.weekChangeListeners.add(listener);
this.calendarConfiguration.weekChangeListeners!.add(listener);
}
//
void addMonthChangeListener(OnMonthChange listener) {
// this.calendarConfiguration.monthChange = listener;
this.calendarConfiguration.monthChangeListeners.add(listener);
this.calendarConfiguration.monthChangeListeners!.add(listener);
}
//
@ -263,7 +263,7 @@ class CalendarController {
//item
void changeDefaultSelectedDateList(Set<DateModel> defaultSelectedDateList) {
this.calendarConfiguration.defaultSelectedDateList =
defaultSelectedDateList;
defaultSelectedDateList as HashSet<DateModel?>?;
this.calendarProvider.generation.value++;
}
@ -280,13 +280,13 @@ class CalendarController {
if (calendarProvider.expandStatus.value == true) {
//
int currentIndex =
calendarProvider.calendarConfiguration.monthController.page.toInt();
calendarProvider.calendarConfiguration!.monthController!.page!.toInt();
if (currentIndex == 0) {
return false;
} else {
calendarProvider.calendarConfiguration.monthController
calendarProvider.calendarConfiguration!.monthController!
.previousPage(duration: DEFAULT_DURATION, curve: Curves.ease);
calendarProvider.calendarConfiguration.monthChangeListeners
calendarProvider.calendarConfiguration!.monthChangeListeners!
.forEach((listener) {
listener(monthList[currentIndex - 1].year,
monthList[currentIndex - 1].month);
@ -301,11 +301,11 @@ class CalendarController {
} else {
//
int currentIndex =
calendarProvider.calendarConfiguration.weekController.page.toInt();
calendarProvider.calendarConfiguration!.weekController!.page!.toInt();
if (currentIndex == 0) {
return false;
} else {
calendarProvider.calendarConfiguration.weekController
calendarProvider.calendarConfiguration!.weekController!
.previousPage(duration: DEFAULT_DURATION, curve: Curves.ease);
return true;
}
@ -321,13 +321,13 @@ class CalendarController {
if (calendarProvider.expandStatus.value == true) {
//
int currentIndex =
calendarProvider.calendarConfiguration.monthController.page.toInt();
calendarProvider.calendarConfiguration!.monthController!.page!.toInt();
if (monthList.length - 1 == currentIndex) {
return false;
} else {
calendarProvider.calendarConfiguration.monthController
calendarProvider.calendarConfiguration!.monthController!
.nextPage(duration: DEFAULT_DURATION, curve: Curves.ease);
calendarProvider.calendarConfiguration.monthChangeListeners
calendarProvider.calendarConfiguration!.monthChangeListeners!
.forEach((listener) {
listener(monthList[currentIndex + 1].year,
monthList[currentIndex + 1].month);
@ -343,11 +343,11 @@ class CalendarController {
} else {
//
int currentIndex =
calendarProvider.calendarConfiguration.weekController.page.toInt();
calendarProvider.calendarConfiguration!.weekController!.page!.toInt();
if (weekList.length - 1 == currentIndex) {
return false;
} else {
calendarProvider.calendarConfiguration.weekController
calendarProvider.calendarConfiguration!.weekController!
.nextPage(duration: DEFAULT_DURATION, curve: Curves.ease);
return true;
}
@ -366,15 +366,15 @@ class CalendarController {
if (targetPage == -1) {
return;
}
if (calendarProvider.calendarConfiguration.monthController.hasClients ==
if (calendarProvider.calendarConfiguration!.monthController!.hasClients ==
false) {
return;
}
if (needAnimation) {
calendarProvider.calendarConfiguration.monthController
calendarProvider.calendarConfiguration!.monthController!
.animateToPage(targetPage, duration: duration, curve: curve);
} else {
calendarProvider.calendarConfiguration.monthController
calendarProvider.calendarConfiguration!.monthController!
.jumpToPage(targetPage);
}
} else {
@ -389,15 +389,15 @@ class CalendarController {
return;
}
}
if (calendarProvider.calendarConfiguration.weekController.hasClients ==
if (calendarProvider.calendarConfiguration!.weekController!.hasClients ==
false) {
return;
}
if (needAnimation) {
calendarProvider.calendarConfiguration.weekController
calendarProvider.calendarConfiguration!.weekController!
.animateToPage(targetPage, duration: duration, curve: curve);
} else {
calendarProvider.calendarConfiguration.weekController
calendarProvider.calendarConfiguration!.weekController!
.jumpToPage(targetPage);
}
}
@ -409,7 +409,7 @@ class CalendarController {
Duration duration = const Duration(milliseconds: 500),
Curve curve = Curves.ease}) {
DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page
.calendarConfiguration!.monthController!.page!
.toInt() +
12]
.getDateTime();
@ -424,7 +424,7 @@ class CalendarController {
Duration duration = const Duration(milliseconds: 500),
Curve curve = Curves.ease}) {
DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page
.calendarConfiguration!.monthController!.page!
.toInt() -
12]
.getDateTime();
@ -440,30 +440,30 @@ class CalendarController {
Curve curve = Curves.ease}) {
// indexweekController
if (calendarProvider.expandStatus.value == false) {
int currentMonth = weekList[calendarProvider
.calendarConfiguration.weekController.page
int? currentMonth = weekList[calendarProvider
.calendarConfiguration!.weekController!.page!
.toInt()]
.month;
for (int i = calendarProvider.calendarConfiguration.weekController.page
for (int i = calendarProvider.calendarConfiguration!.weekController!.page!
.toInt();
i < weekList.length;
i++) {
if (weekList[i].month != currentMonth) {
calendarProvider.calendarConfiguration.weekController.jumpToPage(i);
calendarProvider.calendarConfiguration!.weekController!.jumpToPage(i);
break;
}
}
return;
}
if ((calendarProvider.calendarConfiguration.monthController.page.toInt() +
if ((calendarProvider.calendarConfiguration!.monthController!.page!.toInt() +
1) >=
monthList.length) {
LogUtil.log(TAG: this.runtimeType, message: "moveToNextMonth当前是最后一个月份");
return;
}
DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page
.calendarConfiguration!.monthController!.page!
.toInt() +
1]
.getDateTime();
@ -479,30 +479,30 @@ class CalendarController {
Curve curve = Curves.ease}) {
// indexweekController
if (calendarProvider.expandStatus.value == false) {
int currentMonth = weekList[weekController.page.toInt()].month;
for (int i = calendarProvider.calendarConfiguration.weekController.page
int? currentMonth = weekList[weekController!.page!.toInt()].month;
for (int i = calendarProvider.calendarConfiguration!.weekController!.page!
.toInt();
i >= 0;
i--) {
if (weekList[i].month != currentMonth &&
weekList[i].isAfter(DateModel.fromDateTime(DateTime(
calendarConfiguration.minYear,
calendarConfiguration.minYearMonth)))) {
calendarProvider.calendarConfiguration.weekController.jumpToPage(i);
calendarConfiguration.minYear!,
calendarConfiguration.minYearMonth!)))) {
calendarProvider.calendarConfiguration!.weekController!.jumpToPage(i);
break;
}
}
return;
}
if ((calendarProvider.calendarConfiguration.monthController.page.toInt()) ==
if ((calendarProvider.calendarConfiguration!.monthController!.page!.toInt()) ==
0) {
LogUtil.log(
TAG: this.runtimeType, message: "moveToPreviousMonth当前是第一个月份");
return;
}
DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page
.calendarConfiguration!.monthController!.page!
.toInt() -
1]
.getDateTime();
@ -513,16 +513,16 @@ class CalendarController {
//
DateModel getCurrentMonth() {
return monthList[monthController.page.toInt()];
return monthList[monthController!.page!.toInt()];
}
//,
Set<DateModel> getMultiSelectCalendar() {
Set<DateModel?>? getMultiSelectCalendar() {
return calendarProvider.selectedDateList;
}
//
DateModel getSingleSelectCalendar() {
DateModel? getSingleSelectCalendar() {
return calendarProvider.selectDateModel;
}
@ -571,21 +571,21 @@ bool defaultInRange(DateModel dateModel) {
/**
*
*/
typedef void OnWeekChange(int year, int month);
typedef void OnWeekChange(int? year, int? month);
/**
*
*/
typedef void OnMonthChange(int year, int month);
typedef void OnMonthChange(int? year, int? month);
/**
*
*/
typedef void OnCalendarSelect(DateModel dateModel);
typedef void OnCalendarSelect(DateModel? dateModel);
/**
*
*/
typedef void OnCalendarUnSelect(DateModel dateModel);
typedef void OnCalendarUnSelect(DateModel? dateModel);
/**
*

@ -5,11 +5,11 @@ import 'package:flutter_custom_calendar/utils/lunar_util.dart';
*
*/
class DateModel {
int year;
int month;
int? year;
int? month;
int day = 1;
List<int> lunar = List(3);
List<int?> lunar = [];
// List<int> get lunar {
// if (lunar?.isNotEmpty == false) {
@ -32,43 +32,43 @@ class DateModel {
}
//24
String get solarTerm => LunarUtil.getSolarTerm(year, month, day);
String get solarTerm => LunarUtil.getSolarTerm(year, month!, day);
//
String get gregorianFestival {
String result = LunarUtil.gregorianFestival(month, day);
String result = LunarUtil.gregorianFestival(month!, day);
if (result?.isNotEmpty == true) {
return result;
}
return LunarUtil.getSpecialFestival(year, month, day);
return LunarUtil.getSpecialFestival(year, month!, day);
}
//
String get traditionFestival =>
LunarUtil.getTraditionFestival(lunarYear, lunarMonth, lunarDay);
bool isCurrentMonth; //
bool? isCurrentMonth; //
Object extraData; //
Object? extraData; //
bool isInRange = false; //,
bool isSelected; //
bool? isSelected; //
bool isCanClick =
true; //todo:truefalse
//
bool get isWeekend => DateUtil.isWeekend(getDateTime());
//
bool get isLeapYear => DateUtil.isLeapYear(year);
bool get isLeapYear => DateUtil.isLeapYear(year!);
//
bool get isCurrentDay => DateUtil.isCurrentDay(year, month, day);
int get lunarYear => lunar[0];
int? get lunarYear => lunar[0];
int get lunarMonth => lunar[1];
int? get lunarMonth => lunar[1];
int get lunarDay => lunar[2];
int? get lunarDay => lunar[2];
@override
String toString() {
@ -77,7 +77,7 @@ class DateModel {
//DateTime
DateTime getDateTime() {
return new DateTime(year, month, day);
return new DateTime(year!, month!, day);
}
//DateTimemodel
@ -86,8 +86,8 @@ class DateModel {
..year = dateTime.year
..month = dateTime.month
..day = dateTime.day;
List<int> lunar =
LunarUtil.solarToLunar(dateModel.year, dateModel.month, dateModel.day);
List<int?> lunar =
LunarUtil.solarToLunar(dateModel.year!, dateModel.month!, dateModel.day);
dateModel.lunar = lunar;
// get,

@ -15,7 +15,7 @@ class LogUtil {
* TAG:
* message+
*/
static void log({@required dynamic TAG, String message = ""}) {
static void log({required dynamic TAG, String message = ""}) {
if (_enableLog && kDebugMode) {
debugPrint("flutter_custom_calendar------$TAG------>$message");
}

@ -31,7 +31,7 @@ class DateUtil {
* @param month
* @return
*/
static int getMonthDaysCount(int year, int month) {
static int getMonthDaysCount(int? year, int? month) {
int count = 0;
//
if (month == 1 ||
@ -51,7 +51,7 @@ class DateUtil {
//
if (month == 2) {
if (isLeapYear(year)) {
if (isLeapYear(year!)) {
count = 29;
} else {
count = 28;
@ -63,7 +63,7 @@ class DateUtil {
/**
*
*/
static bool isCurrentDay(int year, int month, int day) {
static bool isCurrentDay(int? year, int? month, int day) {
DateTime now = DateTime.now();
return now.year == year && now.month == month && now.day == day;
}
@ -110,9 +110,9 @@ class DateUtil {
static List<DateModel> initCalendarForMonthView(
int year, int month, DateTime currentDate, int weekStart,
{DateModel minSelectDate,
DateModel maxSelectDate,
Map<DateModel, Object> extraDataMap,
{DateModel? minSelectDate,
DateModel? maxSelectDate,
Map<DateModel, Object>? extraDataMap,
int offset = 0}) {
print('initCalendarForMonthView start');
weekStart = DateTime.monday;
@ -127,7 +127,7 @@ class DateUtil {
message:
"initCalendarForMonthView:$year$month月,有$monthDayCount天,第一天的index为${mPreDiff}");
List<DateModel> result = new List();
List<DateModel> result = [];
int size = 42;
@ -161,15 +161,15 @@ class DateUtil {
}
//
if (dateModel.getDateTime().isAfter(minSelectDate.getDateTime()) &&
dateModel.getDateTime().isBefore(maxSelectDate.getDateTime())) {
if (dateModel.getDateTime().isAfter(minSelectDate!.getDateTime()) &&
dateModel.getDateTime().isBefore(maxSelectDate!.getDateTime())) {
dateModel.isInRange = true;
} else {
dateModel.isInRange = false;
}
//model
if (extraDataMap?.isNotEmpty == true) {
if (extraDataMap.containsKey(dateModel)) {
if (extraDataMap!.containsKey(dateModel)) {
dateModel.extraData = extraDataMap[dateModel];
} else {
dateModel.extraData = null;
@ -206,12 +206,12 @@ class DateUtil {
* 7item
*/
static List<DateModel> initCalendarForWeekView(
int year, int month, DateTime currentDate, int weekStart,
{DateModel minSelectDate,
DateModel maxSelectDate,
Map<DateModel, Object> extraDataMap,
int? year, int? month, DateTime currentDate, int weekStart,
{DateModel? minSelectDate,
DateModel? maxSelectDate,
Map<DateModel, Object>? extraDataMap,
int offset = 0}) {
List<DateModel> items = List();
List<DateModel> items = [];
int weekDay = currentDate.weekday + offset;
@ -223,8 +223,8 @@ class DateUtil {
DateModel.fromDateTime(firstDayOfWeek.add(Duration(days: i)));
//
if (dateModel.getDateTime().isAfter(minSelectDate.getDateTime()) &&
dateModel.getDateTime().isBefore(maxSelectDate.getDateTime())) {
if (dateModel.getDateTime().isAfter(minSelectDate!.getDateTime()) &&
dateModel.getDateTime().isBefore(maxSelectDate!.getDateTime())) {
dateModel.isInRange = true;
} else {
dateModel.isInRange = false;
@ -237,7 +237,7 @@ class DateUtil {
//model
if (extraDataMap?.isNotEmpty == true) {
if (extraDataMap.containsKey(dateModel)) {
if (extraDataMap!.containsKey(dateModel)) {
dateModel.extraData = extraDataMap[dateModel];
}
}

@ -464,7 +464,7 @@ class LunarUtil {
////**
///* 24
///*/
static final Map<int, List<String>> SOLAR_TERMS = new Map();
static final Map<int?, List<String?>> SOLAR_TERMS = new Map();
////**
///*
@ -506,7 +506,7 @@ class LunarUtil {
/**
* ,
*/
static final Map<int, List<String>> SPECIAL_FESTIVAL = new Map();
static final Map<int?, List<String?>> SPECIAL_FESTIVAL = new Map();
/**
*
@ -756,15 +756,15 @@ class LunarUtil {
* @param calendar calendar
*/
static void setupLunarCalendar(DateModel dateModel) {
int year = dateModel.year;
int month = dateModel.month;
int? year = dateModel.year;
int? month = dateModel.month;
int day = dateModel.day;
// dateModel.isWeekend = DateUtil.isWeekend(new DateTime(year, month, day));
// dateModel.isLeapYear = DateUtil.isLeapYear(year);
// dateModel.isCurrentDay = DateUtil.isCurrentDay(year, month, day);
List<int> lunar = LunarUtil.solarToLunar(2020, 2, day);
List<int?> lunar = LunarUtil.solarToLunar(2020, 2, day);
// dateModel.lunarYear = (lunar[0]);
// dateModel.lunarMonth = (lunar[1]);
@ -808,8 +808,8 @@ class LunarUtil {
* @param day
* @return [0] [1] [2] [3] 0 false : 1 true
*/
static List<int> solarToLunar(int year, int month, int day) {
List<int> lunarInt = new List(4);
static List<int?> solarToLunar(int year, int month, int day) {
List<int?> lunarInt = [];
int index = year - SOLAR[0];
int data = (year << 9) | (month << 5) | (day);
int solar11;
@ -878,15 +878,15 @@ class LunarUtil {
* @param day
* @return 24
*/
static String getSolarTerm(int year, int month, int day) {
static String getSolarTerm(int? year, int month, int day) {
if (!SOLAR_TERMS.containsKey(year)) {
SOLAR_TERMS.addAll({year: SolarTermUtil.getSolarTerms(year)});
SOLAR_TERMS.addAll({year: SolarTermUtil.getSolarTerms(year!)});
}
List<String> solarTerm = SOLAR_TERMS[year];
List<String?> solarTerm = SOLAR_TERMS[year]!;
String text = "${year}" + getString(month, day);
String solar = "";
for (String solarTermName in solarTerm) {
if (solarTermName.contains(text)) {
for (String? solarTermName in solarTerm) {
if (solarTermName!.contains(text)) {
solar = solarTermName.replaceAll(text, "");
break;
}
@ -902,11 +902,11 @@ class LunarUtil {
* @param leap 1==
* @return
*/
static String numToChinese(int month, int day, int leap) {
static String numToChinese(int? month, int? day, int? leap) {
if (day == 1) {
return numToChineseMonth(month, leap);
}
return CalendarConstants.LUNAR_DAY_TEXT[day - 1];
return CalendarConstants.LUNAR_DAY_TEXT[day! - 1];
}
/**
@ -916,11 +916,11 @@ class LunarUtil {
* @param leap 1==
* @return
*/
static String numToChineseMonth(int month, int leap) {
static String numToChineseMonth(int? month, int? leap) {
if (leap == 1) {
return "" + CalendarConstants.LUNAR_MONTH_TEXT[month - 1];
return "" + CalendarConstants.LUNAR_MONTH_TEXT[month! - 1];
}
return CalendarConstants.LUNAR_MONTH_TEXT[month - 1];
return CalendarConstants.LUNAR_MONTH_TEXT[month! - 1];
}
static String getString(int month, int day) {
@ -955,14 +955,14 @@ class LunarUtil {
* @param day
* @return
*/
static String getTraditionFestival(int year, int month, int day) {
static String getTraditionFestival(int? year, int? month, int? day) {
if (month == 12) {
int count = daysInLunarMonth(year, month);
int count = daysInLunarMonth(year!, month!);
if (day == count) {
return TRADITION_FESTIVAL_STR[0]; //
}
}
String text = getString(month, day);
String text = getString(month!, day!);
String festivalStr = "";
for (String festival in TRADITION_FESTIVAL_STR) {
if (festival.contains(text)) {
@ -997,15 +997,15 @@ class LunarUtil {
* @param day day
* @return 西
*/
static String getSpecialFestival(int year, int month, int day) {
static String getSpecialFestival(int? year, int month, int day) {
if (!SPECIAL_FESTIVAL.containsKey(year)) {
SPECIAL_FESTIVAL.addAll({year: getSpecialFestivals(year)});
SPECIAL_FESTIVAL.addAll({year: getSpecialFestivals(year!)});
}
List<String> specialFestivals = SPECIAL_FESTIVAL[year];
List<String?> specialFestivals = SPECIAL_FESTIVAL[year]!;
String text = "$year" + getString(month, day);
String solar = "";
for (String special in specialFestivals) {
if (special.contains(text)) {
for (String? special in specialFestivals) {
if (special!.contains(text)) {
solar = special.replaceAll(text, "");
break;
}
@ -1020,8 +1020,8 @@ class LunarUtil {
* @param year
* @return
*/
static List<String> getSpecialFestivals(int year) {
List<String> festivals = new List(3);
static List<String?> getSpecialFestivals(int year) {
List<String?> festivals = [];
DateTime dateTime = new DateTime(year, 5, 1);
//

@ -15,7 +15,7 @@ class System {
// dest:
// destPos:
// length:
static void arraycopy(List<String> src, int srcPos, List<String> dest,
static void arraycopy(List<String?> src, int srcPos, List<String?> dest,
int destPos, int length) {
List.copyRange(dest, destPos, src, srcPos, srcPos+length);
}

@ -247,8 +247,8 @@ class SolarTermUtil {
* @return , UTC=1UTC
*/
static double toJulian(Time time, bool UTC) {
double y = time.year; //
double m = time.month;
double y = time.year!; //
double m = time.month!;
double n = 0;
if (m <= 2) {
@ -256,7 +256,7 @@ class SolarTermUtil {
y--;
}
if (time.year * 372 + time.month * 31 + time.day >= 588829) {
if (time.year! * 372 + time.month! * 31 + time.day >= 588829) {
// 1582*372+10*31+15
n = doubleFloor(y / 100);
n = 2 - n + doubleFloor(n / 4); //
@ -293,13 +293,13 @@ class SolarTermUtil {
}
A += 1524; // 42
time.year = doubleFloor((A - 122.1) / 365.25); //
D = A - doubleFloor(365.25 * time.year); //
D = A - doubleFloor(365.25 * time.year!); //
time.month = doubleFloor(D / 30.6001); //
time.day = D - doubleFloor(time.month * 30.6001); //
time.day = D - doubleFloor(time.month! * 30.6001); //
time.year -= 4716;
time.month--;
if (time.month > 12) time.month -= 12;
if (time.month <= 2) time.year++;
if (time.month! > 12) time.month -= 12;
if (time.month! <= 2) time.year++;
//
F *= 24;
time.hour = doubleFloor(F);
@ -318,14 +318,14 @@ class SolarTermUtil {
* @param jd jd
* @param zb zb
*/
static void precession(double jd, List<double> zb) {
static void precession(double jd, List<double?> zb) {
int i;
double t = 1, v = 0, t1 = jd / 365250;
for (i = 1; i < 8; i++) {
t *= t1;
v += H_C_ANGLE_TABLE[i] * t;
}
zb[0] = rad2mrad(zb[0] + (v + 2.9965 * t1) / SECOND_PER_RAD);
zb[0] = rad2mrad(zb[0]! + (v + 2.9965 * t1) / SECOND_PER_RAD);
}
/**
@ -2001,7 +2001,7 @@ class SolarTermUtil {
*/
static List<double> earCal(double jd) {
EnnT = jd / 365250;
List<double> llr = new List(3);
List<double> llr = [];
double t1 = EnnT, t2 = t1 * t1, t3 = t2 * t1, t4 = t3 * t1, t5 = t4 * t1;
llr[0] = Enn(E10) +
Enn(E11) * t1 +
@ -2042,16 +2042,16 @@ class SolarTermUtil {
* @param julian
* @return return
*/
static List<double> moonCoord(double julian) {
static List<double?> moonCoord(double julian) {
MnnT = julian / 36525;
double t1 = MnnT, t2 = t1 * t1, t3 = t2 * t1, t4 = t3 * t1;
List<double> llr = new List(3);
List<double?> llr = [];
llr[0] = (Mnn(M10) + Mnn(M11) * t1 + Mnn(M12) * t2) / SECOND_PER_RAD;
llr[1] = (Mnn(M20) + Mnn(M21) * t1) / SECOND_PER_RAD;
llr[2] = (Mnn(M30) + Mnn(M31) * t1) * 0.999999949827;
llr[0] =
llr[0] + M1n[0] + M1n[1] * t1 + M1n[2] * t2 + M1n[3] * t3 + M1n[4] * t4;
llr[0] = rad2mrad(llr[0]); // Date()
llr[0]! + M1n[0] + M1n[1] * t1 + M1n[2] * t2 + M1n[3] * t3 + M1n[4] * t4;
llr[0] = rad2mrad(llr[0]!); // Date()
precession(julian, llr); //
return llr;
}
@ -2074,8 +2074,8 @@ class SolarTermUtil {
sun[0] += d.Lon; //
return rad2mrad(angle - sun[0]);
}
List<double> moon = moonCoord(time); //
return rad2mrad(angle - (moon[0] - sun[0]));
List<double?> moon = moonCoord(time); //
return rad2mrad(angle - (moon[0]! - sun[0]));
}
/**
@ -2123,10 +2123,10 @@ class SolarTermUtil {
* @return 24
*/
static List<String> getSolarTerms(int year) {
List<String> solarTerms = new List(24);
List<String> preOffset = getSolarTermsPreOffset(year - 1);
List<String> nextOffset = getSolarTermsNextOffset(year - 1);
static List<String?> getSolarTerms(int year) {
List<String?> solarTerms = [];
List<String?> preOffset = getSolarTermsPreOffset(year - 1);
List<String?> nextOffset = getSolarTermsNextOffset(year - 1);
System.arraycopy(preOffset, 0, solarTerms, 0, preOffset.length);
System.arraycopy(nextOffset, 0, solarTerms, 22, nextOffset.length);
@ -2147,8 +2147,8 @@ class SolarTermUtil {
* @param year 2018242017
* @return
*/
static List<String> getSolarTermsPreOffset(int year) {
List<String> solarTerms = new List(3);
static List<String?> getSolarTermsPreOffset(int year) {
List<String?> solarTerms = [];
double jd = 365.2422 * (year - 2000), q;
for (int i = 21; i < 24; i++) {
q = getTimeFromAngle(jd + i * 15.2, i * 15.toDouble(), 0);
@ -2165,8 +2165,8 @@ class SolarTermUtil {
* @param year 2018242017
* @return
*/
static List<String> getSolarTermsNextOffset(int year) {
List<String> solarTerms = new List(2);
static List<String?> getSolarTermsNextOffset(int year) {
List<String?> solarTerms = [];
double jd = 365.2422 * (year - 2000), q;
for (int i = 19; i < 21; i++) {
q = getTimeFromAngle(jd + i * 15.2, i * 15.toDouble(), 0);
@ -2185,21 +2185,21 @@ class Nutation {
/**
*
*/
double Lon;
late double Lon;
/**
*
*/
double Obl;
late double Obl;
}
class Time {
double year;
double month;
double day;
double hour;
double minute;
double second;
late double year;
late double month;
late double day;
late double hour;
late double minute;
late double second;
String toString() {
return doubleToString(year) + doubleToString(month) + doubleToString(day);

@ -20,7 +20,7 @@ abstract class BaseCustomDayWidget extends StatelessWidget {
child: new CustomPaint(
painter:
//isSelecteditem
dateModel.isSelected
dateModel.isSelected!
? new CustomDayWidgetPainter(dateModel,
drawDayWidget: drawSelected)
: new CustomDayWidgetPainter(dateModel,
@ -37,15 +37,15 @@ abstract class BaseCustomDayWidget extends StatelessWidget {
class CustomDayWidgetPainter extends CustomPainter {
DateModel dateModel;
DrawDayWidget drawDayWidget; //
DrawDayWidget? drawDayWidget; //
CustomDayWidgetPainter(this.dateModel, {this.drawDayWidget});
Paint textPaint;
Paint? textPaint;
@override
void paint(Canvas canvas, Size size) {
drawDayWidget(dateModel, canvas, size);
drawDayWidget!(dateModel, canvas, size);
}
@override
@ -64,7 +64,7 @@ abstract class BaseCombineDayWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return dateModel.isSelected
return dateModel.isSelected!
? getSelectedWidget(dateModel)
: getNormalWidget(dateModel);
}

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
*
*/
abstract class BaseWeekBar extends StatelessWidget {
const BaseWeekBar({Key key}) : super(key: key);
const BaseWeekBar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -19,14 +19,14 @@ import 'month_view_pager.dart';
//StatefulWidgetStatelessWidget
class CalendarViewWidget extends StatefulWidget {
//
final BoxDecoration boxDecoration;
final BoxDecoration? boxDecoration;
//paddingmargin
final EdgeInsetsGeometry padding;
final EdgeInsetsGeometry margin;
///7
final double itemSize;
final double? itemSize;
//item10
final double verticalSpacing;
@ -39,10 +39,10 @@ class CalendarViewWidget extends StatefulWidget {
final CalendarController calendarController;
CalendarViewWidget(
{Key key,
{Key? key,
this.dayWidgetBuilder = defaultCustomDayWidget,
this.weekBarItemWidgetBuilder = defaultWeekBarWidget,
@required this.calendarController,
required this.calendarController,
this.boxDecoration,
this.padding = EdgeInsets.zero,
this.margin = EdgeInsets.zero,
@ -102,12 +102,12 @@ class CalendarContainer extends StatefulWidget {
class CalendarContainerState extends State<CalendarContainer>
with SingleTickerProviderStateMixin {
double itemHeight;
double totalHeight;
double? itemHeight;
double? totalHeight;
bool expand;
late bool expand;
CalendarProvider calendarProvider;
late CalendarProvider calendarProvider;
List<Widget> widgets = [];
@ -119,15 +119,15 @@ class CalendarContainerState extends State<CalendarContainer>
calendarProvider = Provider.of<CalendarProvider>(context, listen: false);
expand = calendarProvider.expandStatus.value;
if (calendarProvider.calendarConfiguration.showMode ==
if (calendarProvider.calendarConfiguration!.showMode ==
CalendarConstants.MODE_SHOW_ONLY_WEEK) {
widgets.add(const WeekViewPager());
} else if (calendarProvider.calendarConfiguration.showMode ==
} else if (calendarProvider.calendarConfiguration!.showMode ==
CalendarConstants.MODE_SHOW_WEEK_AND_MONTH) {
widgets.add(const MonthViewPager());
widgets.add(const WeekViewPager());
index = 1;
} else if (calendarProvider.calendarConfiguration.showMode ==
} else if (calendarProvider.calendarConfiguration!.showMode ==
CalendarConstants.MODE_SHOW_MONTH_AND_WEEK) {
widgets.add(const MonthViewPager());
widgets.add(const WeekViewPager());
@ -139,9 +139,9 @@ class CalendarContainerState extends State<CalendarContainer>
expand = calendarProvider.expandStatus.value;
//
if (calendarProvider.calendarConfiguration.showMode ==
if (calendarProvider.calendarConfiguration!.showMode ==
CalendarConstants.MODE_SHOW_WEEK_AND_MONTH ||
calendarProvider.calendarConfiguration.showMode ==
calendarProvider.calendarConfiguration!.showMode ==
CalendarConstants.MODE_SHOW_MONTH_AND_WEEK) {
calendarProvider.expandStatus.addListener(() {
setState(() {
@ -151,12 +151,12 @@ class CalendarContainerState extends State<CalendarContainer>
if (expand) {
index = 0;
//
calendarProvider.calendarConfiguration.weekController
calendarProvider.calendarConfiguration!.weekController!
.jumpToPage(calendarProvider.monthPageIndex);
} else {
index = 1;
//
calendarProvider.calendarConfiguration.weekController
calendarProvider.calendarConfiguration!.weekController!
.jumpToPage(calendarProvider.weekPageIndex);
}
});
@ -166,19 +166,19 @@ class CalendarContainerState extends State<CalendarContainer>
}
widget.calendarController.addMonthChangeListener((year, month) {
if (widget.calendarController.calendarProvider.calendarConfiguration
if (widget.calendarController.calendarProvider.calendarConfiguration!
.showMode !=
CalendarConstants.MODE_SHOW_ONLY_WEEK) {
//setState使
int lineCount = DateUtil.getMonthViewLineCount(year, month,
int lineCount = DateUtil.getMonthViewLineCount(year!, month!,
widget.calendarController.calendarConfiguration.offset);
double newHeight = itemHeight * (lineCount) +
calendarProvider.calendarConfiguration.verticalSpacing *
double newHeight = itemHeight! * (lineCount) +
calendarProvider.calendarConfiguration!.verticalSpacing! *
(lineCount - 1);
LogUtil.log(
TAG: this.runtimeType,
message: "totalHeight:$totalHeight,newHeight:$newHeight");
if (totalHeight.toInt() != newHeight.toInt()) {
if (totalHeight!.toInt() != newHeight.toInt()) {
LogUtil.log(TAG: this.runtimeType, message: "月份视图高度发生变化");
setState(() {
totalHeight = newHeight;
@ -187,7 +187,7 @@ class CalendarContainerState extends State<CalendarContainer>
}
});
itemHeight = calendarProvider.calendarConfiguration.itemSize;
itemHeight = calendarProvider.calendarConfiguration!.itemSize;
totalHeight = calendarProvider.totalHeight;
}
@ -200,7 +200,7 @@ class CalendarContainerState extends State<CalendarContainer>
Widget build(BuildContext context) {
LogUtil.log(TAG: this.runtimeType, message: "CalendarContainerState build");
return Container(
width: itemHeight * 7,
width: itemHeight! * 7,
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
@ -208,7 +208,7 @@ class CalendarContainerState extends State<CalendarContainer>
/**
* constsetStateview
*/
calendarProvider.calendarConfiguration.weekBarItemWidgetBuilder(),
calendarProvider.calendarConfiguration!.weekBarItemWidgetBuilder!(),
AnimatedContainer(
duration: Duration(milliseconds: 500),
height: expand ? totalHeight : itemHeight,

@ -40,7 +40,7 @@ import 'base_week_bar.dart';
//}
class DefaultWeekBar extends BaseWeekBar {
const DefaultWeekBar({Key key}) : super(key: key);
const DefaultWeekBar({Key? key}) : super(key: key);
@override
Widget getWeekBarItem(int index) {

@ -11,16 +11,16 @@ import 'package:provider/provider.dart';
*
*/
class MonthView extends StatefulWidget {
final int year;
final int month;
final int day;
final int? year;
final int? month;
final int? day;
final CalendarConfiguration configuration;
final CalendarConfiguration? configuration;
const MonthView({
Key key,
@required this.year,
@required this.month,
Key? key,
required this.year,
required this.month,
this.day,
this.configuration,
}) : super(key: key);
@ -31,37 +31,37 @@ class MonthView extends StatefulWidget {
class _MonthViewState extends State<MonthView>
with AutomaticKeepAliveClientMixin {
List<DateModel> items = List();
List<DateModel>? items =[];
int lineCount;
Map<DateModel, Object> extraDataMap; //
int? lineCount;
Map<DateModel, Object>? extraDataMap; //
@override
void initState() {
super.initState();
extraDataMap = widget.configuration.extraDataMap;
extraDataMap = widget.configuration!.extraDataMap;
DateModel firstDayOfMonth =
DateModel.fromDateTime(DateTime(widget.year, widget.month, 1));
if (CacheData.getInstance().monthListCache[firstDayOfMonth]?.isNotEmpty ==
DateModel.fromDateTime(DateTime(widget.year!, widget.month!, 1));
if (CacheData.getInstance()!.monthListCache[firstDayOfMonth]?.isNotEmpty ==
true) {
LogUtil.log(TAG: this.runtimeType, message: "缓存中有数据");
items = CacheData.getInstance().monthListCache[firstDayOfMonth];
items = CacheData.getInstance()!.monthListCache[firstDayOfMonth];
} else {
LogUtil.log(TAG: this.runtimeType, message: "缓存中无数据");
getItems().then((_) {
CacheData.getInstance().monthListCache[firstDayOfMonth] = items;
CacheData.getInstance()!.monthListCache[firstDayOfMonth] = items;
});
}
lineCount = DateUtil.getMonthViewLineCount(
widget.year, widget.month, widget.configuration.offset);
widget.year!, widget.month!, widget.configuration!.offset);
//,generation
WidgetsBinding.instance.addPostFrameCallback((callback) {
WidgetsBinding.instance!.addPostFrameCallback((callback) {
Provider.of<CalendarProvider>(context, listen: false)
.generation
.addListener(() async {
extraDataMap = widget.configuration.extraDataMap;
extraDataMap = widget.configuration!.extraDataMap;
await getItems();
});
});
@ -71,10 +71,10 @@ class _MonthViewState extends State<MonthView>
items = await compute(initCalendarForMonthView, {
'year': widget.year,
'month': widget.month,
'minSelectDate': widget.configuration.minSelectDate,
'maxSelectDate': widget.configuration.maxSelectDate,
'minSelectDate': widget.configuration!.minSelectDate,
'maxSelectDate': widget.configuration!.maxSelectDate,
'extraDataMap': extraDataMap,
'offset': widget.configuration.offset
'offset': widget.configuration!.offset
});
setState(() {});
}
@ -96,23 +96,23 @@ class _MonthViewState extends State<MonthView>
CalendarProvider calendarProvider =
Provider.of<CalendarProvider>(context, listen: false);
CalendarConfiguration configuration =
calendarProvider.calendarConfiguration;
calendarProvider.calendarConfiguration!;
return new GridView.builder(
addAutomaticKeepAlives: true,
padding: EdgeInsets.zero,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7, mainAxisSpacing: configuration.verticalSpacing),
itemCount: items.isEmpty ? 0 : items.length,
crossAxisCount: 7, mainAxisSpacing: configuration.verticalSpacing!),
itemCount: items!.isEmpty ? 0 : items!.length,
itemBuilder: (context, index) {
DateModel dateModel = items[index];
DateModel dateModel = items![index];
//
switch (configuration.selectMode) {
///
case CalendarSelectedMode.multiSelect:
if (calendarProvider.selectedDateList.contains(dateModel)) {
if (calendarProvider.selectedDateList!.contains(dateModel)) {
dateModel.isSelected = true;
} else {
dateModel.isSelected = false;
@ -122,7 +122,7 @@ class _MonthViewState extends State<MonthView>
///
case CalendarSelectedMode.mutltiStartToEndSelect:
if (calendarProvider.selectedDateList.contains(dateModel)) {
if (calendarProvider.selectedDateList!.contains(dateModel)) {
dateModel.isSelected = true;
} else {
dateModel.isSelected = false;
@ -162,10 +162,10 @@ class _MonthViewState extends State<MonthView>
* itemitem
*/
class ItemContainer extends StatefulWidget {
final DateModel dateModel;
final DateModel? dateModel;
final GestureTapCallback clickCall;
const ItemContainer({Key key, this.dateModel, this.clickCall})
final GestureTapCallback? clickCall;
const ItemContainer({Key? key, this.dateModel, this.clickCall})
: super(key: key);
@override
@ -173,17 +173,17 @@ class ItemContainer extends StatefulWidget {
}
class ItemContainerState extends State<ItemContainer> {
DateModel dateModel;
CalendarConfiguration configuration;
CalendarProvider calendarProvider;
DateModel? dateModel;
CalendarConfiguration? configuration;
late CalendarProvider calendarProvider;
ValueNotifier<bool> isSelected;
ValueNotifier<bool?>? isSelected;
@override
void initState() {
super.initState();
dateModel = widget.dateModel;
isSelected = ValueNotifier(dateModel.isSelected);
isSelected = ValueNotifier(dateModel!.isSelected);
}
/**
@ -198,24 +198,24 @@ class ItemContainerState extends State<ItemContainer> {
v ??= false;
if (mounted) {
setState(() {
dateModel.isSelected = v;
dateModel!.isSelected = v;
});
if (widget.clickCall != null) {
widget.clickCall();
widget.clickCall!();
}
}
}
void _notifiCationUnCalendarSelect(DateModel element) {
if (configuration.unCalendarSelect != null) {
configuration.unCalendarSelect(element);
void _notifiCationUnCalendarSelect(DateModel? element) {
if (configuration!.unCalendarSelect != null) {
configuration!.unCalendarSelect!(element);
}
}
void _notifiCationCalendarSelect(DateModel element) {
if (configuration.calendarSelect != null) {
configuration.calendarSelect(element);
void _notifiCationCalendarSelect(DateModel? element) {
if (configuration!.calendarSelect != null) {
configuration!.calendarSelect!(element);
}
}
@ -234,33 +234,33 @@ class ItemContainerState extends State<ItemContainer> {
message: "GestureDetector onTap: $dateModel}");
//
if (!dateModel.isInRange) {
if (!dateModel!.isInRange) {
//
if (configuration.selectMode == CalendarSelectedMode.multiSelect) {
configuration.multiSelectOutOfRange();
if (configuration!.selectMode == CalendarSelectedMode.multiSelect) {
configuration!.multiSelectOutOfRange();
}
return;
}
calendarProvider.lastClickDateModel = dateModel;
switch (configuration.selectMode) {
switch (configuration!.selectMode) {
//
case CalendarSelectedMode.multiSelect:
if (calendarProvider.selectedDateList.contains(dateModel)) {
calendarProvider.selectedDateList.remove(dateModel);
if (calendarProvider.selectedDateList!.contains(dateModel)) {
calendarProvider.selectedDateList!.remove(dateModel);
_notifiCationUnCalendarSelect(dateModel);
} else {
//
if (calendarProvider.selectedDateList.length ==
configuration.maxMultiSelectCount) {
if (configuration.multiSelectOutOfSize != null) {
configuration.multiSelectOutOfSize();
if (calendarProvider.selectedDateList!.length ==
configuration!.maxMultiSelectCount) {
if (configuration!.multiSelectOutOfSize != null) {
configuration!.multiSelectOutOfSize!();
}
return;
}
dateModel.isSelected = !dateModel.isSelected;
calendarProvider.selectedDateList.add(dateModel);
dateModel!.isSelected = !dateModel!.isSelected!;
calendarProvider.selectedDateList!.add(dateModel);
}
//
@ -272,11 +272,11 @@ class ItemContainerState extends State<ItemContainer> {
case CalendarSelectedMode.singleSelect:
///
calendarProvider.selectedDateList.forEach((element) {
element.isSelected = false;
calendarProvider.selectedDateList!.forEach((element) {
element!.isSelected = false;
_notifiCationUnCalendarSelect(element);
});
calendarProvider.selectedDateList.clear();
calendarProvider.selectedDateList!.clear();
//item
if (calendarProvider.lastClickItemState != this) {
@ -284,7 +284,7 @@ class ItemContainerState extends State<ItemContainer> {
calendarProvider.lastClickItemState = this;
}
_notifiCationUnCalendarSelect(calendarProvider.selectDateModel);
dateModel.isSelected = true;
dateModel!.isSelected = true;
calendarProvider.selectDateModel = dateModel;
_notifiCationCalendarSelect(dateModel);
setState(() {});
@ -293,41 +293,41 @@ class ItemContainerState extends State<ItemContainer> {
///
case CalendarSelectedMode.mutltiStartToEndSelect:
if (calendarProvider.selectedDateList.length == 0) {
calendarProvider.selectedDateList.add(dateModel);
} else if (calendarProvider.selectedDateList.length == 1) {
DateModel d2 = calendarProvider.selectedDateList.first;
if (calendarProvider.selectedDateList.contains(dateModel)) {
if (calendarProvider.selectedDateList!.length == 0) {
calendarProvider.selectedDateList!.add(dateModel);
} else if (calendarProvider.selectedDateList!.length == 1) {
DateModel? d2 = calendarProvider.selectedDateList!.first;
if (calendarProvider.selectedDateList!.contains(dateModel)) {
///
dateModel.isSelected = false;
dateModel!.isSelected = false;
_notifiCationUnCalendarSelect(dateModel);
setState(() {});
return;
}
DateTime t1, t2;
if (d2.getDateTime().isAfter(dateModel.getDateTime())) {
if (d2!.getDateTime().isAfter(dateModel!.getDateTime())) {
t2 = d2.getDateTime();
t1 = dateModel.getDateTime();
t1 = dateModel!.getDateTime();
} else {
t1 = d2.getDateTime();
t2 = dateModel.getDateTime();
t2 = dateModel!.getDateTime();
}
for (; t1.isBefore(t2);) {
calendarProvider.selectedDateList
calendarProvider.selectedDateList!
.add(DateModel.fromDateTime(t1));
t1 = t1.add(Duration(days: 1));
}
calendarProvider.selectedDateList.add(DateModel.fromDateTime(t1));
calendarProvider.selectedDateList!.add(DateModel.fromDateTime(t1));
} else {
///
calendarProvider.selectedDateList.forEach((element) {
element.isSelected = false;
calendarProvider.selectedDateList!.forEach((element) {
element!.isSelected = false;
_notifiCationUnCalendarSelect(element);
});
///
calendarProvider.selectedDateList.clear();
calendarProvider.selectedDateList!.clear();
setState(() {});
}
@ -335,16 +335,16 @@ class ItemContainerState extends State<ItemContainer> {
}
///
if (configuration.calendarSelect != null &&
calendarProvider.selectedDateList.length > 0) {
calendarProvider.selectedDateList.forEach((element) {
if (configuration!.calendarSelect != null &&
calendarProvider.selectedDateList!.length > 0) {
calendarProvider.selectedDateList!.forEach((element) {
_notifiCationCalendarSelect(element);
});
}
refreshItem(!this.dateModel.isSelected);
refreshItem(!this.dateModel!.isSelected!);
},
child: configuration.dayWidgetBuilder(dateModel),
child: configuration!.dayWidgetBuilder!(dateModel!),
);
}

@ -8,7 +8,7 @@ import 'package:flutter_custom_calendar/widget/month_view.dart';
import 'package:provider/provider.dart';
class MonthViewPager extends StatefulWidget {
const MonthViewPager({Key key}) : super(key: key);
const MonthViewPager({Key? key}) : super(key: key);
@override
_MonthViewPagerState createState() => _MonthViewPagerState();
@ -16,7 +16,7 @@ class MonthViewPager extends StatefulWidget {
class _MonthViewPagerState extends State<MonthViewPager>
with AutomaticKeepAliveClientMixin {
CalendarProvider calendarProvider;
late CalendarProvider calendarProvider;
@override
void initState() {
@ -63,7 +63,7 @@ class _MonthViewPagerState extends State<MonthViewPager>
// CalendarProvider,listenfalse
calendarProvider = Provider.of<CalendarProvider>(context, listen: false);
CalendarConfiguration configuration =
calendarProvider.calendarConfiguration;
calendarProvider.calendarConfiguration!;
return PageView.builder(
scrollDirection: Axis.vertical,
@ -72,30 +72,30 @@ class _MonthViewPagerState extends State<MonthViewPager>
return;
}
//
DateModel dateModel = configuration.monthList[position];
configuration.monthChangeListeners.forEach((listener) {
DateModel dateModel = configuration.monthList![position];
configuration.monthChangeListeners!.forEach((listener) {
listener(dateModel.year, dateModel.month);
});
//
if (calendarProvider.lastClickDateModel != null ||
calendarProvider.lastClickDateModel.month != dateModel.month) {
calendarProvider.lastClickDateModel!.month != dateModel.month) {
DateModel temp = new DateModel();
temp.year = configuration.monthList[position].year;
temp.month = configuration.monthList[position].month;
temp.day = configuration.monthList[position].day + 14;
temp.year = configuration.monthList![position].year;
temp.month = configuration.monthList![position].month;
temp.day = configuration.monthList![position].day + 14;
calendarProvider.lastClickDateModel = temp;
}
},
controller: configuration.monthController,
itemBuilder: (context, index) {
final DateModel dateModel = configuration.monthList[index];
final DateModel dateModel = configuration.monthList![index];
return new MonthView(
configuration: configuration,
year: dateModel.year,
month: dateModel.month,
);
},
itemCount: configuration.monthList.length,
itemCount: configuration.monthList!.length,
);
}

@ -33,7 +33,7 @@ class OnlyOnePointerRecognizer extends OneSequenceGestureRecognizer {
}
class OnlyOnePointerRecognizerWidget extends StatelessWidget {
final Widget child;
final Widget? child;
OnlyOnePointerRecognizerWidget({this.child});

@ -11,14 +11,14 @@ import 'package:provider/provider.dart';
*
*/
class WeekView extends StatefulWidget {
final int year;
final int month;
final DateModel firstDayOfWeek;
final CalendarConfiguration configuration;
final int? year;
final int? month;
final DateModel? firstDayOfWeek;
final CalendarConfiguration? configuration;
const WeekView(
{@required this.year,
@required this.month,
{required this.year,
required this.month,
this.firstDayOfWeek,
this.configuration});
@ -27,33 +27,33 @@ class WeekView extends StatefulWidget {
}
class _WeekViewState extends State<WeekView> {
List<DateModel> items;
late List<DateModel> items;
Map<DateModel, Object> extraDataMap; //
Map<DateModel, Object>? extraDataMap; //
@override
void initState() {
super.initState();
extraDataMap = widget.configuration.extraDataMap;
extraDataMap = widget.configuration!.extraDataMap;
items = DateUtil.initCalendarForWeekView(
widget.year, widget.month, widget.firstDayOfWeek.getDateTime(), 0,
minSelectDate: widget.configuration.minSelectDate,
maxSelectDate: widget.configuration.maxSelectDate,
widget.year, widget.month, widget.firstDayOfWeek!.getDateTime(), 0,
minSelectDate: widget.configuration!.minSelectDate,
maxSelectDate: widget.configuration!.maxSelectDate,
extraDataMap: extraDataMap,
offset: widget.configuration.offset);
offset: widget.configuration!.offset);
//,generation
WidgetsBinding.instance.addPostFrameCallback((callback) {
WidgetsBinding.instance!.addPostFrameCallback((callback) {
Provider.of<CalendarProvider>(context, listen: false)
.generation
.addListener(() async {
items = DateUtil.initCalendarForWeekView(
widget.year, widget.month, widget.firstDayOfWeek.getDateTime(), 0,
minSelectDate: widget.configuration.minSelectDate,
maxSelectDate: widget.configuration.maxSelectDate,
widget.year, widget.month, widget.firstDayOfWeek!.getDateTime(), 0,
minSelectDate: widget.configuration!.minSelectDate,
maxSelectDate: widget.configuration!.maxSelectDate,
extraDataMap: extraDataMap,
offset: widget.configuration.offset);
offset: widget.configuration!.offset);
setState(() {});
});
});
@ -64,7 +64,7 @@ class _WeekViewState extends State<WeekView> {
CalendarProvider calendarProvider =
Provider.of<CalendarProvider>(context, listen: false);
CalendarConfiguration configuration =
CalendarConfiguration? configuration =
calendarProvider.calendarConfiguration;
print(
"WeekView Consumer:calendarProvider.selectDateModel:${calendarProvider.selectDateModel}");
@ -76,9 +76,9 @@ class _WeekViewState extends State<WeekView> {
itemBuilder: (context, index) {
DateModel dateModel = items[index];
//
switch (configuration.selectMode) {
switch (configuration!.selectMode) {
case CalendarSelectedMode.multiSelect:
if (calendarProvider.selectedDateList.contains(dateModel)) {
if (calendarProvider.selectedDateList!.contains(dateModel)) {
dateModel.isSelected = true;
} else {
dateModel.isSelected = false;
@ -92,7 +92,7 @@ class _WeekViewState extends State<WeekView> {
}
break;
case CalendarSelectedMode.mutltiStartToEndSelect:
if (calendarProvider.selectedDateList.contains(dateModel)) {
if (calendarProvider.selectedDateList!.contains(dateModel)) {
dateModel.isSelected = true;
} else {
dateModel.isSelected = false;

@ -7,7 +7,7 @@ import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
import 'package:flutter_custom_calendar/utils/LogUtil.dart';
class WeekViewPager extends StatefulWidget {
const WeekViewPager({Key key}) : super(key: key);
const WeekViewPager({Key? key}) : super(key: key);
@override
_WeekViewPagerState createState() => _WeekViewPagerState();
@ -15,8 +15,8 @@ class WeekViewPager extends StatefulWidget {
class _WeekViewPagerState extends State<WeekViewPager>
with AutomaticKeepAliveClientMixin {
int lastMonth; //
CalendarProvider calendarProvider;
int? lastMonth; //
late CalendarProvider calendarProvider;
// PageController newPageController;
@ -27,7 +27,7 @@ class _WeekViewPagerState extends State<WeekViewPager>
calendarProvider = Provider.of<CalendarProvider>(context, listen: false);
lastMonth = calendarProvider.lastClickDateModel.month;
lastMonth = calendarProvider.lastClickDateModel!.month;
}
@override
@ -45,7 +45,7 @@ class _WeekViewPagerState extends State<WeekViewPager>
CalendarProvider calendarProvider =
Provider.of<CalendarProvider>(context, listen: false);
CalendarConfiguration configuration =
calendarProvider.calendarConfiguration;
calendarProvider.calendarConfiguration!;
return Container(
height: configuration.itemSize ?? MediaQuery.of(context).size.width / 7,
@ -59,10 +59,10 @@ class _WeekViewPagerState extends State<WeekViewPager>
TAG: this.runtimeType,
message:
"WeekViewPager PageView onPageChanged,position:$position");
DateModel firstDayOfWeek = configuration.weekList[position];
int currentMonth = firstDayOfWeek.month;
DateModel firstDayOfWeek = configuration.weekList![position];
int? currentMonth = firstDayOfWeek.month;
//
configuration.weekChangeListeners.forEach((listener) {
configuration.weekChangeListeners!.forEach((listener) {
listener(firstDayOfWeek.year, firstDayOfWeek.month);
});
if (lastMonth != currentMonth) {
@ -70,12 +70,12 @@ class _WeekViewPagerState extends State<WeekViewPager>
TAG: this.runtimeType,
message:
"WeekViewPager PageView monthChange:currentMonth:$currentMonth");
configuration.monthChangeListeners.forEach((listener) {
configuration.monthChangeListeners!.forEach((listener) {
listener(firstDayOfWeek.year, firstDayOfWeek.month);
});
lastMonth = currentMonth;
if (calendarProvider.lastClickDateModel == null ||
calendarProvider.lastClickDateModel.month != currentMonth) {
calendarProvider.lastClickDateModel!.month != currentMonth) {
DateModel temp = new DateModel();
temp.year = firstDayOfWeek.year;
temp.month = firstDayOfWeek.month;
@ -86,9 +86,9 @@ class _WeekViewPagerState extends State<WeekViewPager>
// calendarProvider.lastClickDateModel = configuration.weekList[position]
// ..day += 4;
},
controller: calendarProvider.calendarConfiguration.weekController,
controller: calendarProvider.calendarConfiguration!.weekController,
itemBuilder: (context, index) {
DateModel dateModel = configuration.weekList[index];
DateModel dateModel = configuration.weekList![index];
return new WeekView(
year: dateModel.year,
month: dateModel.month,
@ -96,7 +96,7 @@ class _WeekViewPagerState extends State<WeekViewPager>
configuration: calendarProvider.calendarConfiguration,
);
},
itemCount: configuration.weekList.length,
itemCount: configuration.weekList!.length,
),
);
}

@ -1,62 +1,55 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.1"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
collection:
version: "1.2.0"
clock:
dependency: transitive
description:
name: collection
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.12"
convert:
version: "1.1.0"
collection:
dependency: transitive
description:
name: convert
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto:
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: crypto
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
@ -67,62 +60,41 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.12"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.6"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.8"
version: "1.3.0"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.4"
version: "1.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
version: "1.8.0"
provider:
dependency: "direct main"
description:
name: provider
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.3"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
version: "6.0.3"
sky_engine:
dependency: transitive
description: flutter
@ -134,63 +106,56 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.15"
version: "0.3.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.6.1"
version: "2.1.0"
sdks:
dart: ">=2.7.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.16.0"

@ -6,13 +6,13 @@ author: fgyong
repository: https://github.com/ifgyong/flutter_custom_calendar
issue_tracker: https://github.com/ifgyong/flutter_custom_calendar/issues
environment:
sdk: ">=2.7.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
provider: ^4.1.3
provider: ^6.0.3
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save