master
parent
0f86c621a0
commit
a881182be2
@ -1,36 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
|
||||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
|
@ -0,0 +1,116 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<codeStyleSettings language="XML">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
</indentOptions>
|
||||||
|
<arrangement>
|
||||||
|
<rules>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:android</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:id</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>style</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
</rules>
|
||||||
|
</arrangement>
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||||
|
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,252 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Dart Packages" type="DartPackagesLibraryType">
|
||||||
|
<properties>
|
||||||
|
<option name="packageNameToDirsMap">
|
||||||
|
<entry key="archive">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="args">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="async">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="boolean_selector">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="charcode">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="collection">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="convert">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="crypto">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="cupertino_icons">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="flutter">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="flutter_custom_calendar">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/flutter_custom_calendar-1.0.1/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="flutter_test">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter_test/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="image">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="matcher">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="meta">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="nested">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="path">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="petitparser">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="provider">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/provider-4.1.3/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="quiver">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="sky_engine">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/pkg/sky_engine/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="source_span">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="stack_trace">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="stream_channel">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="string_scanner">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="term_glyph">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="test_api">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="typed_data">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="vector_math">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="xml">
|
||||||
|
<value>
|
||||||
|
<list>
|
||||||
|
<option value="$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1/lib" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</option>
|
||||||
|
</properties>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/flutter_custom_calendar-1.0.1/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/provider-4.1.3/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/pkg/sky_engine/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter/lib" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/packages/flutter_test/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -0,0 +1,29 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Dart SDK">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/async" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/cli" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/collection" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/convert" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/core" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/developer" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/ffi" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/html" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/indexed_db" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/io" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/isolate" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/js" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/js_util" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/math" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/mirrors" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/svg" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/typed_data" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/wasm" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_audio" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_gl" />
|
||||||
|
<root url="file://$USER_HOME$/flutterSDK/flutter1.17-stable/bin/cache/dart-sdk/lib/web_sql" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -0,0 +1,7 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
|
||||||
|
<CLASSES />
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/example.iml" filepath="$PROJECT_DIR$/.idea/example.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="712d3fab-fb14-4aa9-8f22-6e18487dd55c" name="Default Changelist" comment="" />
|
||||||
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="ExecutionTargetManager" SELECTED_TARGET="Nexus_5_API_28" />
|
||||||
|
<component name="ProjectId" id="1dNihvP9QVilHtN46zdzXsNhST3" />
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="dart.analysis.tool.window.force.activate" value="false" />
|
||||||
|
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||||
|
<property name="show.migrate.to.gradle.popup" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="RunDashboard">
|
||||||
|
<option name="ruleStates">
|
||||||
|
<list>
|
||||||
|
<RuleState>
|
||||||
|
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||||
|
</RuleState>
|
||||||
|
<RuleState>
|
||||||
|
<option name="name" value="StatusDashboardGroupingRule" />
|
||||||
|
</RuleState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="RunManager">
|
||||||
|
<configuration name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
|
||||||
|
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
|
<component name="SvnConfiguration">
|
||||||
|
<configuration />
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="712d3fab-fb14-4aa9-8f22-6e18487dd55c" name="Default Changelist" comment="" />
|
||||||
|
<created>1592272073156</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1592272073156</updated>
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -1,10 +0,0 @@
|
|||||||
# This file tracks properties of this Flutter project.
|
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
||||||
#
|
|
||||||
# This file should be version controlled and should not be manually edited.
|
|
||||||
|
|
||||||
version:
|
|
||||||
revision: 0120c414fbc5d11c503e2091f420c02ffd6dda67
|
|
||||||
channel: master
|
|
||||||
|
|
||||||
project_type: app
|
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.example.example;
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity;
|
||||||
|
|
||||||
|
public class MainActivity extends FlutterActivity {
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
package com.example.example1
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
import io.flutter.app.FlutterActivity
|
|
||||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
|
||||||
|
|
||||||
class MainActivity: FlutterActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
GeneratedPluginRegistrant.registerWith(this)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting -->
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
Flutter draws its first frame -->
|
Flutter draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
</style>
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">@android:color/white</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="android" name="Android">
|
||||||
|
<configuration>
|
||||||
|
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||||
|
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/app/src/main/AndroidManifest.xml" />
|
||||||
|
<option name="RES_FOLDER_RELATIVE_PATH" value="/app/src/main/res" />
|
||||||
|
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/app/src/main/assets" />
|
||||||
|
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/app/src/main/libs" />
|
||||||
|
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/app/src/main/proguard_logs" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/app/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Flutter for Android" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.idea" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||||
|
<orderEntry type="library" name="Flutter Plugins" level="project" />
|
||||||
|
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.idea" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||||
|
<orderEntry type="library" name="Flutter Plugins" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -1 +1 @@
|
|||||||
#import "GeneratedPluginRegistrant.h"
|
#import "GeneratedPluginRegistrant.h"
|
||||||
|
@ -1,253 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class BlueStylePage extends StatefulWidget {
|
|
||||||
BlueStylePage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_BlueStylePageState createState() => _BlueStylePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _BlueStylePageState extends State<BlueStylePage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
Map<DateModel, String> customExtraData = {};
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
controller = new CalendarController(
|
|
||||||
|
|
||||||
showMode: CalendarConstants.MODE_SHOW_MONTH_AND_WEEK,
|
|
||||||
extraDataMap: customExtraData);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var calendarWidget = CalendarViewWidget(
|
|
||||||
weekBarItemWidgetBuilder: () {
|
|
||||||
return CustomStyleWeekBarItem();
|
|
||||||
},
|
|
||||||
dayWidgetBuilder: (dateModel) {
|
|
||||||
return CustomStyleDayWidget(dateModel);
|
|
||||||
},
|
|
||||||
calendarController: controller,
|
|
||||||
boxDecoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(20), bottomRight: Radius.circular(20)),
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
padding: EdgeInsets.only(left: 20, right: 20, bottom: 10),
|
|
||||||
margin: const EdgeInsets.only(
|
|
||||||
left: 15,
|
|
||||||
right: 15,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return SafeArea(
|
|
||||||
child: Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: Color(0xff6219EC),
|
|
||||||
),
|
|
||||||
backgroundColor: Color(0xff6219EC),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
height: 100,
|
|
||||||
margin: const EdgeInsets.only(left: 15, right: 15),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(20),
|
|
||||||
topRight: Radius.circular(20),
|
|
||||||
),
|
|
||||||
color: Colors.white),
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 30),
|
|
||||||
child: RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: "Februaly",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontSize: 30),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: " 2019",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black, fontSize: 30),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
calendarWidget
|
|
||||||
],
|
|
||||||
),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: new Text(selectText.value),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.toggleExpandStatus();
|
|
||||||
},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleWeekBarItem extends BaseWeekBar {
|
|
||||||
final List<String> weekList = ["mo", "tu", "we", "th", "fr", "sa", "su"];
|
|
||||||
|
|
||||||
//可以直接重写build方法
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
List<Widget> children = List();
|
|
||||||
|
|
||||||
var items = getWeekDayWidget();
|
|
||||||
children.add(Row(
|
|
||||||
children: items,
|
|
||||||
));
|
|
||||||
children.add(Divider(
|
|
||||||
color: Colors.grey,
|
|
||||||
));
|
|
||||||
return Column(
|
|
||||||
children: children,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getWeekBarItem(int index) {
|
|
||||||
return new Container(
|
|
||||||
margin: EdgeInsets.only(top: 10, bottom: 10),
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(
|
|
||||||
weekList[index],
|
|
||||||
style:
|
|
||||||
TextStyle(fontWeight: FontWeight.w700, color: Color(0xffC5BCDC)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleDayWidget extends BaseCombineDayWidget {
|
|
||||||
CustomStyleDayWidget(DateModel dateModel) : super(dateModel);
|
|
||||||
|
|
||||||
final TextStyle normalTextStyle =
|
|
||||||
TextStyle(fontWeight: FontWeight.w700, color: Colors.black);
|
|
||||||
|
|
||||||
final TextStyle noIsCurrentMonthTextStyle =
|
|
||||||
TextStyle(fontWeight: FontWeight.w700, color: Colors.grey);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getNormalWidget(DateModel dateModel) {
|
|
||||||
return Container(
|
|
||||||
margin: EdgeInsets.all(8),
|
|
||||||
child: new Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
//公历
|
|
||||||
new Expanded(
|
|
||||||
child: Center(
|
|
||||||
child: new Text(
|
|
||||||
dateModel.day.toString(),
|
|
||||||
style: dateModel.isCurrentMonth
|
|
||||||
? normalTextStyle
|
|
||||||
: noIsCurrentMonthTextStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getSelectedWidget(DateModel dateModel) {
|
|
||||||
return Container(
|
|
||||||
// margin: EdgeInsets.all(8),
|
|
||||||
decoration: new BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(5),
|
|
||||||
),
|
|
||||||
color: Color(0xffFED32B),
|
|
||||||
),
|
|
||||||
child: new Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
//公历
|
|
||||||
new Expanded(
|
|
||||||
child: Center(
|
|
||||||
child: new Text(
|
|
||||||
dateModel.day.toString(),
|
|
||||||
style: dateModel.isCurrentMonth
|
|
||||||
? normalTextStyle
|
|
||||||
: noIsCurrentMonthTextStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,192 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义风格+单选
|
|
||||||
*/
|
|
||||||
class CustomOffsetPage extends StatefulWidget {
|
|
||||||
CustomOffsetPage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_CustomOffsetPageState createState() => _CustomOffsetPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CustomOffsetPageState extends State<CustomOffsetPage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
controller = new CalendarController(
|
|
||||||
offset: 5
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
new Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_before),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToPreviousMonth();
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(text.value);
|
|
||||||
}),
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_next),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToNextMonth();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
weekBarItemWidgetBuilder: () {
|
|
||||||
return CustomStyleWeekBarItem();
|
|
||||||
},
|
|
||||||
dayWidgetBuilder: (dateModel) {
|
|
||||||
return CustomStyleDayWidget(dateModel);
|
|
||||||
}
|
|
||||||
),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(selectText.value);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleWeekBarItem extends BaseWeekBar {
|
|
||||||
final List<String> weekList = ["三", "四", "五", "六", "日", "一", "二"];
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getWeekBarItem(int index) {
|
|
||||||
return new Container(
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(weekList[index]),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleDayWidget extends BaseCustomDayWidget {
|
|
||||||
CustomStyleDayWidget(DateModel dateModel) : super(dateModel);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawNormal(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
// if (!dateModel.isCurrentMonth) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
bool isWeekend = dateModel.isWeekend;
|
|
||||||
bool isInRange = dateModel.isInRange;
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange
|
|
||||||
? Colors.grey
|
|
||||||
: isWeekend ? Colors.blue : Colors.black,
|
|
||||||
fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange
|
|
||||||
? Colors.grey
|
|
||||||
: isWeekend ? Colors.blue : Colors.grey,
|
|
||||||
fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawSelected(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
// if (!dateModel.isCurrentMonth) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//绘制背景
|
|
||||||
Paint backGroundPaint = new Paint()
|
|
||||||
..color = Colors.blue
|
|
||||||
..strokeWidth = 2;
|
|
||||||
double padding = 8;
|
|
||||||
canvas.drawCircle(Offset(size.width / 2, size.height / 2),
|
|
||||||
(size.width - padding) / 2, backGroundPaint);
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,190 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义风格+单选
|
|
||||||
*/
|
|
||||||
class CustomStylePage extends StatefulWidget {
|
|
||||||
CustomStylePage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_CustomStylePageState createState() => _CustomStylePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CustomStylePageState extends State<CustomStylePage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
controller = new CalendarController(
|
|
||||||
selectDateModel: DateModel.fromDateTime(DateTime.now()));
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
new Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_before),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToPreviousMonth();
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(text.value);
|
|
||||||
}),
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_next),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToNextMonth();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
weekBarItemWidgetBuilder: () {
|
|
||||||
return CustomStyleWeekBarItem();
|
|
||||||
},
|
|
||||||
dayWidgetBuilder: (dateModel) {
|
|
||||||
return CustomStyleDayWidget(dateModel);
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(selectText.value);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleWeekBarItem extends BaseWeekBar {
|
|
||||||
final List<String> weekList = ["一", "二", "三", "四", "五", "六", "日"];
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getWeekBarItem(int index) {
|
|
||||||
return new Container(
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(weekList[index]),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleDayWidget extends BaseCustomDayWidget {
|
|
||||||
CustomStyleDayWidget(DateModel dateModel) : super(dateModel);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawNormal(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
if (!dateModel.isCurrentMonth) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bool isWeekend = dateModel.isWeekend;
|
|
||||||
bool isInRange = dateModel.isInRange;
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange
|
|
||||||
? Colors.grey
|
|
||||||
: isWeekend ? Colors.blue : Colors.black,
|
|
||||||
fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange
|
|
||||||
? Colors.grey
|
|
||||||
: isWeekend ? Colors.blue : Colors.grey,
|
|
||||||
fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawSelected(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
if (!dateModel.isCurrentMonth) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//绘制背景
|
|
||||||
Paint backGroundPaint = new Paint()
|
|
||||||
..color = Colors.blue
|
|
||||||
..strokeWidth = 2;
|
|
||||||
double padding = 8;
|
|
||||||
canvas.drawCircle(Offset(size.width / 2, size.height / 2),
|
|
||||||
(size.width - padding) / 2, backGroundPaint);
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认风格+单选
|
|
||||||
*/
|
|
||||||
class DefaultStylePage extends StatefulWidget {
|
|
||||||
DefaultStylePage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_DefaultStylePageState createState() => _DefaultStylePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DefaultStylePageState extends State<DefaultStylePage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
DateTime now = DateTime.now();
|
|
||||||
controller = new CalendarController(
|
|
||||||
minYear: now.year - 1,
|
|
||||||
minYearMonth: 1,
|
|
||||||
maxYear: now.year + 1,
|
|
||||||
maxYearMonth: 12,
|
|
||||||
showMode: CalendarConstants.MODE_SHOW_MONTH_AND_WEEK);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
new Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_before),
|
|
||||||
onPressed: () {
|
|
||||||
// controller.moveToPreviousMonth();
|
|
||||||
controller.previousPage();
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(text.value);
|
|
||||||
}),
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_next),
|
|
||||||
onPressed: () {
|
|
||||||
// controller.moveToNextMonth();
|
|
||||||
controller.nextPage();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(selectText.value);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.toggleExpandStatus();
|
|
||||||
},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,185 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义风格+多选
|
|
||||||
*/
|
|
||||||
class MultiSelectStylePage extends StatefulWidget {
|
|
||||||
MultiSelectStylePage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_MultiSelectStylePageState createState() => _MultiSelectStylePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MultiSelectStylePageState extends State<MultiSelectStylePage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
controller = new CalendarController(
|
|
||||||
selectMode: CalendarConstants.MODE_MULTI_SELECT,
|
|
||||||
maxMultiSelectCount: 5,
|
|
||||||
minSelectYear: 2019,
|
|
||||||
minSelectMonth: 5,
|
|
||||||
minSelectDay: 20,
|
|
||||||
selectedDateTimeList: {
|
|
||||||
DateTime.now(),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"多选模式\n选中的时间:\n${controller.getMultiSelectCalendar().join("\n")}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"多选模式\n选中的时间:\n${controller.getMultiSelectCalendar().join("\n")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
new Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_before),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToPreviousMonth();
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(text.value);
|
|
||||||
}),
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_next),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToNextMonth();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
weekBarItemWidgetBuilder: () {
|
|
||||||
return CustomStyleWeekBarItem();
|
|
||||||
},
|
|
||||||
dayWidgetBuilder: (dateModel) {
|
|
||||||
return CustomStyleDayWidget(dateModel);
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(selectText.value);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleWeekBarItem extends BaseWeekBar {
|
|
||||||
final List<String> weekList = ["一", "二", "三", "四", "五", "六", "日"];
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getWeekBarItem(int index) {
|
|
||||||
return new Container(
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(weekList[index]),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleDayWidget extends BaseCustomDayWidget {
|
|
||||||
CustomStyleDayWidget(DateModel dateModel) : super(dateModel);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawNormal(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
bool isInRange = dateModel.isInRange;
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange ? Colors.grey : Colors.black, fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange ? Colors.grey : Colors.grey, fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawSelected(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
//绘制背景
|
|
||||||
Paint backGroundPaint = new Paint()
|
|
||||||
..color = Colors.blue
|
|
||||||
..strokeWidth = 2;
|
|
||||||
double padding = 8;
|
|
||||||
canvas.drawCircle(Offset(size.width / 2, size.height / 2),
|
|
||||||
(size.width - padding) / 2, backGroundPaint);
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认风格+单选
|
|
||||||
*/
|
|
||||||
class OnlyWeekPage extends StatefulWidget {
|
|
||||||
OnlyWeekPage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_OnlyWeekPageState createState() => _OnlyWeekPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _OnlyWeekPageState extends State<OnlyWeekPage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
DateTime now = DateTime.now();
|
|
||||||
controller = new CalendarController(
|
|
||||||
minYear: now.year,
|
|
||||||
minYearMonth: now.month - 2,
|
|
||||||
maxYear: now.year,
|
|
||||||
maxYearMonth: now.month + 1,
|
|
||||||
showMode: CalendarConstants.MODE_SHOW_ONLY_WEEK);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
new Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_before),
|
|
||||||
onPressed: () {
|
|
||||||
// controller.moveToPreviousMonth();
|
|
||||||
controller.previousPage();
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(text.value);
|
|
||||||
}),
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_next),
|
|
||||||
onPressed: () {
|
|
||||||
// controller.moveToNextMonth();
|
|
||||||
controller.nextPage();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(selectText.value);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.toggleExpandStatus();
|
|
||||||
},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,224 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 进度条风格+单选
|
|
||||||
*/
|
|
||||||
class ProgressStylePage extends StatefulWidget {
|
|
||||||
ProgressStylePage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_ProgressStylePageState createState() => _ProgressStylePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ProgressStylePageState extends State<ProgressStylePage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
DateTime now = DateTime.now();
|
|
||||||
DateTime temp = DateTime(now.year, now.month, now.day);
|
|
||||||
|
|
||||||
Map<DateModel, int> progressMap = {
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: -1))): 0,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: -2))): 20,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: -3))): 40,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: -4))): 60,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: -5))): 80,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: -6))): 100,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: 1))): 0,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: 2))): 20,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: 3))): 40,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: 4))): 60,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: 5))): 80,
|
|
||||||
DateModel.fromDateTime(temp.add(Duration(days: 6))): 100,
|
|
||||||
};
|
|
||||||
|
|
||||||
controller = new CalendarController(
|
|
||||||
extraDataMap: progressMap,
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: new Container(
|
|
||||||
child: new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
new Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_before),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToPreviousMonth();
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(text.value);
|
|
||||||
}),
|
|
||||||
new IconButton(
|
|
||||||
icon: Icon(Icons.navigate_next),
|
|
||||||
onPressed: () {
|
|
||||||
controller.moveToNextMonth();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
weekBarItemWidgetBuilder: () {
|
|
||||||
return CustomStyleWeekBarItem();
|
|
||||||
},
|
|
||||||
dayWidgetBuilder: (dateModel) {
|
|
||||||
return ProgressStyleDayWidget(dateModel);
|
|
||||||
}),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(selectText.value);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleWeekBarItem extends BaseWeekBar {
|
|
||||||
final List<String> weekList = ["一", "二", "三", "四", "五", "六", "日"];
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getWeekBarItem(int index) {
|
|
||||||
return new Container(
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(weekList[index]),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ProgressStyleDayWidget extends BaseCustomDayWidget {
|
|
||||||
ProgressStyleDayWidget(DateModel dateModel) : super(dateModel);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawNormal(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
bool isInRange = dateModel.isInRange;
|
|
||||||
|
|
||||||
//进度条
|
|
||||||
int progress = dateModel.extraData;
|
|
||||||
if (progress != null && progress != 0) {
|
|
||||||
double padding = 8;
|
|
||||||
Paint paint = Paint()
|
|
||||||
..color = Colors.grey
|
|
||||||
..style = PaintingStyle.stroke
|
|
||||||
..strokeWidth = 2;
|
|
||||||
|
|
||||||
canvas.drawCircle(Offset(size.width / 2, size.height / 2),
|
|
||||||
(size.width - padding) / 2, paint);
|
|
||||||
|
|
||||||
paint.color = Colors.blue;
|
|
||||||
|
|
||||||
double startAngle = -90 * pi / 180;
|
|
||||||
double sweepAngle = pi / 180 * (360 * progress / 100);
|
|
||||||
|
|
||||||
canvas.drawArc(
|
|
||||||
Rect.fromCircle(
|
|
||||||
center: Offset(size.width / 2, size.height / 2),
|
|
||||||
radius: (size.width - padding) / 2),
|
|
||||||
startAngle,
|
|
||||||
sweepAngle,
|
|
||||||
false,
|
|
||||||
paint);
|
|
||||||
}
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange ? Colors.grey : Colors.black, fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(
|
|
||||||
color: !isInRange ? Colors.grey : Colors.grey, fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void drawSelected(DateModel dateModel, Canvas canvas, Size size) {
|
|
||||||
//绘制背景
|
|
||||||
Paint backGroundPaint = new Paint()
|
|
||||||
..color = Colors.blue
|
|
||||||
..strokeWidth = 2;
|
|
||||||
double padding = 8;
|
|
||||||
canvas.drawCircle(Offset(size.width / 2, size.height / 2),
|
|
||||||
(size.width - padding) / 2, backGroundPaint);
|
|
||||||
|
|
||||||
//顶部的文字
|
|
||||||
TextPainter dayTextPainter = new TextPainter()
|
|
||||||
..text = TextSpan(
|
|
||||||
text: dateModel.day.toString(),
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 16))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
dayTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
dayTextPainter.paint(canvas, Offset(0, 10));
|
|
||||||
|
|
||||||
//下面的文字
|
|
||||||
TextPainter lunarTextPainter = new TextPainter()
|
|
||||||
..text = new TextSpan(
|
|
||||||
text: dateModel.lunarString,
|
|
||||||
style: new TextStyle(color: Colors.white, fontSize: 12))
|
|
||||||
..textDirection = TextDirection.ltr
|
|
||||||
..textAlign = TextAlign.center;
|
|
||||||
|
|
||||||
lunarTextPainter.layout(minWidth: size.width, maxWidth: size.width);
|
|
||||||
lunarTextPainter.paint(canvas, Offset(0, size.height / 2));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,238 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
|
|
||||||
|
|
||||||
class RedStylePage extends StatefulWidget {
|
|
||||||
RedStylePage({Key key, this.title}) : super(key: key);
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_RedStylePageState createState() => _RedStylePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RedStylePageState extends State<RedStylePage> {
|
|
||||||
ValueNotifier<String> text;
|
|
||||||
ValueNotifier<String> selectText;
|
|
||||||
|
|
||||||
CalendarController controller;
|
|
||||||
|
|
||||||
Map<DateModel, String> customExtraData = {};
|
|
||||||
|
|
||||||
Color pinkColor = Color(0xffFF8291);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
controller = new CalendarController(
|
|
||||||
showMode: CalendarConstants.MODE_SHOW_MONTH_AND_WEEK,
|
|
||||||
extraDataMap: customExtraData);
|
|
||||||
|
|
||||||
controller.addMonthChangeListener(
|
|
||||||
(year, month) {
|
|
||||||
text.value = "$year年$month月";
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.addOnCalendarSelectListener((dateModel) {
|
|
||||||
//刷新选择的时间
|
|
||||||
selectText.value =
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}";
|
|
||||||
});
|
|
||||||
|
|
||||||
text = new ValueNotifier("${DateTime.now().year}年${DateTime.now().month}月");
|
|
||||||
|
|
||||||
selectText = new ValueNotifier(
|
|
||||||
"单选模式\n选中的时间:\n${controller.getSingleSelectCalendar()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var calendarWidget = CalendarViewWidget(
|
|
||||||
calendarController: controller,
|
|
||||||
margin: EdgeInsets.only(top: 20),
|
|
||||||
weekBarItemWidgetBuilder: () {
|
|
||||||
return CustomStyleWeekBarItem();
|
|
||||||
},
|
|
||||||
dayWidgetBuilder: (dateModel) {
|
|
||||||
return CustomStyleDayWidget(dateModel);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
return SafeArea(
|
|
||||||
child: Scaffold(
|
|
||||||
appBar: AppBar(),
|
|
||||||
body: new Container(
|
|
||||||
color: Colors.white,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
child: new Column(
|
|
||||||
crossAxisAlignment:CrossAxisAlignment.stretch ,
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: text,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return new Text(
|
|
||||||
"${text.value}",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w700),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
Positioned(
|
|
||||||
left: 0,
|
|
||||||
child: Icon(
|
|
||||||
Icons.notifications,
|
|
||||||
color: pinkColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
right: 40,
|
|
||||||
child: Icon(
|
|
||||||
Icons.search,
|
|
||||||
color: pinkColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
right: 0,
|
|
||||||
child: Icon(
|
|
||||||
Icons.add,
|
|
||||||
color: pinkColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
calendarWidget,
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: selectText,
|
|
||||||
builder: (context, value, child) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: new Text(selectText.value),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.toggleExpandStatus();
|
|
||||||
},
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleWeekBarItem extends BaseWeekBar {
|
|
||||||
final List<String> weekList = ["M", "T", "W", "T", "F", "S", "S"];
|
|
||||||
|
|
||||||
//可以直接重写build方法
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
List<Widget> children = List();
|
|
||||||
|
|
||||||
var items = getWeekDayWidget();
|
|
||||||
children.add(Row(
|
|
||||||
children: items,
|
|
||||||
));
|
|
||||||
children.add(Divider(
|
|
||||||
color: Colors.grey,
|
|
||||||
));
|
|
||||||
return Column(
|
|
||||||
children: children,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getWeekBarItem(int index) {
|
|
||||||
return new Container(
|
|
||||||
margin: EdgeInsets.only(top: 10, bottom: 10),
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(
|
|
||||||
weekList[index],
|
|
||||||
style:
|
|
||||||
TextStyle(fontWeight: FontWeight.w700, color: Color(0xffBBC0C6)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomStyleDayWidget extends BaseCombineDayWidget {
|
|
||||||
CustomStyleDayWidget(DateModel dateModel) : super(dateModel);
|
|
||||||
|
|
||||||
final TextStyle normalTextStyle =
|
|
||||||
TextStyle(fontWeight: FontWeight.w700, color: Colors.black);
|
|
||||||
|
|
||||||
final TextStyle noIsCurrentMonthTextStyle =
|
|
||||||
TextStyle(fontWeight: FontWeight.w700, color: Colors.grey);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getNormalWidget(DateModel dateModel) {
|
|
||||||
return Container(
|
|
||||||
margin: EdgeInsets.all(8),
|
|
||||||
child: new Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
//公历
|
|
||||||
new Expanded(
|
|
||||||
child: Center(
|
|
||||||
child: new Text(
|
|
||||||
dateModel.day.toString(),
|
|
||||||
style: dateModel.isCurrentMonth
|
|
||||||
? normalTextStyle
|
|
||||||
: noIsCurrentMonthTextStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget getSelectedWidget(DateModel dateModel) {
|
|
||||||
return Container(
|
|
||||||
// margin: EdgeInsets.all(8),
|
|
||||||
decoration: new BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
color: Color(0xffFF8291),
|
|
||||||
),
|
|
||||||
child: new Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
new Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
//公历
|
|
||||||
new Expanded(
|
|
||||||
child: Center(
|
|
||||||
child: new Text(
|
|
||||||
dateModel.day.toString(),
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>example1</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script src="main.dart.js" type="application/javascript"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.idea" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/example/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/example/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/example/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/App.framework/flutter_assets/packages" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||||
|
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||||
|
<orderEntry type="library" name="Flutter Plugins" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -1,12 +1,17 @@
|
|||||||
library flutter_custom_calendar;
|
library flutter_custom_calendar;
|
||||||
|
|
||||||
export 'package:flutter_custom_calendar/controller.dart';
|
export 'controller.dart';
|
||||||
export 'package:flutter_custom_calendar/widget/calendar_view.dart';
|
export 'widget/calendar_view.dart';
|
||||||
export 'package:flutter_custom_calendar/widget/base_day_view.dart';
|
export 'widget/base_day_view.dart';
|
||||||
export 'package:flutter_custom_calendar/widget/base_week_bar.dart';
|
export 'widget/base_week_bar.dart';
|
||||||
export 'package:flutter_custom_calendar/constants/constants.dart';
|
export 'constants/constants.dart';
|
||||||
export 'package:flutter_custom_calendar/model/date_model.dart';
|
export 'model/date_model.dart';
|
||||||
export 'package:flutter_custom_calendar/widget/default_combine_day_view.dart';
|
export 'widget/default_combine_day_view.dart';
|
||||||
export 'package:flutter_custom_calendar/widget/default_custom_day_view.dart';
|
export 'widget/default_custom_day_view.dart';
|
||||||
export 'package:flutter_custom_calendar/widget/default_week_bar.dart';
|
export 'widget/default_week_bar.dart';
|
||||||
export 'package:flutter_custom_calendar/configuration.dart';
|
export 'configuration.dart';
|
||||||
|
|
||||||
|
export 'configuration.dart';
|
||||||
|
export 'calendar_provider.dart';
|
||||||
|
export 'constants/constants.dart';
|
||||||
|
export 'widget/base_day_view.dart';
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
void main() {
|
||||||
|
// test('adds one to input values', () {
|
||||||
|
// final calculator = Calculator();
|
||||||
|
// expect(calculator.addOne(2), 3);
|
||||||
|
// expect(calculator.addOne(-7), -6);
|
||||||
|
// expect(calculator.addOne(0), 1);
|
||||||
|
// expect(() => calculator.addOne(null), throwsNoSuchMethodError);
|
||||||
|
// });
|
||||||
|
}
|
Loading…
Reference in new issue