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

@ -2,241 +2,201 @@
<library name="Dart Packages" type="DartPackagesLibraryType"> <library name="Dart Packages" type="DartPackagesLibraryType">
<properties> <properties>
<option name="packageNameToDirsMap"> <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"> <entry key="async">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="boolean_selector"> <entry key="boolean_selector">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="charcode"> <entry key="characters">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="collection"> <entry key="charcode">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="convert"> <entry key="clock">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="crypto"> <entry key="collection">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="cupertino_icons"> <entry key="cupertino_icons">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="flutter"> <entry key="fake_async">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="flutter_test"> <entry key="flutter">
<value> <value>
<list> <list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter_test/lib" /> <option value="/Applications/sdk/flutter/packages/flutter/lib" />
</list> </list>
</value> </value>
</entry> </entry>
<entry key="image"> <entry key="flutter_test">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="matcher"> <entry key="matcher">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="meta"> <entry key="meta">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="nested"> <entry key="nested">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="path"> <entry key="path">
<value> <value>
<list> <list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4/lib" /> <option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/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" />
</list> </list>
</value> </value>
</entry> </entry>
<entry key="provider"> <entry key="provider">
<value> <value>
<list> <list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/provider-4.1.3/lib" /> <option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/provider-6.0.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" />
</list> </list>
</value> </value>
</entry> </entry>
<entry key="sky_engine"> <entry key="sky_engine">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="source_span"> <entry key="source_span">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="stack_trace"> <entry key="stack_trace">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="stream_channel"> <entry key="stream_channel">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="string_scanner"> <entry key="string_scanner">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="term_glyph"> <entry key="term_glyph">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="test_api"> <entry key="test_api">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="typed_data"> <entry key="typed_data">
<value> <value>
<list> <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> </list>
</value> </value>
</entry> </entry>
<entry key="vector_math"> <entry key="vector_math">
<value> <value>
<list> <list>
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib" /> <option value="$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0/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" />
</list> </list>
</value> </value>
</entry> </entry>
</option> </option>
</properties> </properties>
<CLASSES> <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:///Applications/sdk/flutter/bin/cache/pkg/sky_engine/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:///Applications/sdk/flutter/packages/flutter/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:///Applications/sdk/flutter/packages/flutter_test/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/async-2.6.1/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/charcode-1.2.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/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://$PROJECT_DIR$/../.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/matcher-0.12.6/lib" /> <root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.10/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/nested-1.0.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/path-1.8.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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/provider-6.0.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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/test_api-0.3.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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/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://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0/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" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

@ -1,27 +1,26 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Dart SDK"> <library name="Dart SDK">
<CLASSES> <CLASSES>
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/async" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/cli" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/cli" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/collection" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/convert" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/core" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/developer" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/ffi" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/ffi" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/html" /> <root url="file:///Applications/sdk/flutter/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:///Applications/sdk/flutter/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:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/isolate" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/js" /> <root url="file:///Applications/sdk/flutter/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:///Applications/sdk/flutter/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:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/mirrors" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/svg" /> <root url="file:///Applications/sdk/flutter/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:///Applications/sdk/flutter/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:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_audio" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/web_gl" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_gl" /> <root url="file:///Applications/sdk/flutter/bin/cache/dart-sdk/lib/web_sql" />
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_sql" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <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 /> <config />
</shared> </shared>
</component> </component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager"> <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_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$/.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.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/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/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.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.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" /> <change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -25,18 +41,22 @@
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_2_XL_API_28" />
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="ProjectId" id="1dLYXgUqXFRhtM2vVF7WEPgjPS2" /> <component name="ProjectId" id="1dLYXgUqXFRhtM2vVF7WEPgjPS2" />
<component name="ProjectReloadState">
<option name="STATE" value="1" />
</component>
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"> <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="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="dart.analysis.tool.window.force.activate" value="false" />
<property name="io.flutter.reload.alreadyRun" value="true" /> <property name="io.flutter.reload.alreadyRun" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
@ -66,6 +86,7 @@
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration"> <component name="SvnConfiguration">
<configuration /> <configuration />
</component> </component>
@ -84,13 +105,12 @@
<map> <map>
<entry key="MAIN"> <entry key="MAIN">
<value> <value>
<State> <State />
<option name="COLUMN_ORDER" />
</State>
</value> </value>
</entry> </entry>
</map> </map>
</option> </option>
<option name="oldMeFiltersMigrated" value="true" />
</component> </component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state width="1858" height="156" key="GridCell.Tab.0.bottom" timestamp="1595297133366"> <state width="1858" height="156" key="GridCell.Tab.0.bottom" timestamp="1595297133366">

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

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

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

@ -13,74 +13,74 @@ import 'model/date_model.dart';
*/ */
class CalendarConfiguration { class CalendarConfiguration {
//,MODE_SINGLE_SELECTMODE_MULTI_SELECT //,MODE_SINGLE_SELECTMODE_MULTI_SELECT
CalendarSelectedMode selectMode; CalendarSelectedMode? selectMode;
// //
int showMode; int? showMode;
// //
int minYear; int? minYear;
int maxYear; int? maxYear;
// //
int minYearMonth; int? minYearMonth;
int maxYearMonth; int? maxYearMonth;
// //
int nowYear; int? nowYear;
int nowMonth; int? nowMonth;
//, //,
int minSelectYear; int? minSelectYear;
int minSelectMonth; int? minSelectMonth;
int minSelectDay; int? minSelectDay;
int maxSelectYear; int? maxSelectYear;
int maxSelectMonth; int? maxSelectMonth;
int maxSelectDay; // int? maxSelectDay; //
DateModel selectDateModel; //item DateModel? selectDateModel; //item
HashSet<DateModel> defaultSelectedDateList; //set HashSet<DateModel?>? defaultSelectedDateList; //set
int maxMultiSelectCount; // int? maxMultiSelectCount; //
Map<DateModel, Object> extraDataMap = new Map(); // Map<DateModel, Object>? extraDataMap = new Map(); //
/** /**
* UI * UI
*/ */
double itemSize; ///7 double? itemSize; ///7
double verticalSpacing; //item10 double? verticalSpacing; //item10
BoxDecoration boxDecoration; // BoxDecoration? boxDecoration; //
EdgeInsetsGeometry padding; EdgeInsetsGeometry? padding;
EdgeInsetsGeometry margin; EdgeInsetsGeometry? margin;
// //
DayWidgetBuilder dayWidgetBuilder; //item DayWidgetBuilder? dayWidgetBuilder; //item
WeekBarItemWidgetBuilder weekBarItemWidgetBuilder; //weekbar WeekBarItemWidgetBuilder? weekBarItemWidgetBuilder; //weekbar
/** /**
* *
*/ */
// //
OnMonthChange monthChange; // ,multiMonthChanges OnMonthChange? monthChange; // ,multiMonthChanges
OnCalendarSelect calendarSelect; // OnCalendarSelect? calendarSelect; //
OnCalendarSelect unCalendarSelect; // OnCalendarSelect? unCalendarSelect; //
OnMultiSelectOutOfRange multiSelectOutOfRange; // late OnMultiSelectOutOfRange multiSelectOutOfRange; //
OnMultiSelectOutOfSize multiSelectOutOfSize; // OnMultiSelectOutOfSize? multiSelectOutOfSize; //
ObserverList<OnMonthChange> monthChangeListeners = ObserverList<OnMonthChange>? monthChangeListeners =
ObserverList<OnMonthChange>(); // ObserverList<OnMonthChange>(); //
ObserverList<OnWeekChange> weekChangeListeners = ObserverList<OnWeekChange>? weekChangeListeners =
ObserverList<OnWeekChange>(); // ObserverList<OnWeekChange>(); //
/** /**
* *
*/ */
List<DateModel> monthList = new List(); //list List<DateModel>? monthList = []; //list
List<DateModel> weekList = new List(); //list List<DateModel>? weekList = [] ; //list
PageController monthController; //controller PageController? monthController; //controller
PageController weekController; //controller PageController? weekController; //controller
DateModel minSelectDate; DateModel? minSelectDate;
DateModel maxSelectDate; DateModel? maxSelectDate;
/// first day offset /// first day offset
/// first day = (first day of month or week) + 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 Map<DateModel, Object> EMPTY_MAP = {};
static const Duration DEFAULT_DURATION = const Duration(milliseconds: 500); static const Duration DEFAULT_DURATION = const Duration(milliseconds: 500);
CalendarConfiguration calendarConfiguration; late CalendarConfiguration calendarConfiguration;
CalendarProvider calendarProvider = CalendarProvider(); CalendarProvider calendarProvider = CalendarProvider();
/** /**
* *
*/ */
List<DateModel> monthList = new List(); //list List<DateModel> monthList = []; //list
List<DateModel> weekList = new List(); //list List<DateModel> weekList = []; //list
PageController monthController; //controller PageController? monthController; //controller
PageController weekController; //controller PageController? weekController; //controller
CalendarController( CalendarController(
{CalendarSelectedMode selectMode = CalendarSelectedMode.singleSelect, {CalendarSelectedMode selectMode = CalendarSelectedMode.singleSelect,
@ -41,8 +41,8 @@ class CalendarController {
int maxYear = 2055, int maxYear = 2055,
int minYearMonth = 1, int minYearMonth = 1,
int maxYearMonth = 12, int maxYearMonth = 12,
int nowYear, int? nowYear,
int nowMonth, int? nowMonth,
int minSelectYear = 1971, int minSelectYear = 1971,
int minSelectMonth = 1, int minSelectMonth = 1,
int minSelectDay = 1, int minSelectDay = 1,
@ -50,7 +50,7 @@ class CalendarController {
int maxSelectMonth = 12, int maxSelectMonth = 12,
int maxSelectDay = 30, int maxSelectDay = 30,
Set<DateTime> selectedDateTimeList = EMPTY_SET, //item Set<DateTime> selectedDateTimeList = EMPTY_SET, //item
DateModel selectDateModel, //item DateModel? selectDateModel, //item
int maxMultiSelectCount = 9999, int maxMultiSelectCount = 9999,
Map<DateModel, Object> extraDataMap = EMPTY_MAP, Map<DateModel, Object> extraDataMap = EMPTY_MAP,
int offset = 0 // int offset = 0 //
@ -84,8 +84,8 @@ class CalendarController {
selectDateModel: selectDateModel, selectDateModel: selectDateModel,
offset: offset); offset: offset);
calendarConfiguration.defaultSelectedDateList = new HashSet<DateModel>(); calendarConfiguration.defaultSelectedDateList = new HashSet<DateModel?>();
calendarConfiguration.defaultSelectedDateList calendarConfiguration.defaultSelectedDateList!
.addAll(selectedDateTimeList.map((dateTime) { .addAll(selectedDateTimeList.map((dateTime) {
return DateModel.fromDateTime(dateTime); return DateModel.fromDateTime(dateTime);
}).toSet()); }).toSet());
@ -94,13 +94,13 @@ class CalendarController {
calendarProvider.selectedDateList = calendarProvider.selectedDateList =
calendarConfiguration.defaultSelectedDateList; calendarConfiguration.defaultSelectedDateList;
calendarConfiguration.minSelectDate = DateModel.fromDateTime(DateTime( calendarConfiguration.minSelectDate = DateModel.fromDateTime(DateTime(
calendarConfiguration.minSelectYear, calendarConfiguration.minSelectYear!,
calendarConfiguration.minSelectMonth, calendarConfiguration.minSelectMonth!,
calendarConfiguration.minSelectDay)); calendarConfiguration.minSelectDay!));
calendarConfiguration.maxSelectDate = DateModel.fromDateTime(DateTime( calendarConfiguration.maxSelectDate = DateModel.fromDateTime(DateTime(
calendarConfiguration.maxSelectYear, calendarConfiguration.maxSelectYear!,
calendarConfiguration.maxSelectMonth, calendarConfiguration.maxSelectMonth!,
calendarConfiguration.maxSelectDay)); calendarConfiguration.maxSelectDay!));
LogUtil.log( LogUtil.log(
TAG: this.runtimeType, TAG: this.runtimeType,
@ -116,24 +116,24 @@ class CalendarController {
void _weekAndMonthViewChange( void _weekAndMonthViewChange(
int showMode, int showMode,
) { ) {
int minYear = calendarConfiguration.minYear; int? minYear = calendarConfiguration.minYear;
int maxYear = calendarConfiguration.maxYear; int? maxYear = calendarConfiguration.maxYear;
int minYearMonth = calendarConfiguration.minYearMonth; int? minYearMonth = calendarConfiguration.minYearMonth;
int maxYearMonth = calendarConfiguration.maxYearMonth; int? maxYearMonth = calendarConfiguration.maxYearMonth;
int nowYear = calendarConfiguration.nowYear; int? nowYear = calendarConfiguration.nowYear;
int nowMonth = calendarConfiguration.nowMonth; int? nowMonth = calendarConfiguration.nowMonth;
if (showMode != CalendarConstants.MODE_SHOW_ONLY_WEEK) { if (showMode != CalendarConstants.MODE_SHOW_ONLY_WEEK) {
//pageController,initialPage //pageController,initialPage
int initialPage = 0; int initialPage = 0;
int nowMonthIndex = 0; int nowMonthIndex = 0;
monthList.clear(); monthList.clear();
for (int i = minYear; i <= maxYear; i++) { for (int i = minYear!; i <= maxYear!; i++) {
for (int j = 1; j <= 12; j++) { for (int j = 1; j <= 12; j++) {
if (i == minYear && j < minYearMonth) { if (i == minYear && j < minYearMonth!) {
continue; continue;
} }
if (i == maxYear && j > maxYearMonth) { if (i == maxYear && j > maxYearMonth!) {
continue; continue;
} }
DateModel dateModel = new DateModel(); DateModel dateModel = new DateModel();
@ -166,13 +166,13 @@ class CalendarController {
nowYear = DateTime.now().year; nowYear = DateTime.now().year;
nowMonth = DateTime.now().month; nowMonth = DateTime.now().month;
} }
DateTime nowTime = new DateTime(nowYear, nowMonth, 15); DateTime nowTime = new DateTime(nowYear!, nowMonth!, 15);
DateTime firstDayOfMonth = DateTime(minYear, minYearMonth, 1); DateTime firstDayOfMonth = DateTime(minYear!, minYearMonth!, 1);
// //
DateTime firstWeekDate = DateTime firstWeekDate =
firstDayOfMonth.add(Duration(days: -(firstDayOfMonth.weekday - 1))); firstDayOfMonth.add(Duration(days: -(firstDayOfMonth.weekday - 1)));
DateTime lastDay = DateTime(maxYear, maxYearMonth, DateTime lastDay = DateTime(maxYear!, maxYearMonth!,
DateUtil.getMonthDaysCount(maxYear, maxYearMonth)); DateUtil.getMonthDaysCount(maxYear, maxYearMonth));
int temp = -1; int temp = -1;
for (DateTime dateTime = firstWeekDate; for (DateTime dateTime = firstWeekDate;
@ -210,13 +210,13 @@ class CalendarController {
// //
void addWeekChangeListener(OnWeekChange listener) { void addWeekChangeListener(OnWeekChange listener) {
this.calendarConfiguration.weekChangeListeners.add(listener); this.calendarConfiguration.weekChangeListeners!.add(listener);
} }
// //
void addMonthChangeListener(OnMonthChange listener) { void addMonthChangeListener(OnMonthChange listener) {
// this.calendarConfiguration.monthChange = listener; // this.calendarConfiguration.monthChange = listener;
this.calendarConfiguration.monthChangeListeners.add(listener); this.calendarConfiguration.monthChangeListeners!.add(listener);
} }
// //
@ -263,7 +263,7 @@ class CalendarController {
//item //item
void changeDefaultSelectedDateList(Set<DateModel> defaultSelectedDateList) { void changeDefaultSelectedDateList(Set<DateModel> defaultSelectedDateList) {
this.calendarConfiguration.defaultSelectedDateList = this.calendarConfiguration.defaultSelectedDateList =
defaultSelectedDateList; defaultSelectedDateList as HashSet<DateModel?>?;
this.calendarProvider.generation.value++; this.calendarProvider.generation.value++;
} }
@ -280,13 +280,13 @@ class CalendarController {
if (calendarProvider.expandStatus.value == true) { if (calendarProvider.expandStatus.value == true) {
// //
int currentIndex = int currentIndex =
calendarProvider.calendarConfiguration.monthController.page.toInt(); calendarProvider.calendarConfiguration!.monthController!.page!.toInt();
if (currentIndex == 0) { if (currentIndex == 0) {
return false; return false;
} else { } else {
calendarProvider.calendarConfiguration.monthController calendarProvider.calendarConfiguration!.monthController!
.previousPage(duration: DEFAULT_DURATION, curve: Curves.ease); .previousPage(duration: DEFAULT_DURATION, curve: Curves.ease);
calendarProvider.calendarConfiguration.monthChangeListeners calendarProvider.calendarConfiguration!.monthChangeListeners!
.forEach((listener) { .forEach((listener) {
listener(monthList[currentIndex - 1].year, listener(monthList[currentIndex - 1].year,
monthList[currentIndex - 1].month); monthList[currentIndex - 1].month);
@ -301,11 +301,11 @@ class CalendarController {
} else { } else {
// //
int currentIndex = int currentIndex =
calendarProvider.calendarConfiguration.weekController.page.toInt(); calendarProvider.calendarConfiguration!.weekController!.page!.toInt();
if (currentIndex == 0) { if (currentIndex == 0) {
return false; return false;
} else { } else {
calendarProvider.calendarConfiguration.weekController calendarProvider.calendarConfiguration!.weekController!
.previousPage(duration: DEFAULT_DURATION, curve: Curves.ease); .previousPage(duration: DEFAULT_DURATION, curve: Curves.ease);
return true; return true;
} }
@ -321,13 +321,13 @@ class CalendarController {
if (calendarProvider.expandStatus.value == true) { if (calendarProvider.expandStatus.value == true) {
// //
int currentIndex = int currentIndex =
calendarProvider.calendarConfiguration.monthController.page.toInt(); calendarProvider.calendarConfiguration!.monthController!.page!.toInt();
if (monthList.length - 1 == currentIndex) { if (monthList.length - 1 == currentIndex) {
return false; return false;
} else { } else {
calendarProvider.calendarConfiguration.monthController calendarProvider.calendarConfiguration!.monthController!
.nextPage(duration: DEFAULT_DURATION, curve: Curves.ease); .nextPage(duration: DEFAULT_DURATION, curve: Curves.ease);
calendarProvider.calendarConfiguration.monthChangeListeners calendarProvider.calendarConfiguration!.monthChangeListeners!
.forEach((listener) { .forEach((listener) {
listener(monthList[currentIndex + 1].year, listener(monthList[currentIndex + 1].year,
monthList[currentIndex + 1].month); monthList[currentIndex + 1].month);
@ -343,11 +343,11 @@ class CalendarController {
} else { } else {
// //
int currentIndex = int currentIndex =
calendarProvider.calendarConfiguration.weekController.page.toInt(); calendarProvider.calendarConfiguration!.weekController!.page!.toInt();
if (weekList.length - 1 == currentIndex) { if (weekList.length - 1 == currentIndex) {
return false; return false;
} else { } else {
calendarProvider.calendarConfiguration.weekController calendarProvider.calendarConfiguration!.weekController!
.nextPage(duration: DEFAULT_DURATION, curve: Curves.ease); .nextPage(duration: DEFAULT_DURATION, curve: Curves.ease);
return true; return true;
} }
@ -366,15 +366,15 @@ class CalendarController {
if (targetPage == -1) { if (targetPage == -1) {
return; return;
} }
if (calendarProvider.calendarConfiguration.monthController.hasClients == if (calendarProvider.calendarConfiguration!.monthController!.hasClients ==
false) { false) {
return; return;
} }
if (needAnimation) { if (needAnimation) {
calendarProvider.calendarConfiguration.monthController calendarProvider.calendarConfiguration!.monthController!
.animateToPage(targetPage, duration: duration, curve: curve); .animateToPage(targetPage, duration: duration, curve: curve);
} else { } else {
calendarProvider.calendarConfiguration.monthController calendarProvider.calendarConfiguration!.monthController!
.jumpToPage(targetPage); .jumpToPage(targetPage);
} }
} else { } else {
@ -389,15 +389,15 @@ class CalendarController {
return; return;
} }
} }
if (calendarProvider.calendarConfiguration.weekController.hasClients == if (calendarProvider.calendarConfiguration!.weekController!.hasClients ==
false) { false) {
return; return;
} }
if (needAnimation) { if (needAnimation) {
calendarProvider.calendarConfiguration.weekController calendarProvider.calendarConfiguration!.weekController!
.animateToPage(targetPage, duration: duration, curve: curve); .animateToPage(targetPage, duration: duration, curve: curve);
} else { } else {
calendarProvider.calendarConfiguration.weekController calendarProvider.calendarConfiguration!.weekController!
.jumpToPage(targetPage); .jumpToPage(targetPage);
} }
} }
@ -409,7 +409,7 @@ class CalendarController {
Duration duration = const Duration(milliseconds: 500), Duration duration = const Duration(milliseconds: 500),
Curve curve = Curves.ease}) { Curve curve = Curves.ease}) {
DateTime targetDateTime = monthList[calendarProvider DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page .calendarConfiguration!.monthController!.page!
.toInt() + .toInt() +
12] 12]
.getDateTime(); .getDateTime();
@ -424,7 +424,7 @@ class CalendarController {
Duration duration = const Duration(milliseconds: 500), Duration duration = const Duration(milliseconds: 500),
Curve curve = Curves.ease}) { Curve curve = Curves.ease}) {
DateTime targetDateTime = monthList[calendarProvider DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page .calendarConfiguration!.monthController!.page!
.toInt() - .toInt() -
12] 12]
.getDateTime(); .getDateTime();
@ -440,30 +440,30 @@ class CalendarController {
Curve curve = Curves.ease}) { Curve curve = Curves.ease}) {
// indexweekController // indexweekController
if (calendarProvider.expandStatus.value == false) { if (calendarProvider.expandStatus.value == false) {
int currentMonth = weekList[calendarProvider int? currentMonth = weekList[calendarProvider
.calendarConfiguration.weekController.page .calendarConfiguration!.weekController!.page!
.toInt()] .toInt()]
.month; .month;
for (int i = calendarProvider.calendarConfiguration.weekController.page for (int i = calendarProvider.calendarConfiguration!.weekController!.page!
.toInt(); .toInt();
i < weekList.length; i < weekList.length;
i++) { i++) {
if (weekList[i].month != currentMonth) { if (weekList[i].month != currentMonth) {
calendarProvider.calendarConfiguration.weekController.jumpToPage(i); calendarProvider.calendarConfiguration!.weekController!.jumpToPage(i);
break; break;
} }
} }
return; return;
} }
if ((calendarProvider.calendarConfiguration.monthController.page.toInt() + if ((calendarProvider.calendarConfiguration!.monthController!.page!.toInt() +
1) >= 1) >=
monthList.length) { monthList.length) {
LogUtil.log(TAG: this.runtimeType, message: "moveToNextMonth当前是最后一个月份"); LogUtil.log(TAG: this.runtimeType, message: "moveToNextMonth当前是最后一个月份");
return; return;
} }
DateTime targetDateTime = monthList[calendarProvider DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page .calendarConfiguration!.monthController!.page!
.toInt() + .toInt() +
1] 1]
.getDateTime(); .getDateTime();
@ -479,30 +479,30 @@ class CalendarController {
Curve curve = Curves.ease}) { Curve curve = Curves.ease}) {
// indexweekController // indexweekController
if (calendarProvider.expandStatus.value == false) { if (calendarProvider.expandStatus.value == false) {
int currentMonth = weekList[weekController.page.toInt()].month; int? currentMonth = weekList[weekController!.page!.toInt()].month;
for (int i = calendarProvider.calendarConfiguration.weekController.page for (int i = calendarProvider.calendarConfiguration!.weekController!.page!
.toInt(); .toInt();
i >= 0; i >= 0;
i--) { i--) {
if (weekList[i].month != currentMonth && if (weekList[i].month != currentMonth &&
weekList[i].isAfter(DateModel.fromDateTime(DateTime( weekList[i].isAfter(DateModel.fromDateTime(DateTime(
calendarConfiguration.minYear, calendarConfiguration.minYear!,
calendarConfiguration.minYearMonth)))) { calendarConfiguration.minYearMonth!)))) {
calendarProvider.calendarConfiguration.weekController.jumpToPage(i); calendarProvider.calendarConfiguration!.weekController!.jumpToPage(i);
break; break;
} }
} }
return; return;
} }
if ((calendarProvider.calendarConfiguration.monthController.page.toInt()) == if ((calendarProvider.calendarConfiguration!.monthController!.page!.toInt()) ==
0) { 0) {
LogUtil.log( LogUtil.log(
TAG: this.runtimeType, message: "moveToPreviousMonth当前是第一个月份"); TAG: this.runtimeType, message: "moveToPreviousMonth当前是第一个月份");
return; return;
} }
DateTime targetDateTime = monthList[calendarProvider DateTime targetDateTime = monthList[calendarProvider
.calendarConfiguration.monthController.page .calendarConfiguration!.monthController!.page!
.toInt() - .toInt() -
1] 1]
.getDateTime(); .getDateTime();
@ -513,16 +513,16 @@ class CalendarController {
// //
DateModel getCurrentMonth() { DateModel getCurrentMonth() {
return monthList[monthController.page.toInt()]; return monthList[monthController!.page!.toInt()];
} }
//, //,
Set<DateModel> getMultiSelectCalendar() { Set<DateModel?>? getMultiSelectCalendar() {
return calendarProvider.selectedDateList; return calendarProvider.selectedDateList;
} }
// //
DateModel getSingleSelectCalendar() { DateModel? getSingleSelectCalendar() {
return calendarProvider.selectDateModel; 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 { class DateModel {
int year; int? year;
int month; int? month;
int day = 1; int day = 1;
List<int> lunar = List(3); List<int?> lunar = [];
// List<int> get lunar { // List<int> get lunar {
// if (lunar?.isNotEmpty == false) { // if (lunar?.isNotEmpty == false) {
@ -32,43 +32,43 @@ class DateModel {
} }
//24 //24
String get solarTerm => LunarUtil.getSolarTerm(year, month, day); String get solarTerm => LunarUtil.getSolarTerm(year, month!, day);
// //
String get gregorianFestival { String get gregorianFestival {
String result = LunarUtil.gregorianFestival(month, day); String result = LunarUtil.gregorianFestival(month!, day);
if (result?.isNotEmpty == true) { if (result?.isNotEmpty == true) {
return result; return result;
} }
return LunarUtil.getSpecialFestival(year, month, day); return LunarUtil.getSpecialFestival(year, month!, day);
} }
// //
String get traditionFestival => String get traditionFestival =>
LunarUtil.getTraditionFestival(lunarYear, lunarMonth, lunarDay); LunarUtil.getTraditionFestival(lunarYear, lunarMonth, lunarDay);
bool isCurrentMonth; // bool? isCurrentMonth; //
Object extraData; // Object? extraData; //
bool isInRange = false; //, bool isInRange = false; //,
bool isSelected; // bool? isSelected; //
bool isCanClick = bool isCanClick =
true; //todo:truefalse true; //todo:truefalse
// //
bool get isWeekend => DateUtil.isWeekend(getDateTime()); 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); 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 @override
String toString() { String toString() {
@ -77,7 +77,7 @@ class DateModel {
//DateTime //DateTime
DateTime getDateTime() { DateTime getDateTime() {
return new DateTime(year, month, day); return new DateTime(year!, month!, day);
} }
//DateTimemodel //DateTimemodel
@ -86,8 +86,8 @@ class DateModel {
..year = dateTime.year ..year = dateTime.year
..month = dateTime.month ..month = dateTime.month
..day = dateTime.day; ..day = dateTime.day;
List<int> lunar = List<int?> lunar =
LunarUtil.solarToLunar(dateModel.year, dateModel.month, dateModel.day); LunarUtil.solarToLunar(dateModel.year!, dateModel.month!, dateModel.day);
dateModel.lunar = lunar; dateModel.lunar = lunar;
// get, // get,

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

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

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

@ -15,7 +15,7 @@ class System {
// dest: // dest:
// destPos: // destPos:
// length: // 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) { int destPos, int length) {
List.copyRange(dest, destPos, src, srcPos, srcPos+length); List.copyRange(dest, destPos, src, srcPos, srcPos+length);
} }

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save