chore: remove dead folders and untrack generated build artifacts
- Move dead firebase_twitter_sign_in (no pubspec), vendored flutter_date_pickers-master, and temp .pr-description dirs to .trash - Untrack 75 .dart_tool files and a stray pubspec.lock from git - Consolidate stray in-app .trash dirs; ignore .pr-description-*
1
.gitignore
vendored
@@ -351,5 +351,6 @@ build/
|
|||||||
|
|
||||||
**/flutter_export_environment.sh
|
**/flutter_export_environment.sh
|
||||||
**/.dart_tool
|
**/.dart_tool
|
||||||
|
.pr-description-*/
|
||||||
|
|
||||||
.trash/
|
.trash/
|
||||||
|
|||||||
@@ -1,166 +0,0 @@
|
|||||||
{
|
|
||||||
"configVersion": 2,
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "async",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/async-2.13.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "boolean_selector",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "characters",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/characters-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clock",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/clock-1.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "collection",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cupertino_icons",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.9",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fake_async",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_test",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter_test",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_flutter_testing",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_testing",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "matcher",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/matcher-0.12.20",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "material_color_utilities",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/material_color_utilities-0.13.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "meta",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/meta-1.19.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/path-1.9.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sky_engine",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/bin/cache/pkg/sky_engine",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "source_span",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/source_span-1.10.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stack_trace",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream_channel",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "string_scanner",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "term_glyph",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test_api",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/test_api-0.7.12",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vector_math",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vector_math-2.4.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vm_service",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vm_service-15.2.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dropdown_button",
|
|
||||||
"rootUri": "../",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"generator": "pub",
|
|
||||||
"generatorVersion": "3.13.0",
|
|
||||||
"flutterRoot": "file:///opt/homebrew/share/flutter",
|
|
||||||
"flutterVersion": "3.47.0",
|
|
||||||
"pubCache": "file:///Users/nishantsrivastava/.pub-cache"
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
dropdown_button
|
|
||||||
2.10
|
|
||||||
file:///Users/nishantsrivastava/Documents/github/flutter-examples/dropdown_button/
|
|
||||||
file:///Users/nishantsrivastava/Documents/github/flutter-examples/dropdown_button/lib/
|
|
||||||
async
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/lib/
|
|
||||||
boolean_selector
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
|
|
||||||
characters
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/lib/
|
|
||||||
clock
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/lib/
|
|
||||||
collection
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/lib/
|
|
||||||
cupertino_icons
|
|
||||||
2.0
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/
|
|
||||||
fake_async
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib/
|
|
||||||
matcher
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/lib/
|
|
||||||
material_color_utilities
|
|
||||||
2.13
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib/
|
|
||||||
meta
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/lib/
|
|
||||||
path
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/lib/
|
|
||||||
source_span
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/lib/
|
|
||||||
stack_trace
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
|
|
||||||
stream_channel
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
|
|
||||||
string_scanner
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/lib/
|
|
||||||
term_glyph
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/lib/
|
|
||||||
test_api
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/lib/
|
|
||||||
vector_math
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/lib/
|
|
||||||
sky_engine
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine/lib/
|
|
||||||
flutter
|
|
||||||
2.17
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter/lib/
|
|
||||||
flutter_test
|
|
||||||
2.17
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test/lib/
|
|
||||||
2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.47.0
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
{
|
|
||||||
"configVersion": 2,
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "async",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/async-2.13.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "boolean_selector",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "characters",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/characters-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clock",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/clock-1.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "collection",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cupertino_icons",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.9",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fake_async",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_test",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter_test",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_flutter_testing",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_testing",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "matcher",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/matcher-0.12.20",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "material_color_utilities",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/material_color_utilities-0.13.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "meta",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/meta-1.19.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/path-1.9.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sky_engine",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/bin/cache/pkg/sky_engine",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "source_span",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/source_span-1.10.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stack_trace",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream_channel",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "string_scanner",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "term_glyph",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test_api",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/test_api-0.7.12",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vector_math",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vector_math-2.4.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vm_service",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vm_service-15.2.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "enabling_splash_screen",
|
|
||||||
"rootUri": "../",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"generator": "pub",
|
|
||||||
"generatorVersion": "3.13.0",
|
|
||||||
"flutterRoot": "file:///opt/homebrew/share/flutter",
|
|
||||||
"flutterVersion": "3.47.0",
|
|
||||||
"pubCache": "file:///Users/nishantsrivastava/.pub-cache"
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
enabling_splash_screen
|
|
||||||
2.10
|
|
||||||
file:///Users/nishantsrivastava/Documents/github/flutter-examples/enabling_splash_screen/
|
|
||||||
file:///Users/nishantsrivastava/Documents/github/flutter-examples/enabling_splash_screen/lib/
|
|
||||||
async
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/lib/
|
|
||||||
boolean_selector
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
|
|
||||||
characters
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/lib/
|
|
||||||
clock
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/lib/
|
|
||||||
collection
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/lib/
|
|
||||||
cupertino_icons
|
|
||||||
2.0
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/
|
|
||||||
fake_async
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib/
|
|
||||||
matcher
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/lib/
|
|
||||||
material_color_utilities
|
|
||||||
2.13
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib/
|
|
||||||
meta
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/lib/
|
|
||||||
path
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/lib/
|
|
||||||
source_span
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/lib/
|
|
||||||
stack_trace
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
|
|
||||||
stream_channel
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
|
|
||||||
string_scanner
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/lib/
|
|
||||||
term_glyph
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/lib/
|
|
||||||
test_api
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/lib/
|
|
||||||
vector_math
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/lib/
|
|
||||||
sky_engine
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine/lib/
|
|
||||||
flutter
|
|
||||||
2.17
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter/lib/
|
|
||||||
flutter_test
|
|
||||||
2.17
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test/lib/
|
|
||||||
2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.47.0
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
{
|
|
||||||
"configVersion": 2,
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "async",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/async-2.13.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "boolean_selector",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "characters",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/characters-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clock",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/clock-1.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "collection",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cupertino_icons",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.9",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fake_async",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_test",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/packages/flutter_test",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "intl",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/intl-0.20.3",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_flutter_testing",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_testing",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "matcher",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/matcher-0.12.20",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "material_color_utilities",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/material_color_utilities-0.13.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "meta",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/meta-1.19.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/path-1.9.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sky_engine",
|
|
||||||
"rootUri": "file:///opt/homebrew/share/flutter/bin/cache/pkg/sky_engine",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "source_span",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/source_span-1.10.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stack_trace",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream_channel",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "string_scanner",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "term_glyph",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test_api",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/test_api-0.7.12",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vector_math",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vector_math-2.4.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vm_service",
|
|
||||||
"rootUri": "file:///Users/nishantsrivastava/.pub-cache/hosted/pub.dev/vm_service-15.2.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "expense_planner",
|
|
||||||
"rootUri": "../",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"generator": "pub",
|
|
||||||
"generatorVersion": "3.13.0",
|
|
||||||
"flutterRoot": "file:///opt/homebrew/share/flutter",
|
|
||||||
"flutterVersion": "3.47.0",
|
|
||||||
"pubCache": "file:///Users/nishantsrivastava/.pub-cache"
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
expense_planner
|
|
||||||
2.10
|
|
||||||
file:///Users/nishantsrivastava/Documents/github/flutter-examples/expense_planner/
|
|
||||||
file:///Users/nishantsrivastava/Documents/github/flutter-examples/expense_planner/lib/
|
|
||||||
async
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/lib/
|
|
||||||
boolean_selector
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
|
|
||||||
characters
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/lib/
|
|
||||||
clock
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/lib/
|
|
||||||
collection
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/lib/
|
|
||||||
cupertino_icons
|
|
||||||
2.0
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/
|
|
||||||
fake_async
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib/
|
|
||||||
intl
|
|
||||||
2.0
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.15.8/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.15.8/lib/
|
|
||||||
matcher
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/lib/
|
|
||||||
material_color_utilities
|
|
||||||
2.13
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib/
|
|
||||||
meta
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/lib/
|
|
||||||
path
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/lib/
|
|
||||||
source_span
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/lib/
|
|
||||||
stack_trace
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
|
|
||||||
stream_channel
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
|
|
||||||
string_scanner
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/lib/
|
|
||||||
term_glyph
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/lib/
|
|
||||||
test_api
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/lib/
|
|
||||||
vector_math
|
|
||||||
2.14
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/lib/
|
|
||||||
sky_engine
|
|
||||||
2.12
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/bin/cache/pkg/sky_engine/lib/
|
|
||||||
flutter
|
|
||||||
2.17
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter/lib/
|
|
||||||
flutter_test
|
|
||||||
2.17
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test/
|
|
||||||
file:///usr/local/Caskroom/flutter/2.8.1/flutter/packages/flutter_test/lib/
|
|
||||||
2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.47.0
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
## [0.0.6] - 21 November 2019
|
|
||||||
Added support for custom day decoration.
|
|
||||||
Added support for custom disabled days.
|
|
||||||
|
|
||||||
## [0.1.0] - 31 May 2020
|
|
||||||
Fixed i18n issue for MonthPicker in case no locale was set.
|
|
||||||
Fixed selection periods with unselectable dates issue in RangePicker.
|
|
||||||
Minor changes and fixes.
|
|
||||||
|
|
||||||
## [0.1.1] - 20 June 2020
|
|
||||||
Added scrollPhysics property to DatePickerLayoutSettings.
|
|
||||||
|
|
||||||
## [0.1.3] - 23 June 2020
|
|
||||||
Added day headers style customization.
|
|
||||||
Added prev/next icon customization.
|
|
||||||
Added selected period text styles customization.
|
|
||||||
|
|
||||||
## [0.1.4] - 2 July 2020
|
|
||||||
Added firstDayOfWeekIndex customization.
|
|
||||||
|
|
||||||
## [0.1.5] - 29 July 2020
|
|
||||||
Added support of the CupertinoApp ancestor (fixed #29).
|
|
||||||
|
|
||||||
## [0.1.6] - 21 August 2020
|
|
||||||
Added two customizable fields to DatePickerLayoutSettings: showNextMonthStart, showPrevMonthEnd (implemented #28).
|
|
||||||
|
|
||||||
## [0.1.7] - 25 August 2020
|
|
||||||
Added onMonthChange callback for all day based pickers.
|
|
||||||
Added newPeriod field to UnselectablePeriodError class.
|
|
||||||
|
|
||||||
## [0.1.8] - 26 October 2020
|
|
||||||
Fixed selection in RangePicker which is on the edge of date when time changes (#44).
|
|
||||||
|
|
||||||
## [0.1.9] - 23 December 2020
|
|
||||||
Increased intl dependency version.
|
|
||||||
Minor changes.
|
|
||||||
|
|
||||||
## [0.1.10] - 23 December 2020
|
|
||||||
Increased intl dependency version according to one used on pub.dev.
|
|
||||||
|
|
||||||
## [0.2.0] - 7 March 2021
|
|
||||||
Migrated to null-safety.
|
|
||||||
Added DatePickerLayoutSettings.hideMonthNavigationRow option.
|
|
||||||
|
|
||||||
## [0.2.1] - 16 March 2021
|
|
||||||
Used intl for getting short month name for MonthPicker (fixed #54)
|
|
||||||
|
|
||||||
## [0.2.2] - 20 March 2021
|
|
||||||
Added **initiallyShowDate** optional property for DayPicker, WeekPicker and RangePicker.
|
|
||||||
|
|
||||||
## [0.2.3] - 05 April 2021
|
|
||||||
Fixed nextTooltip initializing (#57).
|
|
||||||
|
|
||||||
## [0.2.3+1] - 11 April 2021
|
|
||||||
Fixed defining DayHeaderStyle in DatePickerStyles.fulfillWithTheme.
|
|
||||||
|
|
||||||
## [0.2.4] - 29 April 2021
|
|
||||||
Fixed incorrect new month calculations (#56).
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Maria Melnik
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
# flutter_date_pickers
|
|
||||||
|
|
||||||
[](https://github.com/MariaMelnik/flutter_date_pickers/actions)
|
|
||||||
[](https://pub.dev/packages/flutter_date_pickers)
|
|
||||||
[](https://pub.dev/packages/flutter_date_pickers)
|
|
||||||
[](https://pub.dev/packages/flutter_date_pickers/score)
|
|
||||||
[](https://github.com/MariaMelnik/flutter_date_pickers)
|
|
||||||
[](https://opensource.org/licenses/MIT)
|
|
||||||
[](https://github.com/MariaMelnik/flutter_date_pickers/)
|
|
||||||
<!--[](https://codecov.io/gh/MariaMelnik/flutter_date_pickers)
|
|
||||||
[](https://github.com/tenhobi/effective_dart)-->
|
|
||||||
|
|
||||||
|
|
||||||
Allows to use date pickers without dialog.
|
|
||||||
Provides some customizable styles for date pickers.
|
|
||||||
|
|
||||||
A set of date pickers:
|
|
||||||
* `DayPicker` for one day
|
|
||||||
* `WeekPicker` for whole week
|
|
||||||
* `RangePicker` for random range
|
|
||||||
* `MonthPicker` for month
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## How to style date picker
|
|
||||||
Every date picker constructor take a style object as a parameter (if no styles passed - defaults will be used).
|
|
||||||
|
|
||||||
For single value pickers (DayPicker, MonthPicker) it is DatePickerStyles object;
|
|
||||||
|
|
||||||
For range pickers (WeekPicker, RangePickers) it is DatePickerRangeStyles object;
|
|
||||||
|
|
||||||
Customizable styles:
|
|
||||||
for all date pickers
|
|
||||||
|
|
||||||
| Property | Description |
|
|
||||||
|---|---|
|
|
||||||
| TextStyle displayedPeriodTitle | title of the date picker |
|
|
||||||
| TextStyle currentDateStyle | style for current date |
|
|
||||||
| TextStyle disabledDateStyle | style for disabled dates (before first and after last date user can pick) |
|
|
||||||
| TextStyle selectedDateStyle | style for selected date |
|
|
||||||
| BoxDecoration selectedSingleDateDecoration | decoration for selected date in case single value is selected |
|
|
||||||
| TextStyle defaultDateTextStyle | style for date which is neither current nor disabled nor selected |
|
|
||||||
|
|
||||||
only for range date pickers (WeekPicker, RangePicker)
|
|
||||||
|
|
||||||
| Property | Description |
|
|
||||||
|---|---|
|
|
||||||
| BoxDecoration selectedPeriodStartDecoration | decoration for the first date of the selected range |
|
|
||||||
| BoxDecoration selectedPeriodLastDecoration | decoration for the first date of the selected range |
|
|
||||||
| BoxDecoration selectedPeriodMiddleDecoration | Decoration for the date of the selected range which is not first date and not end date of this range |
|
|
||||||
|
|
||||||
## How to make some dates not selectable date picker
|
|
||||||
By default only dates before `firstDate` and after `lastDate` are not selectable. But you can set custom disabled days.
|
|
||||||
`DayPicker`, `WeekPicker` and `RangePicker` take a `SelectableDayPredicate selectableDayPredicate`
|
|
||||||
where you can specify function which returns if some date is disabled or not.
|
|
||||||
|
|
||||||
If some date is disabled for selection it gets `disabledDateStyle`.
|
|
||||||
|
|
||||||
If selected range or week pretends to include such disabled date `UnselectablePeriodException` occurs.
|
|
||||||
To handle it - pass `onSelectionError` callback to date picker.
|
|
||||||
|
|
||||||
## How to make special decorations for some dates
|
|
||||||
By default cells are decorated with `datePickerStyles` slyles (or default if no styles was passed to date picker).
|
|
||||||
If you need special decoration for some days use `eventDecorationBuilder`.
|
|
||||||
Currently only for `DayPicker`, `WeekPicker` and `RangePicker`.
|
|
||||||
|
|
||||||
- If date is not selected basic styles will be merged with styles from `eventDecorationBuilder`.
|
|
||||||
- If date is current date styles from `eventDecorationBuilder` win (if there are).
|
|
||||||
- Otherwise basic styles (`datePickerStyles`) win.
|
|
||||||
|
|
||||||
## What time I will get after selection?
|
|
||||||
If one day selected:
|
|
||||||
you will get start of the day (00:00:00) by default. If selected `firstDate` - you will get time of it.
|
|
||||||
|
|
||||||
If range/week selected:
|
|
||||||
for start you will get start of the day (00:00:00) by default. If selected `firstDate` - you will get time of it.
|
|
||||||
for end you will get end of the day (23:59:59.999) by default. If selected `lastDate` - you will get time of it.
|
|
||||||
|
|
||||||
If month selected:
|
|
||||||
you will get start (00:00:00) of the 1 day of month by default.
|
|
||||||
If selected month same as month of the `firstDate` - you will get `firstDate`.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```dart
|
|
||||||
// Create week date picker with passed parameters
|
|
||||||
Widget buildWeekDatePicker (DateTime selectedDate, DateTime firstAllowedDate, DateTime lastAllowedDate, ValueChanged<DatePeriod> onNewSelected) {
|
|
||||||
|
|
||||||
// add some colors to default settings
|
|
||||||
DatePickerRangeStyles styles = DatePickerRangeStyles(
|
|
||||||
selectedPeriodLastDecoration: BoxDecoration(
|
|
||||||
color: Colors.red,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topRight: Radius.circular(10.0),
|
|
||||||
bottomRight: Radius.circular(10.0))),
|
|
||||||
selectedPeriodStartDecoration: BoxDecoration(
|
|
||||||
color: Colors.green,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(10.0), bottomLeft: Radius.circular(10.0)),
|
|
||||||
),
|
|
||||||
selectedPeriodMiddleDecoration: BoxDecoration(
|
|
||||||
color: Colors.yellow, shape: BoxShape.rectangle),
|
|
||||||
);
|
|
||||||
|
|
||||||
return WeekPicker(
|
|
||||||
selectedDate: selectedDate,
|
|
||||||
onChanged: onNewSelected,
|
|
||||||
firstDate: firstAllowedDate,
|
|
||||||
lastDate: lastAllowedDate,
|
|
||||||
datePickerStyles: styles
|
|
||||||
);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example app
|
|
||||||
Please checkout [example](https://github.com/MariaMelnik/flutter_date_pickers/tree/master/example).
|
|
||||||
|
|
||||||
For help getting started with Flutter, view our
|
|
||||||
[online documentation](https://flutter.io/docs), which offers tutorials,
|
|
||||||
samples, guidance on mobile development, and a full API reference.
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
analyzer:
|
|
||||||
exclude:
|
|
||||||
- build/**
|
|
||||||
- android/**
|
|
||||||
- ios/**
|
|
||||||
- web/**
|
|
||||||
- windows/**
|
|
||||||
- macos/**
|
|
||||||
- linux/**
|
|
||||||
linter:
|
|
||||||
rules:
|
|
||||||
# STYLE
|
|
||||||
camel_case_types: true
|
|
||||||
camel_case_extensions: true
|
|
||||||
library_names: true
|
|
||||||
file_names: true
|
|
||||||
library_prefixes: true
|
|
||||||
non_constant_identifier_names: true
|
|
||||||
constant_identifier_names: true
|
|
||||||
directives_ordering: true
|
|
||||||
lines_longer_than_80_chars: true
|
|
||||||
curly_braces_in_flow_control_structures: true
|
|
||||||
|
|
||||||
# DOCUMENTATION
|
|
||||||
slash_for_doc_comments: true
|
|
||||||
package_api_docs: true
|
|
||||||
public_member_api_docs: true
|
|
||||||
comment_references: true
|
|
||||||
|
|
||||||
# USAGE
|
|
||||||
implementation_imports: true
|
|
||||||
avoid_relative_lib_imports: true
|
|
||||||
prefer_relative_imports: true
|
|
||||||
prefer_adjacent_string_concatenation: true
|
|
||||||
prefer_interpolation_to_compose_strings: true
|
|
||||||
unnecessary_brace_in_string_interps: true
|
|
||||||
prefer_collection_literals: true
|
|
||||||
prefer_is_empty: true
|
|
||||||
prefer_is_not_empty: true
|
|
||||||
avoid_function_literals_in_foreach_calls: true
|
|
||||||
prefer_iterable_whereType: true
|
|
||||||
prefer_function_declarations_over_variables: true
|
|
||||||
unnecessary_lambdas: true
|
|
||||||
prefer_equal_for_default_values: true
|
|
||||||
avoid_init_to_null: true
|
|
||||||
unnecessary_getters_setters: true
|
|
||||||
unnecessary_getters: true
|
|
||||||
prefer_expression_function_bodies: true
|
|
||||||
unnecessary_this: true
|
|
||||||
unnecessary_const: true
|
|
||||||
avoid_catches_without_on_clauses: true
|
|
||||||
avoid_catching_errors: true
|
|
||||||
use_rethrow_when_possible: true
|
|
||||||
|
|
||||||
# DESIGN
|
|
||||||
use_to_and_as_if_applicable: true
|
|
||||||
one_member_abstracts: true
|
|
||||||
avoid_classes_with_only_static_members: true
|
|
||||||
prefer_mixin: true
|
|
||||||
prefer_final_fields: true
|
|
||||||
use_setters_to_change_properties: true
|
|
||||||
avoid_setters_without_getters: true
|
|
||||||
avoid_returning_null: true
|
|
||||||
avoid_returning_this: true
|
|
||||||
type_annotate_public_apis: true
|
|
||||||
prefer_typing_uninitialized_variables: true
|
|
||||||
# omit_local_variable_types: true
|
|
||||||
avoid_types_on_closure_parameters: true
|
|
||||||
avoid_return_types_on_setters: true
|
|
||||||
prefer_generic_function_type_aliases: true
|
|
||||||
avoid_private_typedef_functions: true
|
|
||||||
use_function_type_syntax_for_parameters: true
|
|
||||||
avoid_positional_boolean_parameters: true
|
|
||||||
hash_and_equals: true
|
|
||||||
avoid_equals_and_hash_code_on_mutable_classes: true
|
|
||||||
avoid_null_checks_in_equality_operators: true
|
|
||||||
|
|
||||||
|
|
||||||
# PEDANTIC
|
|
||||||
# (duplicated rules are removed)
|
|
||||||
always_declare_return_types: true
|
|
||||||
always_require_non_null_named_parameters: true
|
|
||||||
annotate_overrides: true
|
|
||||||
avoid_empty_else: true
|
|
||||||
avoid_shadowing_type_parameters: true
|
|
||||||
avoid_types_as_parameter_names: true
|
|
||||||
empty_catches: true
|
|
||||||
empty_constructor_bodies: true
|
|
||||||
no_duplicate_case_values: true
|
|
||||||
null_closures: true
|
|
||||||
prefer_conditional_assignment: true
|
|
||||||
prefer_contains: true
|
|
||||||
prefer_for_elements_to_map_fromIterable: true
|
|
||||||
prefer_if_null_operators: true
|
|
||||||
# prefer_single_quotes: true
|
|
||||||
prefer_spread_collections: true
|
|
||||||
recursive_getters: true
|
|
||||||
type_init_formals: true
|
|
||||||
unawaited_futures: true
|
|
||||||
unnecessary_new: true
|
|
||||||
unnecessary_null_in_if_null_operators: true
|
|
||||||
unrelated_type_equality_checks: true
|
|
||||||
valid_regexps: true
|
|
||||||
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.3 MiB |
@@ -1,42 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("com.android.application")
|
|
||||||
id("org.jetbrains.kotlin.android")
|
|
||||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
||||||
id("dev.flutter.flutter-gradle-plugin")
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace = "com.mariamelnik.flutter_date_picker"
|
|
||||||
compileSdk = flutter.compileSdkVersion
|
|
||||||
ndkVersion = flutter.ndkVersion
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId = "com.mariamelnik.flutter_date_picker"
|
|
||||||
minSdk = flutter.minSdkVersion
|
|
||||||
targetSdk = flutter.targetSdkVersion
|
|
||||||
versionCode = flutter.versionCode
|
|
||||||
versionName = flutter.versionName
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
compilerOptions {
|
|
||||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flutter {
|
|
||||||
source = "../.."
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.mariamelnik.flutter_date_picker">
|
|
||||||
<!-- Flutter needs it to communicate with the running application
|
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
|
||||||
-->
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
</manifest>
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
>
|
|
||||||
|
|
||||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
|
||||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
|
||||||
In most cases you can leave this as-is, but you if you want to provide
|
|
||||||
additional functionality it is fine to subclass or reimplement
|
|
||||||
FlutterApplication and put your custom class here. -->
|
|
||||||
<application
|
|
||||||
android:name="${applicationName}"
|
|
||||||
android:label="flutter_date_picker"
|
|
||||||
android:icon="@mipmap/ic_launcher">
|
|
||||||
<activity
|
|
||||||
android:name="io.flutter.embedding.android.FlutterActivity"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@style/LaunchTheme"
|
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
||||||
android:hardwareAccelerated="true"
|
|
||||||
android:windowSoftInputMode="adjustResize">
|
|
||||||
<!-- This keeps the window background of the activity showing
|
|
||||||
until Flutter renders its first frame. It can be removed if
|
|
||||||
there is no splash screen (such as the default splash screen
|
|
||||||
defined in @style/LaunchTheme). -->
|
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package io.flutter.plugins;
|
|
||||||
|
|
||||||
import androidx.annotation.Keep;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import io.flutter.Log;
|
|
||||||
|
|
||||||
import io.flutter.embedding.engine.FlutterEngine;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generated file. Do not edit.
|
|
||||||
* This file is generated by the Flutter tool based on the
|
|
||||||
* plugins that support the Android platform.
|
|
||||||
*/
|
|
||||||
@Keep
|
|
||||||
public final class GeneratedPluginRegistrant {
|
|
||||||
private static final String TAG = "GeneratedPluginRegistrant";
|
|
||||||
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Modify this file to customize your launch splash screen -->
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:drawable="@android:color/white" />
|
|
||||||
|
|
||||||
<!-- You can insert your own image assets here -->
|
|
||||||
<!-- <item>
|
|
||||||
<bitmap
|
|
||||||
android:gravity="center"
|
|
||||||
android:src="@mipmap/launch_image" />
|
|
||||||
</item> -->
|
|
||||||
</layer-list>
|
|
||||||
|
Before Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 442 B |
|
Before Width: | Height: | Size: 721 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
|
||||||
Flutter draws its first frame -->
|
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.mariamelnik.flutter_date_picker">
|
|
||||||
<!-- Flutter needs it to communicate with the running application
|
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
|
||||||
-->
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
</manifest>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val newBuildDir: Directory =
|
|
||||||
rootProject.layout.buildDirectory
|
|
||||||
.dir("../../build")
|
|
||||||
.get()
|
|
||||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
|
||||||
|
|
||||||
subprojects {
|
|
||||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
|
||||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
|
||||||
}
|
|
||||||
subprojects {
|
|
||||||
project.evaluationDependsOn(":app")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register<Delete>("clean") {
|
|
||||||
delete(rootProject.layout.buildDirectory)
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
|
||||||
android.useAndroidX=true
|
|
||||||
android.newDsl=false
|
|
||||||
android.builtInKotlin=false
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
|
||||||
distributionPath=wrapper/dists
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
|
||||||
networkTimeout=10000
|
|
||||||
validateDistributionUrl=true
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
|
||||||
249
flutter_date_pickers-master/example/android/gradlew
vendored
@@ -1,249 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright © 2015-2021 the original authors.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
#
|
|
||||||
# Gradle start up script for POSIX generated by Gradle.
|
|
||||||
#
|
|
||||||
# Important for running:
|
|
||||||
#
|
|
||||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
||||||
# noncompliant, but you have some other compliant shell such as ksh or
|
|
||||||
# bash, then to run this script, type that shell name before the whole
|
|
||||||
# command line, like:
|
|
||||||
#
|
|
||||||
# ksh Gradle
|
|
||||||
#
|
|
||||||
# Busybox and similar reduced shells will NOT work, because this script
|
|
||||||
# requires all of these POSIX shell features:
|
|
||||||
# * functions;
|
|
||||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
||||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
||||||
# * compound commands having a testable exit status, especially «case»;
|
|
||||||
# * various built-in commands including «command», «set», and «ulimit».
|
|
||||||
#
|
|
||||||
# Important for patching:
|
|
||||||
#
|
|
||||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
||||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
||||||
#
|
|
||||||
# The "traditional" practice of packing multiple parameters into a
|
|
||||||
# space-separated string is a well documented source of bugs and security
|
|
||||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
||||||
# options in "$@", and eventually passing that to Java.
|
|
||||||
#
|
|
||||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
||||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
||||||
# see the in-line comments for details.
|
|
||||||
#
|
|
||||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
||||||
# Darwin, MinGW, and NonStop.
|
|
||||||
#
|
|
||||||
# (3) This script is generated from the Groovy template
|
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
||||||
# within the Gradle project.
|
|
||||||
#
|
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
app_path=$0
|
|
||||||
|
|
||||||
# Need this for daisy-chained symlinks.
|
|
||||||
while
|
|
||||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
|
||||||
[ -h "$app_path" ]
|
|
||||||
do
|
|
||||||
ls=$( ls -ld "$app_path" )
|
|
||||||
link=${ls#*' -> '}
|
|
||||||
case $link in #(
|
|
||||||
/*) app_path=$link ;; #(
|
|
||||||
*) app_path=$APP_HOME$link ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# This is normally unused
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
APP_BASE_NAME=${0##*/}
|
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
||||||
MAX_FD=maximum
|
|
||||||
|
|
||||||
warn () {
|
|
||||||
echo "$*"
|
|
||||||
} >&2
|
|
||||||
|
|
||||||
die () {
|
|
||||||
echo
|
|
||||||
echo "$*"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
} >&2
|
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
|
||||||
cygwin=false
|
|
||||||
msys=false
|
|
||||||
darwin=false
|
|
||||||
nonstop=false
|
|
||||||
case "$( uname )" in #(
|
|
||||||
CYGWIN* ) cygwin=true ;; #(
|
|
||||||
Darwin* ) darwin=true ;; #(
|
|
||||||
MSYS* | MINGW* ) msys=true ;; #(
|
|
||||||
NONSTOP* ) nonstop=true ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
|
||||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
|
||||||
else
|
|
||||||
JAVACMD=$JAVA_HOME/bin/java
|
|
||||||
fi
|
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
JAVACMD=java
|
|
||||||
if ! command -v java >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
||||||
case $MAX_FD in #(
|
|
||||||
max*)
|
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC2039,SC3045
|
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
|
||||||
warn "Could not query maximum file descriptor limit"
|
|
||||||
esac
|
|
||||||
case $MAX_FD in #(
|
|
||||||
'' | soft) :;; #(
|
|
||||||
*)
|
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC2039,SC3045
|
|
||||||
ulimit -n "$MAX_FD" ||
|
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Collect all arguments for the java command, stacking in reverse order:
|
|
||||||
# * args from the command line
|
|
||||||
# * the main class name
|
|
||||||
# * -classpath
|
|
||||||
# * -D...appname settings
|
|
||||||
# * --module-path (only if needed)
|
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if "$cygwin" || "$msys" ; then
|
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
||||||
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
for arg do
|
|
||||||
if
|
|
||||||
case $arg in #(
|
|
||||||
-*) false ;; # don't mess with options #(
|
|
||||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
||||||
[ -e "$t" ] ;; #(
|
|
||||||
*) false ;;
|
|
||||||
esac
|
|
||||||
then
|
|
||||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
||||||
fi
|
|
||||||
# Roll the args list around exactly as many times as the number of
|
|
||||||
# args, so each arg winds up back in the position where it started, but
|
|
||||||
# possibly modified.
|
|
||||||
#
|
|
||||||
# NB: a `for` loop captures its iteration list before it begins, so
|
|
||||||
# changing the positional parameters here affects neither the number of
|
|
||||||
# iterations, nor the values presented in `arg`.
|
|
||||||
shift # remove old arg
|
|
||||||
set -- "$@" "$arg" # push replacement arg
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
|
||||||
# and any embedded shellness will be escaped.
|
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
|
||||||
# treated as '${Hostname}' itself on the command line.
|
|
||||||
|
|
||||||
set -- \
|
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
||||||
-classpath "$CLASSPATH" \
|
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
|
||||||
if ! command -v xargs >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
die "xargs is not available"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
|
||||||
#
|
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
||||||
#
|
|
||||||
# In Bash we could simply go:
|
|
||||||
#
|
|
||||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
||||||
# set -- "${ARGS[@]}" "$@"
|
|
||||||
#
|
|
||||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
||||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
||||||
# character that might be a shell metacharacter, then use eval to reverse
|
|
||||||
# that process (while maintaining the separation between arguments), and wrap
|
|
||||||
# the whole thing up as a single "set" statement.
|
|
||||||
#
|
|
||||||
# This will of course break if any of these variables contains a newline or
|
|
||||||
# an unmatched quote.
|
|
||||||
#
|
|
||||||
|
|
||||||
eval "set -- $(
|
|
||||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
||||||
xargs -n1 |
|
|
||||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
||||||
tr '\n' ' '
|
|
||||||
)" '"$@"'
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
@rem
|
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@rem See the License for the specific language governing permissions and
|
|
||||||
@rem limitations under the License.
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
|
||||||
@rem This is normally unused
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
pluginManagement {
|
|
||||||
val flutterSdkPath =
|
|
||||||
run {
|
|
||||||
val properties = java.util.Properties()
|
|
||||||
file("local.properties").inputStream().use { properties.load(it) }
|
|
||||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
|
||||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
|
||||||
flutterSdkPath
|
|
||||||
}
|
|
||||||
|
|
||||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
|
||||||
id("com.android.application") version "9.1.0" apply false
|
|
||||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
|
||||||
}
|
|
||||||
|
|
||||||
include(":app")
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?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>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>App</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>io.flutter.flutter.app</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>App</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>MinimumOSVersion</key>
|
|
||||||
<string>8.0</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "Generated.xcconfig"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
// This is a generated file; do not edit or check into version control.
|
|
||||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example
|
|
||||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_TARGET=lib/main.dart
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=1.0.0
|
|
||||||
FLUTTER_BUILD_NUMBER=1
|
|
||||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
|
||||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "Generated.xcconfig"
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#
|
|
||||||
# Generated file, do not edit.
|
|
||||||
#
|
|
||||||
|
|
||||||
import lldb
|
|
||||||
|
|
||||||
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
|
|
||||||
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
|
|
||||||
base = frame.register["x0"].GetValueAsAddress()
|
|
||||||
page_len = frame.register["x1"].GetValueAsUnsigned()
|
|
||||||
|
|
||||||
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
|
|
||||||
# first page to see if handled it correctly. This makes diagnosing
|
|
||||||
# misconfiguration (e.g. missing breakpoint) easier.
|
|
||||||
data = bytearray(page_len)
|
|
||||||
data[0:8] = b'IHELPED!'
|
|
||||||
|
|
||||||
error = lldb.SBError()
|
|
||||||
frame.GetThread().GetProcess().WriteMemory(base, data, error)
|
|
||||||
if not error.Success():
|
|
||||||
print(f'Failed to write into {base}[+{page_len}]', error)
|
|
||||||
return
|
|
||||||
|
|
||||||
def __lldb_init_module(debugger: lldb.SBDebugger, _):
|
|
||||||
target = debugger.GetDummyTarget()
|
|
||||||
# Caveat: must use BreakpointCreateByRegEx here and not
|
|
||||||
# BreakpointCreateByName. For some reasons callback function does not
|
|
||||||
# get carried over from dummy target for the later.
|
|
||||||
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
|
|
||||||
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
|
|
||||||
bp.SetAutoContinue(True)
|
|
||||||
print("-- LLDB integration loaded --")
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#
|
|
||||||
# Generated file, do not edit.
|
|
||||||
#
|
|
||||||
|
|
||||||
command script import --relative-to-command-file flutter_lldb_helper.py
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example
|
|
||||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_TARGET=lib/main.dart
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=1.0.0
|
|
||||||
FLUTTER_BUILD_NUMBER=1
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
|
||||||
@@ -1,491 +0,0 @@
|
|||||||
// !$*UTF8*$!
|
|
||||||
{
|
|
||||||
archiveVersion = 1;
|
|
||||||
classes = {
|
|
||||||
};
|
|
||||||
objectVersion = 46;
|
|
||||||
objects = {
|
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
|
||||||
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
|
|
||||||
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
|
|
||||||
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
|
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
|
||||||
/* End PBXBuildFile section */
|
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
|
||||||
isa = PBXCopyFilesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
dstPath = "";
|
|
||||||
dstSubfolderSpec = 10;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
name = "Embed Frameworks";
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXCopyFilesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
|
||||||
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
|
||||||
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
|
||||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
|
||||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
|
||||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
|
||||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
||||||
/* End PBXFileReference section */
|
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXFrameworksBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
|
||||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
|
||||||
);
|
|
||||||
name = Flutter;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
97C146E51CF9000F007C117D = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
9740EEB11CF90186004384FC /* Flutter */,
|
|
||||||
97C146F01CF9000F007C117D /* Runner */,
|
|
||||||
97C146EF1CF9000F007C117D /* Products */,
|
|
||||||
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
|
|
||||||
);
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
97C146EF1CF9000F007C117D /* Products */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
97C146EE1CF9000F007C117D /* Runner.app */,
|
|
||||||
);
|
|
||||||
name = Products;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
97C146F01CF9000F007C117D /* Runner */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
|
|
||||||
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
|
|
||||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
|
||||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
|
||||||
97C147021CF9000F007C117D /* Info.plist */,
|
|
||||||
97C146F11CF9000F007C117D /* Supporting Files */,
|
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
|
||||||
);
|
|
||||||
path = Runner;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
97C146F11CF9000F007C117D /* Supporting Files */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
97C146F21CF9000F007C117D /* main.m */,
|
|
||||||
);
|
|
||||||
name = "Supporting Files";
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
|
||||||
97C146ED1CF9000F007C117D /* Runner */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
|
||||||
buildPhases = (
|
|
||||||
9740EEB61CF901F6004384FC /* Run Script */,
|
|
||||||
97C146EA1CF9000F007C117D /* Sources */,
|
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
|
||||||
97C146EC1CF9000F007C117D /* Resources */,
|
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
);
|
|
||||||
name = Runner;
|
|
||||||
productName = Runner;
|
|
||||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
|
||||||
productType = "com.apple.product-type.application";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
|
||||||
97C146E61CF9000F007C117D /* Project object */ = {
|
|
||||||
isa = PBXProject;
|
|
||||||
attributes = {
|
|
||||||
LastUpgradeCheck = 0910;
|
|
||||||
ORGANIZATIONNAME = "The Chromium Authors";
|
|
||||||
TargetAttributes = {
|
|
||||||
97C146ED1CF9000F007C117D = {
|
|
||||||
CreatedOnToolsVersion = 7.3.1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
|
||||||
compatibilityVersion = "Xcode 3.2";
|
|
||||||
developmentRegion = English;
|
|
||||||
hasScannedForEncodings = 0;
|
|
||||||
knownRegions = (
|
|
||||||
en,
|
|
||||||
Base,
|
|
||||||
);
|
|
||||||
mainGroup = 97C146E51CF9000F007C117D;
|
|
||||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
|
||||||
projectDirPath = "";
|
|
||||||
projectRoot = "";
|
|
||||||
targets = (
|
|
||||||
97C146ED1CF9000F007C117D /* Runner */,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
/* End PBXProject section */
|
|
||||||
|
|
||||||
/* Begin PBXResourcesBuildPhase section */
|
|
||||||
97C146EC1CF9000F007C117D /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
|
||||||
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
|
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXResourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Thin Binary";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
|
||||||
};
|
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Run Script";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
|
||||||
};
|
|
||||||
/* End PBXShellScriptBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
|
||||||
97C146EA1CF9000F007C117D /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
|
|
||||||
97C146F31CF9000F007C117D /* main.m in Sources */,
|
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXVariantGroup section */
|
|
||||||
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
|
||||||
isa = PBXVariantGroup;
|
|
||||||
children = (
|
|
||||||
97C146FB1CF9000F007C117D /* Base */,
|
|
||||||
);
|
|
||||||
name = Main.storyboard;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
|
||||||
isa = PBXVariantGroup;
|
|
||||||
children = (
|
|
||||||
97C147001CF9000F007C117D /* Base */,
|
|
||||||
);
|
|
||||||
name = LaunchScreen.storyboard;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXVariantGroup section */
|
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
|
||||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
|
||||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_COMMA = YES;
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
||||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
||||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_NO_COMMON_BLOCKS = YES;
|
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
VALIDATE_PRODUCT = YES;
|
|
||||||
};
|
|
||||||
name = Profile;
|
|
||||||
};
|
|
||||||
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
|
||||||
DEVELOPMENT_TEAM = S8QB4VV633;
|
|
||||||
ENABLE_BITCODE = NO;
|
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/Flutter",
|
|
||||||
);
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
||||||
LIBRARY_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/Flutter",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.mariamelnik.flutterDatePicker;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
};
|
|
||||||
name = Profile;
|
|
||||||
};
|
|
||||||
97C147031CF9000F007C117D /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
|
||||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_COMMA = YES;
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
||||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
||||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
||||||
ENABLE_TESTABILITY = YES;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
|
||||||
GCC_NO_COMMON_BLOCKS = YES;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
||||||
"DEBUG=1",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
97C147041CF9000F007C117D /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
|
||||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_COMMA = YES;
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
||||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
||||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_NO_COMMON_BLOCKS = YES;
|
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
VALIDATE_PRODUCT = YES;
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
97C147061CF9000F007C117D /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
|
||||||
ENABLE_BITCODE = NO;
|
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/Flutter",
|
|
||||||
);
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
||||||
LIBRARY_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/Flutter",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.mariamelnik.flutterDatePicker;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
97C147071CF9000F007C117D /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
|
||||||
ENABLE_BITCODE = NO;
|
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/Flutter",
|
|
||||||
);
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
||||||
LIBRARY_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/Flutter",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.mariamelnik.flutterDatePicker;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
/* End XCBuildConfiguration section */
|
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
|
||||||
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
97C147031CF9000F007C117D /* Debug */,
|
|
||||||
97C147041CF9000F007C117D /* Release */,
|
|
||||||
249021D3217E4FDB00AE95B9 /* Profile */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
97C147061CF9000F007C117D /* Debug */,
|
|
||||||
97C147071CF9000F007C117D /* Release */,
|
|
||||||
249021D4217E4FDB00AE95B9 /* Profile */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
|
||||||
};
|
|
||||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "self:">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0910"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
|
||||||
BuildableName = "Runner.app"
|
|
||||||
BlueprintName = "Runner"
|
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
language = ""
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
|
||||||
BuildableName = "Runner.app"
|
|
||||||
BlueprintName = "Runner"
|
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
language = ""
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
|
||||||
BuildableName = "Runner.app"
|
|
||||||
BlueprintName = "Runner"
|
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Profile"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
|
||||||
BuildableName = "Runner.app"
|
|
||||||
BlueprintName = "Runner"
|
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "group:Runner.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#import <Flutter/Flutter.h>
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
@interface AppDelegate : FlutterAppDelegate
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#include "AppDelegate.h"
|
|
||||||
#include "GeneratedPluginRegistrant.h"
|
|
||||||
|
|
||||||
@implementation AppDelegate
|
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application
|
|
||||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
||||||
[GeneratedPluginRegistrant registerWithRegistry:self];
|
|
||||||
// Override point for customization after application launch.
|
|
||||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"size" : "20x20",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-20x20@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "20x20",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-20x20@3x.png",
|
|
||||||
"scale" : "3x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-29x29@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-29x29@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-29x29@3x.png",
|
|
||||||
"scale" : "3x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-40x40@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-40x40@3x.png",
|
|
||||||
"scale" : "3x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "60x60",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-60x60@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "60x60",
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-60x60@3x.png",
|
|
||||||
"scale" : "3x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "20x20",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-20x20@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "20x20",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-20x20@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-29x29@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-29x29@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-40x40@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-40x40@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "76x76",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-76x76@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "76x76",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-76x76@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "83.5x83.5",
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "1024x1024",
|
|
||||||
"idiom" : "ios-marketing",
|
|
||||||
"filename" : "Icon-App-1024x1024@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"version" : 1,
|
|
||||||
"author" : "xcode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 564 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "LaunchImage.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "LaunchImage@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "LaunchImage@3x.png",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"version" : 1,
|
|
||||||
"author" : "xcode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 68 B |
|
Before Width: | Height: | Size: 68 B |
|
Before Width: | Height: | Size: 68 B |
@@ -1,5 +0,0 @@
|
|||||||
# Launch Screen Assets
|
|
||||||
|
|
||||||
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
|
||||||
|
|
||||||
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
|
||||||
<dependencies>
|
|
||||||
<deployment identifier="iOS"/>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
|
||||||
</dependencies>
|
|
||||||
<scenes>
|
|
||||||
<!--View Controller-->
|
|
||||||
<scene sceneID="EHf-IW-A2E">
|
|
||||||
<objects>
|
|
||||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
|
||||||
<layoutGuides>
|
|
||||||
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
|
||||||
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
|
||||||
</layoutGuides>
|
|
||||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
||||||
<subviews>
|
|
||||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
|
||||||
</imageView>
|
|
||||||
</subviews>
|
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<constraints>
|
|
||||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
|
||||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
|
||||||
</constraints>
|
|
||||||
</view>
|
|
||||||
</viewController>
|
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
||||||
</objects>
|
|
||||||
<point key="canvasLocation" x="53" y="375"/>
|
|
||||||
</scene>
|
|
||||||
</scenes>
|
|
||||||
<resources>
|
|
||||||
<image name="LaunchImage" width="168" height="185"/>
|
|
||||||
</resources>
|
|
||||||
</document>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
|
||||||
<dependencies>
|
|
||||||
<deployment identifier="iOS"/>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
|
||||||
</dependencies>
|
|
||||||
<scenes>
|
|
||||||
<!--Flutter View Controller-->
|
|
||||||
<scene sceneID="tne-QT-ifu">
|
|
||||||
<objects>
|
|
||||||
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
|
||||||
<layoutGuides>
|
|
||||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
|
||||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
|
||||||
</layoutGuides>
|
|
||||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
|
||||||
</view>
|
|
||||||
</viewController>
|
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
|
||||||
</objects>
|
|
||||||
</scene>
|
|
||||||
</scenes>
|
|
||||||
</document>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
//
|
|
||||||
// Generated file. Do not edit.
|
|
||||||
//
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#ifndef GeneratedPluginRegistrant_h
|
|
||||||
#define GeneratedPluginRegistrant_h
|
|
||||||
|
|
||||||
#import <Flutter/Flutter.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface GeneratedPluginRegistrant : NSObject
|
|
||||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
#endif /* GeneratedPluginRegistrant_h */
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
//
|
|
||||||
// Generated file. Do not edit.
|
|
||||||
//
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#import "GeneratedPluginRegistrant.h"
|
|
||||||
|
|
||||||
@implementation GeneratedPluginRegistrant
|
|
||||||
|
|
||||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<?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>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>flutter_date_picker</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
|
||||||
<true/>
|
|
||||||
<key>UILaunchStoryboardName</key>
|
|
||||||
<string>LaunchScreen</string>
|
|
||||||
<key>UIMainStoryboardFile</key>
|
|
||||||
<string>Main</string>
|
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
||||||
<false/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#import <Flutter/Flutter.h>
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#import "AppDelegate.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
|
||||||
@autoreleasepool {
|
|
||||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_material_color_picker/flutter_material_color_picker.dart';
|
|
||||||
|
|
||||||
/// Dialog with some Material colors ([materialColors]) to pick one of them.
|
|
||||||
class ColorPickerDialog extends StatefulWidget {
|
|
||||||
|
|
||||||
/// Initially selected color.
|
|
||||||
///
|
|
||||||
/// If pre-selected color is not from [materialColors] [Colors.blue] will be
|
|
||||||
/// used.
|
|
||||||
final Color selectedColor;
|
|
||||||
|
|
||||||
///
|
|
||||||
const ColorPickerDialog({
|
|
||||||
Key? key,
|
|
||||||
required this.selectedColor
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _ColorPickerDialogState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ColorPickerDialogState extends State<ColorPickerDialog> {
|
|
||||||
Color _mainColor = Colors.blue;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
bool isSelectedMaterial = materialColors.contains(widget.selectedColor);
|
|
||||||
if (isSelectedMaterial) {
|
|
||||||
_mainColor = widget.selectedColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
contentPadding: const EdgeInsets.all(6.0),
|
|
||||||
title: const Text("Color picker"),
|
|
||||||
content: MaterialColorPicker(
|
|
||||||
selectedColor: _mainColor,
|
|
||||||
allowShades: false,
|
|
||||||
onMainColorChange: _onMainColorChange,
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
child: const Text('CANCEL'),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop(null);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: const Text('SUBMIT'),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop(_mainColor);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onMainColorChange (Color? newColor) {
|
|
||||||
if (newColor == null) return;
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
_mainColor = newColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
// default with and height for the button container
|
|
||||||
const double _kBtnSize = 24.0;
|
|
||||||
|
|
||||||
/// Round colored button with title to select some style color.
|
|
||||||
class ColorSelectorBtn extends StatelessWidget {
|
|
||||||
/// Title near color button.
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
/// Color of the button.
|
|
||||||
final Color color;
|
|
||||||
|
|
||||||
/// onTap callback.
|
|
||||||
final VoidCallback showDialogFunction;
|
|
||||||
|
|
||||||
/// Size of the circle.
|
|
||||||
///
|
|
||||||
/// By default is [_kBtnSize].
|
|
||||||
final double colorBtnSize;
|
|
||||||
|
|
||||||
///
|
|
||||||
const ColorSelectorBtn(
|
|
||||||
{Key? key,
|
|
||||||
required this.title,
|
|
||||||
required this.color,
|
|
||||||
required this.showDialogFunction,
|
|
||||||
this.colorBtnSize = _kBtnSize})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Expanded(
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
GestureDetector(
|
|
||||||
onTap: showDialogFunction,
|
|
||||||
child: Container(
|
|
||||||
height: colorBtnSize,
|
|
||||||
width: colorBtnSize,
|
|
||||||
decoration: BoxDecoration(color: color, shape: BoxShape.circle),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
width: 8.0,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
title,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart' as dp;
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart';
|
|
||||||
|
|
||||||
import '../color_picker_dialog.dart';
|
|
||||||
import '../color_selector_btn.dart';
|
|
||||||
import '../event.dart';
|
|
||||||
|
|
||||||
/// Page with [dp.DayPicker].
|
|
||||||
class DayPickerPage extends StatefulWidget {
|
|
||||||
/// Custom events.
|
|
||||||
final List<Event> events;
|
|
||||||
|
|
||||||
///
|
|
||||||
const DayPickerPage({
|
|
||||||
Key? key,
|
|
||||||
this.events = const []
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _DayPickerPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DayPickerPageState extends State<DayPickerPage> {
|
|
||||||
DateTime _selectedDate = DateTime.now();
|
|
||||||
|
|
||||||
DateTime _firstDate = DateTime.now().subtract(Duration(days: 45));
|
|
||||||
DateTime _lastDate = DateTime.now().add(Duration(days: 45));
|
|
||||||
|
|
||||||
Color selectedDateStyleColor = Colors.blue;
|
|
||||||
Color selectedSingleDateDecorationColor = Colors.red;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
|
|
||||||
Color? bodyTextColor = Theme.of(context).textTheme.bodyLarge?.color;
|
|
||||||
if (bodyTextColor != null) selectedDateStyleColor = bodyTextColor;
|
|
||||||
|
|
||||||
selectedSingleDateDecorationColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
// add selected colors to default settings
|
|
||||||
dp.DatePickerRangeStyles styles = dp.DatePickerRangeStyles(
|
|
||||||
selectedDateStyle: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyLarge
|
|
||||||
?.copyWith(color: selectedDateStyleColor),
|
|
||||||
selectedSingleDateDecoration: BoxDecoration(
|
|
||||||
color: selectedSingleDateDecorationColor,
|
|
||||||
shape: BoxShape.circle
|
|
||||||
),
|
|
||||||
dayHeaderStyle: DayHeaderStyle(
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: Colors.red
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return Flex(
|
|
||||||
direction: MediaQuery.of(context).orientation == Orientation.portrait
|
|
||||||
? Axis.vertical
|
|
||||||
: Axis.horizontal,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: dp.DayPicker.single(
|
|
||||||
selectedDate: _selectedDate,
|
|
||||||
onChanged: _onSelectedDateChanged,
|
|
||||||
firstDate: _firstDate,
|
|
||||||
lastDate: _lastDate,
|
|
||||||
datePickerStyles: styles,
|
|
||||||
datePickerLayoutSettings: dp.DatePickerLayoutSettings(
|
|
||||||
maxDayPickerRowCount: 2,
|
|
||||||
showPrevMonthEnd: true,
|
|
||||||
showNextMonthStart: true
|
|
||||||
),
|
|
||||||
selectableDayPredicate: _isSelectableCustom,
|
|
||||||
eventDecorationBuilder: _eventDecorationBuilder,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
"Selected date styles",
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Text",
|
|
||||||
color: selectedDateStyleColor,
|
|
||||||
showDialogFunction: _showSelectedDateDialog,
|
|
||||||
colorBtnSize: 42.0,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Background",
|
|
||||||
color: selectedSingleDateDecorationColor,
|
|
||||||
showDialogFunction: _showSelectedBackgroundColorDialog,
|
|
||||||
colorBtnSize: 42.0,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text("Selected: $_selectedDate")
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// select text color of the selected date
|
|
||||||
void _showSelectedDateDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedDateStyleColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedDateStyleColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color of the selected date
|
|
||||||
void _showSelectedBackgroundColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedSingleDateDecorationColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedSingleDateDecorationColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectedDateChanged(DateTime newDate) {
|
|
||||||
setState(() {
|
|
||||||
_selectedDate = newDate;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
bool _isSelectableCustom (DateTime day) {
|
|
||||||
return day.weekday < 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
dp.EventDecoration? _eventDecorationBuilder(DateTime date) {
|
|
||||||
List<DateTime> eventsDates = widget.events
|
|
||||||
.map<DateTime>((Event e) => e.date)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
bool isEventDate = eventsDates.any((DateTime d) =>
|
|
||||||
date.year == d.year
|
|
||||||
&& date.month == d.month
|
|
||||||
&& d.day == date.day);
|
|
||||||
|
|
||||||
BoxDecoration roundedBorder = BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.deepOrange,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(3.0))
|
|
||||||
);
|
|
||||||
|
|
||||||
return isEventDate
|
|
||||||
? dp.EventDecoration(boxDecoration: roundedBorder)
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart' as dp;
|
|
||||||
|
|
||||||
import '../color_picker_dialog.dart';
|
|
||||||
import '../color_selector_btn.dart';
|
|
||||||
import '../event.dart';
|
|
||||||
|
|
||||||
/// Page with [dp.DayPicker] where many single days can be selected.
|
|
||||||
class DaysPickerPage extends StatefulWidget {
|
|
||||||
/// Custom events.
|
|
||||||
final List<Event> events;
|
|
||||||
|
|
||||||
///
|
|
||||||
const DaysPickerPage({
|
|
||||||
Key? key,
|
|
||||||
this.events = const []
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _DaysPickerPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DaysPickerPageState extends State<DaysPickerPage> {
|
|
||||||
List<DateTime> _selectedDates = [];
|
|
||||||
DateTime _firstDate = DateTime.now().subtract(Duration(days: 45));
|
|
||||||
DateTime _lastDate = DateTime.now().add(Duration(days: 45));
|
|
||||||
|
|
||||||
Color selectedDateStyleColor = Colors.blue;
|
|
||||||
Color selectedSingleDateDecorationColor = Colors.red;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
final now = DateTime.now();
|
|
||||||
|
|
||||||
_selectedDates = [
|
|
||||||
now,
|
|
||||||
now.subtract(Duration(days: 10)),
|
|
||||||
now.add(Duration(days: 7))
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
|
|
||||||
Color? bodyTextColor = Theme.of(context).textTheme.bodyLarge?.color;
|
|
||||||
if (bodyTextColor != null) selectedDateStyleColor = bodyTextColor;
|
|
||||||
|
|
||||||
selectedSingleDateDecorationColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
// add selected colors to default settings
|
|
||||||
dp.DatePickerRangeStyles styles = dp.DatePickerRangeStyles(
|
|
||||||
selectedDateStyle: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyLarge
|
|
||||||
?.copyWith(color: selectedDateStyleColor),
|
|
||||||
selectedSingleDateDecoration: BoxDecoration(
|
|
||||||
color: selectedSingleDateDecorationColor, shape: BoxShape.circle));
|
|
||||||
|
|
||||||
return Flex(
|
|
||||||
direction: MediaQuery.of(context).orientation == Orientation.portrait
|
|
||||||
? Axis.vertical
|
|
||||||
: Axis.horizontal,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: dp.DayPicker.multi(
|
|
||||||
selectedDates: _selectedDates,
|
|
||||||
onChanged: _onSelectedDateChanged,
|
|
||||||
firstDate: _firstDate,
|
|
||||||
lastDate: _lastDate,
|
|
||||||
datePickerStyles: styles,
|
|
||||||
datePickerLayoutSettings: dp.DatePickerLayoutSettings(
|
|
||||||
maxDayPickerRowCount: 2,
|
|
||||||
showPrevMonthEnd: true,
|
|
||||||
showNextMonthStart: true
|
|
||||||
),
|
|
||||||
selectableDayPredicate: _isSelectableCustom,
|
|
||||||
eventDecorationBuilder: _eventDecorationBuilder,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
"Selected date styles",
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Text",
|
|
||||||
color: selectedDateStyleColor,
|
|
||||||
showDialogFunction: _showSelectedDateDialog,
|
|
||||||
colorBtnSize: 42.0,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Background",
|
|
||||||
color: selectedSingleDateDecorationColor,
|
|
||||||
showDialogFunction: _showSelectedBackgroundColorDialog,
|
|
||||||
colorBtnSize: 42.0,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text("Selected: $_selectedDates")
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// select text color of the selected date
|
|
||||||
void _showSelectedDateDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedDateStyleColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedDateStyleColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color of the selected date
|
|
||||||
void _showSelectedBackgroundColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedSingleDateDecorationColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedSingleDateDecorationColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectedDateChanged(List<DateTime> newDates) {
|
|
||||||
setState(() {
|
|
||||||
_selectedDates = newDates;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
bool _isSelectableCustom (DateTime day) {
|
|
||||||
return day.weekday < 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
dp.EventDecoration? _eventDecorationBuilder(DateTime date) {
|
|
||||||
List<DateTime> eventsDates = widget.events
|
|
||||||
.map<DateTime>((Event e) => e.date)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
bool isEventDate = eventsDates.any((DateTime d) =>
|
|
||||||
date.year == d.year
|
|
||||||
&& date.month == d.month
|
|
||||||
&& d.day == date.day);
|
|
||||||
|
|
||||||
BoxDecoration roundedBorder = BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.deepOrange,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(3.0))
|
|
||||||
);
|
|
||||||
|
|
||||||
return isEventDate
|
|
||||||
? dp.EventDecoration(boxDecoration: roundedBorder)
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart' as dp;
|
|
||||||
|
|
||||||
import '../color_picker_dialog.dart';
|
|
||||||
import '../color_selector_btn.dart';
|
|
||||||
|
|
||||||
/// Page with the [dp.MonthPicker].
|
|
||||||
class MonthPickerPage extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _MonthPickerPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MonthPickerPageState extends State<MonthPickerPage> {
|
|
||||||
DateTime _firstDate = DateTime.now().subtract(Duration(days: 350));
|
|
||||||
DateTime _lastDate = DateTime.now().add(Duration(days: 350));
|
|
||||||
DateTime _selectedDate = DateTime.now();
|
|
||||||
|
|
||||||
Color selectedDateStyleColor = Colors.blue;
|
|
||||||
Color selectedSingleDateDecorationColor = Colors.red;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
|
|
||||||
Color? bodyTextColor = Theme.of(context).textTheme.bodyLarge?.color;
|
|
||||||
if (bodyTextColor != null) selectedDateStyleColor = bodyTextColor;
|
|
||||||
|
|
||||||
selectedSingleDateDecorationColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
// add selected colors to default settings
|
|
||||||
dp.DatePickerStyles styles = dp.DatePickerStyles(
|
|
||||||
selectedDateStyle: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyLarge
|
|
||||||
?.copyWith(color: selectedDateStyleColor),
|
|
||||||
selectedSingleDateDecoration: BoxDecoration(
|
|
||||||
color: selectedSingleDateDecorationColor, shape: BoxShape.circle));
|
|
||||||
|
|
||||||
return Flex(
|
|
||||||
direction: MediaQuery.of(context).orientation == Orientation.portrait
|
|
||||||
? Axis.vertical
|
|
||||||
: Axis.horizontal,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: dp.MonthPicker(
|
|
||||||
selectedDate: _selectedDate,
|
|
||||||
onChanged: _onSelectedDateChanged,
|
|
||||||
firstDate: _firstDate,
|
|
||||||
lastDate: _lastDate,
|
|
||||||
datePickerStyles: styles,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
"Selected date styles",
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Text",
|
|
||||||
color: selectedDateStyleColor,
|
|
||||||
showDialogFunction: _showSelectedDateDialog,
|
|
||||||
colorBtnSize: 42.0,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Background",
|
|
||||||
color: selectedSingleDateDecorationColor,
|
|
||||||
showDialogFunction: _showSelectedBackgroundColorDialog,
|
|
||||||
colorBtnSize: 42.0,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text("Selected: $_selectedDate")
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// select text color of the selected date
|
|
||||||
void _showSelectedDateDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedDateStyleColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedDateStyleColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color of the selected date
|
|
||||||
void _showSelectedBackgroundColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedSingleDateDecorationColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedSingleDateDecorationColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectedDateChanged(DateTime newDate) {
|
|
||||||
setState(() {
|
|
||||||
_selectedDate = newDate;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,273 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart';
|
|
||||||
|
|
||||||
import '../color_picker_dialog.dart';
|
|
||||||
import '../color_selector_btn.dart';
|
|
||||||
import '../event.dart';
|
|
||||||
|
|
||||||
/// Page with the [RangePicker].
|
|
||||||
class RangePickerPage extends StatefulWidget {
|
|
||||||
|
|
||||||
/// Custom events.
|
|
||||||
final List<Event> events;
|
|
||||||
|
|
||||||
///
|
|
||||||
const RangePickerPage({
|
|
||||||
Key? key,
|
|
||||||
this.events = const []
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _RangePickerPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RangePickerPageState extends State<RangePickerPage> {
|
|
||||||
DateTime _firstDate = DateTime.now().subtract(Duration(days: 345));
|
|
||||||
DateTime _lastDate = DateTime.now().add(Duration(days: 345));
|
|
||||||
DatePeriod _selectedPeriod = DatePeriod(
|
|
||||||
DateTime.now().subtract(Duration(days: 30)),
|
|
||||||
DateTime.now().subtract(Duration(days: 12))
|
|
||||||
);
|
|
||||||
|
|
||||||
Color selectedPeriodStartColor = Colors.blue;
|
|
||||||
Color selectedPeriodLastColor = Colors.blue;
|
|
||||||
Color selectedPeriodMiddleColor = Colors.blue;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
|
|
||||||
selectedPeriodLastColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
selectedPeriodMiddleColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
selectedPeriodStartColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
// add selected colors to default settings
|
|
||||||
DatePickerRangeStyles styles = DatePickerRangeStyles(
|
|
||||||
selectedPeriodLastDecoration: BoxDecoration(
|
|
||||||
color: selectedPeriodLastColor,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topRight: Radius.circular(24.0),
|
|
||||||
bottomRight: Radius.circular(24.0))),
|
|
||||||
selectedPeriodStartDecoration: BoxDecoration(
|
|
||||||
color: selectedPeriodStartColor,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(24.0),
|
|
||||||
bottomLeft: Radius.circular(24.0)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
selectedPeriodMiddleDecoration: BoxDecoration(
|
|
||||||
color: selectedPeriodMiddleColor, shape: BoxShape.rectangle),
|
|
||||||
nextIcon: const Icon(Icons.arrow_right),
|
|
||||||
prevIcon: const Icon(Icons.arrow_left),
|
|
||||||
dayHeaderStyleBuilder: _dayHeaderStyleBuilder
|
|
||||||
);
|
|
||||||
|
|
||||||
return Flex(
|
|
||||||
direction: MediaQuery.of(context).orientation == Orientation.portrait
|
|
||||||
? Axis.vertical
|
|
||||||
: Axis.horizontal,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: RangePicker(
|
|
||||||
initiallyShowDate: DateTime.now(),
|
|
||||||
selectedPeriod: _selectedPeriod,
|
|
||||||
onChanged: _onSelectedDateChanged,
|
|
||||||
firstDate: _firstDate,
|
|
||||||
lastDate: _lastDate,
|
|
||||||
datePickerStyles: styles,
|
|
||||||
eventDecorationBuilder: _eventDecorationBuilder,
|
|
||||||
selectableDayPredicate: _isSelectableCustom,
|
|
||||||
onSelectionError: _onSelectionError,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
"Selected date styles",
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
_stylesBlock(),
|
|
||||||
_selectedBlock()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Block with show information about selected date
|
|
||||||
// and boundaries of the selected period.
|
|
||||||
Widget _selectedBlock() => Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
_selectedPeriod != null
|
|
||||||
? Column(children: <Widget>[
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
|
||||||
child: Text("Selected period boundaries:"),
|
|
||||||
),
|
|
||||||
Text(_selectedPeriod.start.toString()),
|
|
||||||
Text(_selectedPeriod.end.toString()),
|
|
||||||
])
|
|
||||||
: Container()
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
// block with color buttons inside
|
|
||||||
Widget _stylesBlock() => Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Start",
|
|
||||||
color: selectedPeriodStartColor,
|
|
||||||
showDialogFunction: _showSelectedStartColorDialog),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Middle",
|
|
||||||
color: selectedPeriodMiddleColor,
|
|
||||||
showDialogFunction: _showSelectedMiddleColorDialog),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "End",
|
|
||||||
color: selectedPeriodLastColor,
|
|
||||||
showDialogFunction: _showSelectedEndColorDialog),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// select background color for the first date of the selected period
|
|
||||||
void _showSelectedStartColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedPeriodStartColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPeriodStartColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color for the last date of the selected period
|
|
||||||
void _showSelectedEndColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedPeriodLastColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPeriodLastColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color for the middle dates of the selected period
|
|
||||||
void _showSelectedMiddleColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedPeriodMiddleColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPeriodMiddleColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectedDateChanged(DatePeriod newPeriod) {
|
|
||||||
setState(() {
|
|
||||||
_selectedPeriod = newPeriod;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
EventDecoration? _eventDecorationBuilder(DateTime date) {
|
|
||||||
List<DateTime> eventsDates = widget.events
|
|
||||||
.map<DateTime>((Event e) => e.date)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
bool isEventDate = eventsDates.any((DateTime d) =>
|
|
||||||
date.year == d.year
|
|
||||||
&& date.month == d.month
|
|
||||||
&& d.day == date.day);
|
|
||||||
|
|
||||||
BoxDecoration roundedBorder = BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.green,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(3.0))
|
|
||||||
);
|
|
||||||
|
|
||||||
return isEventDate
|
|
||||||
? EventDecoration(boxDecoration: roundedBorder)
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
bool _isSelectableCustom (DateTime day) {
|
|
||||||
DateTime now = DateTime.now();
|
|
||||||
DateTime yesterday = now.subtract(Duration(days: 1));
|
|
||||||
DateTime tomorrow = now.add(Duration(days: 1));
|
|
||||||
bool isYesterday = sameDate(day, yesterday);
|
|
||||||
bool isTomorrow = sameDate(day, tomorrow);
|
|
||||||
|
|
||||||
return !isYesterday && !isTomorrow;
|
|
||||||
|
|
||||||
// return true;
|
|
||||||
// return day.weekday < 6;
|
|
||||||
// return day.day != DateTime.now().add(Duration(days: 7)).day ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectionError(UnselectablePeriodException exception) {
|
|
||||||
DatePeriod errorPeriod = exception.period;
|
|
||||||
|
|
||||||
// If user supposed to set another start of the period.
|
|
||||||
bool selectStart = _selectedPeriod.start != errorPeriod.start;
|
|
||||||
|
|
||||||
DateTime newSelection = selectStart
|
|
||||||
? errorPeriod.start
|
|
||||||
: errorPeriod.end;
|
|
||||||
|
|
||||||
DatePeriod newPeriod = DatePeriod(newSelection, newSelection);
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
_selectedPeriod = newPeriod;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 0 is Sunday, 6 is Saturday
|
|
||||||
DayHeaderStyle _dayHeaderStyleBuilder(int weekday) {
|
|
||||||
bool isWeekend = weekday == 0 || weekday == 6;
|
|
||||||
|
|
||||||
return DayHeaderStyle(
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: isWeekend ? Colors.red : Colors.teal
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool sameDate(DateTime first, DateTime second) {
|
|
||||||
return first.year == second.year && first.month == second.month && first.day == second.day;
|
|
||||||
}
|
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart';
|
|
||||||
|
|
||||||
import '../event.dart';
|
|
||||||
|
|
||||||
/// Page with the [RangePicker] styled according to issue:
|
|
||||||
/// https://github.com/MariaMelnik/flutter_date_pickers/issues/49
|
|
||||||
class RangePickerPageStyled extends StatefulWidget {
|
|
||||||
|
|
||||||
/// Custom events.
|
|
||||||
final List<Event> events;
|
|
||||||
|
|
||||||
///
|
|
||||||
const RangePickerPageStyled({
|
|
||||||
Key? key,
|
|
||||||
this.events = const []
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _RangePickerPageStyledState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RangePickerPageStyledState extends State<RangePickerPageStyled> {
|
|
||||||
DateTime _firstDate = DateTime.now().subtract(Duration(days: 345));
|
|
||||||
DateTime _lastDate = DateTime.now().add(Duration(days: 345));
|
|
||||||
DatePeriod _selectedPeriod = DatePeriod(
|
|
||||||
DateTime.now().subtract(Duration(days: 4)),
|
|
||||||
DateTime.now().add(Duration(days: 8))
|
|
||||||
);
|
|
||||||
|
|
||||||
Color selectedPeriodStartColor = Colors.blue;
|
|
||||||
Color selectedPeriodLastColor = Colors.blue;
|
|
||||||
Color selectedPeriodMiddleColor = Colors.blue;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
DateTime selectedPeriodStart = DateTime.now().subtract(Duration(days: 4));
|
|
||||||
DateTime selectedPeriodEnd = DateTime.now().add(Duration(days: 8));
|
|
||||||
_selectedPeriod = DatePeriod(selectedPeriodStart, selectedPeriodEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
|
|
||||||
// defaults for styles
|
|
||||||
selectedPeriodLastColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
selectedPeriodMiddleColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
selectedPeriodStartColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
Color middleBgColor = Color.fromRGBO(237, 237, 250, 1);
|
|
||||||
DecorationImage circleImg = DecorationImage(
|
|
||||||
image: AssetImage('images/bg.png'),
|
|
||||||
fit: BoxFit.contain
|
|
||||||
);
|
|
||||||
|
|
||||||
// add selected colors to default settings
|
|
||||||
DatePickerRangeStyles styles = DatePickerRangeStyles(
|
|
||||||
selectedPeriodLastDecoration: BoxDecoration(
|
|
||||||
color: middleBgColor,
|
|
||||||
gradient: LinearGradient(
|
|
||||||
colors: [middleBgColor, Colors.transparent],
|
|
||||||
stops: [0.5, 0.5]
|
|
||||||
),
|
|
||||||
image: circleImg,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topRight: Radius.circular(24.0),
|
|
||||||
bottomRight: Radius.circular(24.0))
|
|
||||||
),
|
|
||||||
selectedPeriodStartDecoration: BoxDecoration(
|
|
||||||
color: middleBgColor,
|
|
||||||
gradient: LinearGradient(
|
|
||||||
colors: [Colors.transparent, middleBgColor,],
|
|
||||||
stops: [0.5, 0.5]
|
|
||||||
),
|
|
||||||
image: circleImg,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(24.0),
|
|
||||||
bottomLeft: Radius.circular(24.0)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
selectedPeriodMiddleDecoration: BoxDecoration(
|
|
||||||
color: middleBgColor,
|
|
||||||
shape: BoxShape.rectangle
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Flex(
|
|
||||||
direction: MediaQuery.of(context).orientation == Orientation.portrait
|
|
||||||
? Axis.vertical
|
|
||||||
: Axis.horizontal,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: RangePicker(
|
|
||||||
selectedPeriod: _selectedPeriod,
|
|
||||||
onChanged: _onSelectedDateChanged,
|
|
||||||
firstDate: _firstDate,
|
|
||||||
lastDate: _lastDate,
|
|
||||||
datePickerStyles: styles,
|
|
||||||
eventDecorationBuilder: _eventDecorationBuilder,
|
|
||||||
selectableDayPredicate: _isSelectableCustom,
|
|
||||||
onSelectionError: _onSelectionError,
|
|
||||||
datePickerLayoutSettings: DatePickerLayoutSettings(
|
|
||||||
showNextMonthStart: true,
|
|
||||||
showPrevMonthEnd: true
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
"Selected date styles",
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
_selectedBlock()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Block with show information about selected date
|
|
||||||
// and boundaries of the selected period.
|
|
||||||
Widget _selectedBlock() => Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
_selectedPeriod != null
|
|
||||||
? Column(children: <Widget>[
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
|
||||||
child: Text("Selected period boundaries:"),
|
|
||||||
),
|
|
||||||
Text(_selectedPeriod.start.toString()),
|
|
||||||
Text(_selectedPeriod.end.toString()),
|
|
||||||
])
|
|
||||||
: Container()
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
void _onSelectedDateChanged(DatePeriod newPeriod) {
|
|
||||||
setState(() {
|
|
||||||
_selectedPeriod = newPeriod;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
EventDecoration? _eventDecorationBuilder(DateTime date) {
|
|
||||||
List<DateTime> eventsDates = widget.events
|
|
||||||
.map<DateTime>((Event e) => e.date)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
bool isEventDate = eventsDates.any((DateTime d) =>
|
|
||||||
date.year == d.year
|
|
||||||
&& date.month == d.month
|
|
||||||
&& d.day == date.day);
|
|
||||||
|
|
||||||
BoxDecoration roundedBorder = BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.green,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(3.0))
|
|
||||||
);
|
|
||||||
|
|
||||||
return isEventDate
|
|
||||||
? EventDecoration(boxDecoration: roundedBorder)
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
bool _isSelectableCustom (DateTime day) {
|
|
||||||
DateTime now = DateTime.now();
|
|
||||||
DateTime yesterday = now.subtract(Duration(days: 1));
|
|
||||||
DateTime tomorrow = now.add(Duration(days: 1));
|
|
||||||
bool isYesterday = _sameDate(day, yesterday);
|
|
||||||
bool isTomorrow = _sameDate(day, tomorrow);
|
|
||||||
|
|
||||||
return !isYesterday && !isTomorrow;
|
|
||||||
|
|
||||||
// return true;
|
|
||||||
// return day.weekday < 6;
|
|
||||||
// return day.day != DateTime.now().add(Duration(days: 7)).day ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectionError(UnselectablePeriodException exception) {
|
|
||||||
DatePeriod errorPeriod = exception.period;
|
|
||||||
|
|
||||||
// If user supposed to set another start of the period.
|
|
||||||
bool selectStart = _selectedPeriod.start != errorPeriod.start;
|
|
||||||
|
|
||||||
DateTime newSelection = selectStart
|
|
||||||
? errorPeriod.start
|
|
||||||
: errorPeriod.end;
|
|
||||||
|
|
||||||
DatePeriod newPeriod = DatePeriod(newSelection, newSelection);
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
_selectedPeriod = newPeriod;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 0 is Sunday, 6 is Saturday
|
|
||||||
DayHeaderStyle _dayHeaderStyleBuilder(int weekday) {
|
|
||||||
bool isWeekend = weekday == 0 || weekday == 6;
|
|
||||||
|
|
||||||
return DayHeaderStyle(
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: isWeekend ? Colors.red : Colors.teal
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool _sameDate(DateTime first, DateTime second) =>
|
|
||||||
first.year == second.year
|
|
||||||
&& first.month == second.month
|
|
||||||
&& first.day == second.day;
|
|
||||||
@@ -1,239 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_date_pickers/flutter_date_pickers.dart';
|
|
||||||
|
|
||||||
import '../color_picker_dialog.dart';
|
|
||||||
import '../color_selector_btn.dart';
|
|
||||||
import '../event.dart';
|
|
||||||
|
|
||||||
/// Page with the [WeekPicker].
|
|
||||||
class WeekPickerPage extends StatefulWidget {
|
|
||||||
/// Custom events.
|
|
||||||
final List<Event> events;
|
|
||||||
|
|
||||||
///
|
|
||||||
const WeekPickerPage({
|
|
||||||
Key? key,
|
|
||||||
this.events = const []
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => _WeekPickerPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _WeekPickerPageState extends State<WeekPickerPage> {
|
|
||||||
DateTime _selectedDate = DateTime.now();
|
|
||||||
DateTime _firstDate = DateTime.now().subtract(Duration(days: 45));
|
|
||||||
DateTime _lastDate = DateTime.now().add(Duration(days: 45));
|
|
||||||
DatePeriod? _selectedPeriod;
|
|
||||||
|
|
||||||
Color selectedPeriodStartColor = Colors.blue;
|
|
||||||
Color selectedPeriodLastColor = Colors.blue;
|
|
||||||
Color selectedPeriodMiddleColor = Colors.blue;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
|
|
||||||
// defaults for styles
|
|
||||||
selectedPeriodLastColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
selectedPeriodMiddleColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
selectedPeriodStartColor = Theme.of(context).colorScheme.secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
// add selected colors to default settings
|
|
||||||
DatePickerRangeStyles styles = DatePickerRangeStyles(
|
|
||||||
selectedPeriodLastDecoration: BoxDecoration(
|
|
||||||
color: selectedPeriodLastColor,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topRight: Radius.circular(10.0),
|
|
||||||
bottomRight: Radius.circular(10.0))),
|
|
||||||
selectedPeriodStartDecoration: BoxDecoration(
|
|
||||||
color: selectedPeriodStartColor,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(10.0), bottomLeft: Radius.circular(10.0)),
|
|
||||||
),
|
|
||||||
selectedPeriodMiddleDecoration: BoxDecoration(
|
|
||||||
color: selectedPeriodMiddleColor, shape: BoxShape.rectangle),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Flex(
|
|
||||||
direction: MediaQuery.of(context).orientation == Orientation.portrait
|
|
||||||
? Axis.vertical
|
|
||||||
: Axis.horizontal,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: WeekPicker(
|
|
||||||
selectedDate: _selectedDate,
|
|
||||||
onChanged: _onSelectedDateChanged,
|
|
||||||
firstDate: _firstDate,
|
|
||||||
lastDate: _lastDate,
|
|
||||||
datePickerStyles: styles,
|
|
||||||
onSelectionError: _onSelectionError,
|
|
||||||
selectableDayPredicate: _isSelectableCustom,
|
|
||||||
eventDecorationBuilder: _eventDecorationBuilder,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
"Selected date styles",
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
_stylesBlock(),
|
|
||||||
_selectedBlock()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// block witt color buttons insede
|
|
||||||
Widget _stylesBlock() => Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Start",
|
|
||||||
color: selectedPeriodStartColor,
|
|
||||||
showDialogFunction: _showSelectedStartColorDialog),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "Middle",
|
|
||||||
color: selectedPeriodMiddleColor,
|
|
||||||
showDialogFunction: _showSelectedMiddleColorDialog),
|
|
||||||
SizedBox(
|
|
||||||
width: 12.0,
|
|
||||||
),
|
|
||||||
ColorSelectorBtn(
|
|
||||||
title: "End",
|
|
||||||
color: selectedPeriodLastColor,
|
|
||||||
showDialogFunction: _showSelectedEndColorDialog),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Block with information about selected date
|
|
||||||
// and boundaries of the selected period.
|
|
||||||
Widget _selectedBlock() => Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
|
||||||
child: Text("Selected: $_selectedDate"),
|
|
||||||
),
|
|
||||||
_selectedPeriod != null
|
|
||||||
? Column(children: <Widget>[
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
|
||||||
child: Text("Selected period boundaries:"),
|
|
||||||
),
|
|
||||||
Text(_selectedPeriod!.start.toString()),
|
|
||||||
Text(_selectedPeriod!.end.toString()),
|
|
||||||
])
|
|
||||||
: Container()
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
// select background color for the first date of the selected period
|
|
||||||
void _showSelectedStartColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedPeriodStartColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPeriodStartColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color for the last date of the selected period
|
|
||||||
void _showSelectedEndColorDialog() async {
|
|
||||||
Color? newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedPeriodLastColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPeriodLastColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// select background color for the middle dates of the selected period
|
|
||||||
void _showSelectedMiddleColorDialog() async {
|
|
||||||
Color newSelectedColor = await showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => ColorPickerDialog(
|
|
||||||
selectedColor: selectedPeriodMiddleColor,
|
|
||||||
));
|
|
||||||
|
|
||||||
if (newSelectedColor != null) {
|
|
||||||
setState(() {
|
|
||||||
selectedPeriodMiddleColor = newSelectedColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectedDateChanged(DatePeriod newPeriod) {
|
|
||||||
setState(() {
|
|
||||||
_selectedDate = newPeriod.start;
|
|
||||||
_selectedPeriod = newPeriod;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onSelectionError(Object e){
|
|
||||||
if (e is UnselectablePeriodException) print("catch error: $e");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
bool _isSelectableCustom (DateTime day) {
|
|
||||||
// return day.weekday < 6;
|
|
||||||
return day.day != DateTime.now().add(Duration(days: 7)).day ;
|
|
||||||
}
|
|
||||||
|
|
||||||
EventDecoration? _eventDecorationBuilder(DateTime date) {
|
|
||||||
List<DateTime> eventsDates = widget.events
|
|
||||||
.map<DateTime>((Event e) => e.date)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
bool isEventDate = eventsDates.any((DateTime d) => date.year == d.year
|
|
||||||
&& date.month == d.month
|
|
||||||
&& d.day == date.day);
|
|
||||||
|
|
||||||
if (!isEventDate) return null;
|
|
||||||
|
|
||||||
BoxDecoration roundedBorder = BoxDecoration(
|
|
||||||
color: Colors.blue,
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.blue,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(3.0))
|
|
||||||
);
|
|
||||||
|
|
||||||
TextStyle? whiteText = Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyMedium
|
|
||||||
?.copyWith(color: Colors.white);
|
|
||||||
|
|
||||||
return isEventDate
|
|
||||||
? EventDecoration(boxDecoration: roundedBorder, textStyle: whiteText)
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/// Event for the date pickers.
|
|
||||||
class Event {
|
|
||||||
|
|
||||||
/// Event's date.
|
|
||||||
final DateTime date;
|
|
||||||
|
|
||||||
/// Event's title.
|
|
||||||
final String dis;
|
|
||||||
|
|
||||||
///
|
|
||||||
Event(this.date, this.dis)
|
|
||||||
: assert(date != null),
|
|
||||||
assert(dis != null);
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
||||||
|
|
||||||
import 'date_pickers_widgets/day_picker_page.dart';
|
|
||||||
import 'date_pickers_widgets/days_picker_page.dart';
|
|
||||||
import 'date_pickers_widgets/month_picker_page.dart';
|
|
||||||
import 'date_pickers_widgets/range_picker_page.dart';
|
|
||||||
import 'date_pickers_widgets/week_picker_page.dart';
|
|
||||||
|
|
||||||
import 'event.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
runApp(MyApp());
|
|
||||||
}
|
|
||||||
|
|
||||||
///
|
|
||||||
class MyApp extends StatelessWidget {
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return MaterialApp(
|
|
||||||
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
|
||||||
supportedLocales: [
|
|
||||||
const Locale('en', 'US'), // American English
|
|
||||||
const Locale('ru', 'RU'), // Russian
|
|
||||||
const Locale("pt") // Portuguese
|
|
||||||
],
|
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
title: 'Date pickers demo',
|
|
||||||
theme: ThemeData(
|
|
||||||
primarySwatch: Colors.blueGrey,
|
|
||||||
),
|
|
||||||
home: MyHomePage(
|
|
||||||
title: 'flutter_date_pickers Demo',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Start page.
|
|
||||||
class MyHomePage extends StatefulWidget {
|
|
||||||
/// Page title.
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
///
|
|
||||||
MyHomePage({
|
|
||||||
required this.title,
|
|
||||||
Key? key,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_MyHomePageState createState() => _MyHomePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
|
||||||
DateTime startOfPeriod = DateTime.now().subtract(Duration(days: 10));
|
|
||||||
DateTime endOfPeriod = DateTime.now().add(Duration(days: 10));
|
|
||||||
int _selectedTab = 0;
|
|
||||||
|
|
||||||
final List<Widget> datePickers = <Widget>[
|
|
||||||
DayPickerPage(events: events,),
|
|
||||||
DaysPickerPage(),
|
|
||||||
WeekPickerPage(events: events,),
|
|
||||||
RangePickerPage(events: events,),
|
|
||||||
MonthPickerPage()
|
|
||||||
];
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(
|
|
||||||
widget.title,
|
|
||||||
style: TextStyle(letterSpacing: 1.15),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: datePickers[_selectedTab],
|
|
||||||
bottomNavigationBar: Theme(
|
|
||||||
data: Theme.of(context).copyWith(
|
|
||||||
canvasColor: Colors.blueGrey,
|
|
||||||
textTheme: Theme.of(context).textTheme.copyWith(
|
|
||||||
bodySmall: TextStyle(color: Colors.white.withOpacity(0.5)))),
|
|
||||||
child: BottomNavigationBar(
|
|
||||||
type: BottomNavigationBarType.fixed,
|
|
||||||
items: [
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(Icons.date_range), label: "Day"),
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(Icons.date_range), label: "Days"),
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(Icons.date_range), label: "Week"),
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(Icons.date_range), label: "Range"),
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(Icons.date_range), label: "Month"),
|
|
||||||
],
|
|
||||||
fixedColor: Colors.yellow,
|
|
||||||
currentIndex: _selectedTab,
|
|
||||||
onTap: (newIndex) {
|
|
||||||
setState(() {
|
|
||||||
_selectedTab = newIndex;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Mock events.
|
|
||||||
final List<Event> events = [
|
|
||||||
Event(DateTime.now(), "Today event"),
|
|
||||||
Event(DateTime.now().subtract(Duration(days: 3)), "Ev1"),
|
|
||||||
Event(DateTime.now().subtract(Duration(days: 13)), "Ev2"),
|
|
||||||
Event(DateTime.now().subtract(Duration(days: 30)), "Ev3"),
|
|
||||||
Event(DateTime.now().add(Duration(days: 3)), "Ev4"),
|
|
||||||
Event(DateTime.now().add(Duration(days: 13)), "Ev5"),
|
|
||||||
Event(DateTime.now().add(Duration(days: 30)), "Ev6"),
|
|
||||||
];
|
|
||||||
@@ -1,233 +0,0 @@
|
|||||||
# Generated by pub
|
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
|
||||||
packages:
|
|
||||||
async:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: async
|
|
||||||
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.13.1"
|
|
||||||
boolean_selector:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: boolean_selector
|
|
||||||
sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.0"
|
|
||||||
characters:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: characters
|
|
||||||
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.4.1"
|
|
||||||
charcode:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: charcode
|
|
||||||
sha256: "8e36feea6de5ea69f2199f29cf42a450a855738c498b57c0b980e2d3cca9c362"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
clock:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: clock
|
|
||||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.2"
|
|
||||||
collection:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: collection
|
|
||||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.19.1"
|
|
||||||
cupertino_icons:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: cupertino_icons
|
|
||||||
sha256: caac504f942f41dfadcf45229ce8c47065b93919a12739f20d6173a883c5ec73
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.2"
|
|
||||||
fake_async:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: fake_async
|
|
||||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.3"
|
|
||||||
flutter:
|
|
||||||
dependency: "direct main"
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
flutter_date_pickers:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
path: ".."
|
|
||||||
relative: true
|
|
||||||
source: path
|
|
||||||
version: "0.2.4"
|
|
||||||
flutter_localizations:
|
|
||||||
dependency: "direct main"
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
flutter_material_color_picker:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_material_color_picker
|
|
||||||
sha256: ca1e7749d228c9155ea24bce98e647cdbffa350e6f334f6c001f841cd3d9c987
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
flutter_test:
|
|
||||||
dependency: "direct dev"
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
intl:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: intl
|
|
||||||
sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.20.3"
|
|
||||||
leak_tracker:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: leak_tracker
|
|
||||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "11.0.2"
|
|
||||||
leak_tracker_flutter_testing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: leak_tracker_flutter_testing
|
|
||||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.10"
|
|
||||||
leak_tracker_testing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: leak_tracker_testing
|
|
||||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.2"
|
|
||||||
matcher:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: matcher
|
|
||||||
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.12.20"
|
|
||||||
material_color_utilities:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: material_color_utilities
|
|
||||||
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.13.0"
|
|
||||||
meta:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: meta
|
|
||||||
sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.19.0"
|
|
||||||
path:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path
|
|
||||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.9.1"
|
|
||||||
sky_engine:
|
|
||||||
dependency: transitive
|
|
||||||
description: flutter
|
|
||||||
source: sdk
|
|
||||||
version: "0.0.0"
|
|
||||||
source_span:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: source_span
|
|
||||||
sha256: f4b22294de9a549967d0033d4f30fcad4f0afc200f4bf58e82d815725feec70c
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.8.0"
|
|
||||||
stack_trace:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: stack_trace
|
|
||||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.12.1"
|
|
||||||
stream_channel:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: stream_channel
|
|
||||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.4"
|
|
||||||
string_scanner:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: string_scanner
|
|
||||||
sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
term_glyph:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: term_glyph
|
|
||||||
sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
test_api:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: test_api
|
|
||||||
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.12"
|
|
||||||
vector_math:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: vector_math
|
|
||||||
sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.4.2"
|
|
||||||
vm_service:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: vm_service
|
|
||||||
sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "15.2.0"
|
|
||||||
sdks:
|
|
||||||
dart: ">=3.11.0-0 <4.0.0"
|
|
||||||
flutter: ">=3.18.0-18.0.pre.54"
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
name: flutter_date_picker
|
|
||||||
description: A new Flutter application.
|
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
|
||||||
# followed by an optional build number separated by a +.
|
|
||||||
# Both the version and the builder number may be overridden in flutter
|
|
||||||
# build by specifying --build-name and --build-number, respectively.
|
|
||||||
# In Android, build-name is used as versionName while build-number used as versionCode.
|
|
||||||
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
|
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
|
||||||
# Read more about iOS versioning at
|
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
|
||||||
version: 1.0.0+1
|
|
||||||
|
|
||||||
environment:
|
|
||||||
sdk: ">=2.12.0 <3.0.0"
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
flutter:
|
|
||||||
sdk: flutter
|
|
||||||
flutter_localizations:
|
|
||||||
sdk: flutter
|
|
||||||
flutter_material_color_picker: ^1.1.0
|
|
||||||
flutter_date_pickers:
|
|
||||||
path: ../
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
|
||||||
cupertino_icons: ^1.0.2
|
|
||||||
|
|
||||||
dev_dependencies:
|
|
||||||
flutter_test:
|
|
||||||
sdk: flutter
|
|
||||||
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
|
||||||
# following page: https://www.dartlang.org/tools/pub/pubspec
|
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
|
||||||
flutter:
|
|
||||||
|
|
||||||
# The following line ensures that the Material Icons font is
|
|
||||||
# included with your application, so that you can use the icons in
|
|
||||||
# the material Icons class.
|
|
||||||
uses-material-design: true
|
|
||||||
|
|
||||||
# To add assets to your application, add an assets section, like this:
|
|
||||||
assets:
|
|
||||||
- images/bg.png
|
|
||||||
# - images/a_dot_ham.jpeg
|
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
|
||||||
# https://flutter.io/assets-and-images/#resolution-aware.
|
|
||||||
|
|
||||||
# For details regarding adding assets from package dependencies, see
|
|
||||||
# https://flutter.io/assets-and-images/#from-packages
|
|
||||||
|
|
||||||
# To add custom fonts to your application, add a fonts section here,
|
|
||||||
# in this "flutter" section. Each entry in this list should have a
|
|
||||||
# "family" key with the font family name, and a "fonts" key with a
|
|
||||||
# list giving the asset and other descriptors for the font. For
|
|
||||||
# example:
|
|
||||||
# fonts:
|
|
||||||
# - family: Schyler
|
|
||||||
# fonts:
|
|
||||||
# - asset: fonts/Schyler-Regular.ttf
|
|
||||||
# - asset: fonts/Schyler-Italic.ttf
|
|
||||||
# style: italic
|
|
||||||
# - family: Trajan Pro
|
|
||||||
# fonts:
|
|
||||||
# - asset: fonts/TrajanPro.ttf
|
|
||||||
# - asset: fonts/TrajanPro_Bold.ttf
|
|
||||||
# weight: 700
|
|
||||||
#
|
|
||||||
# For details regarding fonts from package dependencies,
|
|
||||||
# see https://flutter.io/custom-fonts/#from-packages
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?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/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 +0,0 @@
|
|||||||
export 'package:flutter_date_pickers/src/date_period.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/date_picker_keys.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/layout_settings.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/date_picker_styles.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/event_decoration.dart';
|
|
||||||
|
|
||||||
export 'package:flutter_date_pickers/src/day_picker.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/week_picker.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/month_picker.dart';
|
|
||||||
export 'package:flutter_date_pickers/src/range_picker.dart';
|
|
||||||
|
|
||||||
export 'package:flutter_date_pickers/src/unselectable_period_error.dart';
|
|
||||||
@@ -1,347 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'date_picker_mixin.dart';
|
|
||||||
import 'date_picker_styles.dart';
|
|
||||||
import 'day_type.dart';
|
|
||||||
import 'event_decoration.dart';
|
|
||||||
import 'i_selectable_picker.dart';
|
|
||||||
import 'layout_settings.dart';
|
|
||||||
import 'utils.dart';
|
|
||||||
|
|
||||||
/// Widget for date pickers based on days and cover entire month.
|
|
||||||
/// Each cell of this picker is day.
|
|
||||||
class DayBasedPicker<T> extends StatelessWidget with CommonDatePickerFunctions {
|
|
||||||
/// Selection logic.
|
|
||||||
final ISelectablePicker selectablePicker;
|
|
||||||
|
|
||||||
/// The current date at the time the picker is displayed.
|
|
||||||
final DateTime currentDate;
|
|
||||||
|
|
||||||
/// The earliest date the user is permitted to pick.
|
|
||||||
/// (only year, month and day matter, time doesn't matter)
|
|
||||||
final DateTime firstDate;
|
|
||||||
|
|
||||||
/// The latest date the user is permitted to pick.
|
|
||||||
/// (only year, month and day matter, time doesn't matter)
|
|
||||||
final DateTime lastDate;
|
|
||||||
|
|
||||||
/// The month whose days are displayed by this picker.
|
|
||||||
final DateTime displayedMonth;
|
|
||||||
|
|
||||||
/// Layout settings what can be customized by user
|
|
||||||
final DatePickerLayoutSettings datePickerLayoutSettings;
|
|
||||||
|
|
||||||
/// Key fo selected month (useful for integration tests)
|
|
||||||
final Key? selectedPeriodKey;
|
|
||||||
|
|
||||||
/// Styles what can be customized by user
|
|
||||||
final DatePickerRangeStyles datePickerStyles;
|
|
||||||
|
|
||||||
/// Builder to get event decoration for each date.
|
|
||||||
///
|
|
||||||
/// All event styles are overridden by selected styles
|
|
||||||
/// except days with dayType is [DayType.notSelected].
|
|
||||||
final EventDecorationBuilder? eventDecorationBuilder;
|
|
||||||
|
|
||||||
/// Localizations used to get strings for prev/next button tooltips,
|
|
||||||
/// weekday headers and display values for days numbers.
|
|
||||||
final MaterialLocalizations localizations;
|
|
||||||
|
|
||||||
/// Creates main date picker view where every cell is day.
|
|
||||||
DayBasedPicker(
|
|
||||||
{Key? key,
|
|
||||||
required this.currentDate,
|
|
||||||
required this.firstDate,
|
|
||||||
required this.lastDate,
|
|
||||||
required this.displayedMonth,
|
|
||||||
required this.datePickerLayoutSettings,
|
|
||||||
required this.datePickerStyles,
|
|
||||||
required this.selectablePicker,
|
|
||||||
required this.localizations,
|
|
||||||
this.selectedPeriodKey,
|
|
||||||
this.eventDecorationBuilder})
|
|
||||||
: assert(!firstDate.isAfter(lastDate)),
|
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final List<Widget> labels = <Widget>[];
|
|
||||||
|
|
||||||
List<Widget> headers = _buildHeaders(localizations);
|
|
||||||
List<Widget> daysBeforeMonthStart = _buildCellsBeforeStart(localizations);
|
|
||||||
List<Widget> monthDays = _buildMonthCells(localizations);
|
|
||||||
List<Widget> daysAfterMonthEnd = _buildCellsAfterEnd(localizations);
|
|
||||||
|
|
||||||
labels.addAll(headers);
|
|
||||||
labels.addAll(daysBeforeMonthStart);
|
|
||||||
labels.addAll(monthDays);
|
|
||||||
labels.addAll(daysAfterMonthEnd);
|
|
||||||
|
|
||||||
return Padding(
|
|
||||||
padding: datePickerLayoutSettings.contentPadding,
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Flexible(
|
|
||||||
child: GridView.custom(
|
|
||||||
physics: datePickerLayoutSettings.scrollPhysics,
|
|
||||||
gridDelegate: datePickerLayoutSettings.dayPickerGridDelegate,
|
|
||||||
childrenDelegate:
|
|
||||||
SliverChildListDelegate(labels, addRepaintBoundaries: false),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _buildHeaders(MaterialLocalizations localizations) {
|
|
||||||
final int firstDayOfWeekIndex = datePickerStyles.firstDayOfeWeekIndex ??
|
|
||||||
localizations.firstDayOfWeekIndex;
|
|
||||||
|
|
||||||
DayHeaderStyleBuilder dayHeaderStyleBuilder =
|
|
||||||
datePickerStyles.dayHeaderStyleBuilder ??
|
|
||||||
// ignore: avoid_types_on_closure_parameters
|
|
||||||
(int i) => datePickerStyles.dayHeaderStyle;
|
|
||||||
|
|
||||||
List<Widget> headers = getDayHeaders(dayHeaderStyleBuilder,
|
|
||||||
localizations.narrowWeekdays, firstDayOfWeekIndex);
|
|
||||||
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _buildCellsBeforeStart(MaterialLocalizations localizations) {
|
|
||||||
List<Widget> result = [];
|
|
||||||
|
|
||||||
final int year = displayedMonth.year;
|
|
||||||
final int month = displayedMonth.month;
|
|
||||||
final int firstDayOfWeekIndex = datePickerStyles.firstDayOfeWeekIndex ??
|
|
||||||
localizations.firstDayOfWeekIndex;
|
|
||||||
final int firstDayOffset =
|
|
||||||
computeFirstDayOffset(year, month, firstDayOfWeekIndex);
|
|
||||||
|
|
||||||
final bool showDates = datePickerLayoutSettings.showPrevMonthEnd;
|
|
||||||
if (showDates) {
|
|
||||||
int prevMonth = month - 1;
|
|
||||||
if (prevMonth < 1) prevMonth = 12;
|
|
||||||
int prevYear = prevMonth == 12 ? year - 1 : year;
|
|
||||||
|
|
||||||
int daysInPrevMonth = DatePickerUtils.getDaysInMonth(prevYear, prevMonth);
|
|
||||||
List<Widget> days = List.generate(firstDayOffset, (index) => index)
|
|
||||||
.reversed
|
|
||||||
.map((i) => daysInPrevMonth - i)
|
|
||||||
.map((day) => _buildCell(prevYear, prevMonth, day))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
result = days;
|
|
||||||
} else {
|
|
||||||
result = List.generate(firstDayOffset, (_) => const SizedBox.shrink());
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _buildMonthCells(MaterialLocalizations localizations) {
|
|
||||||
List<Widget> result = [];
|
|
||||||
|
|
||||||
final int year = displayedMonth.year;
|
|
||||||
final int month = displayedMonth.month;
|
|
||||||
final int daysInMonth = DatePickerUtils.getDaysInMonth(year, month);
|
|
||||||
|
|
||||||
for (int i = 1; i <= daysInMonth; i += 1) {
|
|
||||||
Widget dayWidget = _buildCell(year, month, i);
|
|
||||||
result.add(dayWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _buildCellsAfterEnd(MaterialLocalizations localizations) {
|
|
||||||
List<Widget> result = [];
|
|
||||||
final bool showDates = datePickerLayoutSettings.showNextMonthStart;
|
|
||||||
if (!showDates) return result;
|
|
||||||
|
|
||||||
final int year = displayedMonth.year;
|
|
||||||
final int month = displayedMonth.month;
|
|
||||||
final int firstDayOfWeekIndex = datePickerStyles.firstDayOfeWeekIndex ??
|
|
||||||
localizations.firstDayOfWeekIndex;
|
|
||||||
final int firstDayOffset =
|
|
||||||
computeFirstDayOffset(year, month, firstDayOfWeekIndex);
|
|
||||||
final int daysInMonth = DatePickerUtils.getDaysInMonth(year, month);
|
|
||||||
final int totalFilledDays = firstDayOffset + daysInMonth;
|
|
||||||
|
|
||||||
int reminder = totalFilledDays % 7;
|
|
||||||
if (reminder == 0) return result;
|
|
||||||
final int emptyCellsNum = 7 - reminder;
|
|
||||||
|
|
||||||
int nextMonth = month + 1;
|
|
||||||
result = List.generate(emptyCellsNum, (i) => i + 1)
|
|
||||||
.map((day) => _buildCell(year, nextMonth, day))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildCell(int year, int month, int day) {
|
|
||||||
DateTime dayToBuild = DateTime(year, month, day);
|
|
||||||
dayToBuild = _checkDateTime(dayToBuild);
|
|
||||||
|
|
||||||
DayType dayType = selectablePicker.getDayType(dayToBuild);
|
|
||||||
|
|
||||||
Widget dayWidget = _DayCell(
|
|
||||||
day: dayToBuild,
|
|
||||||
currentDate: currentDate,
|
|
||||||
selectablePicker: selectablePicker,
|
|
||||||
datePickerStyles: datePickerStyles,
|
|
||||||
eventDecorationBuilder: eventDecorationBuilder,
|
|
||||||
localizations: localizations,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (dayType != DayType.disabled) {
|
|
||||||
dayWidget = GestureDetector(
|
|
||||||
behavior: HitTestBehavior.opaque,
|
|
||||||
onTap: () => selectablePicker.onDayTapped(dayToBuild),
|
|
||||||
child: dayWidget,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dayWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Checks if [DateTime] is same day as [lastDate] or [firstDate]
|
|
||||||
/// and returns dt corrected (with time of [lastDate] or [firstDate]).
|
|
||||||
DateTime _checkDateTime(DateTime dt) {
|
|
||||||
DateTime result = dt;
|
|
||||||
|
|
||||||
// If dayToBuild is the first day we need to save original time for it.
|
|
||||||
if (DatePickerUtils.sameDate(dt, firstDate)) result = firstDate;
|
|
||||||
|
|
||||||
// If dayToBuild is the last day we need to save original time for it.
|
|
||||||
if (DatePickerUtils.sameDate(dt, lastDate)) result = lastDate;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DayCell extends StatelessWidget {
|
|
||||||
/// Day for this cell.
|
|
||||||
final DateTime day;
|
|
||||||
|
|
||||||
/// Selection logic.
|
|
||||||
final ISelectablePicker selectablePicker;
|
|
||||||
|
|
||||||
/// Styles what can be customized by user
|
|
||||||
final DatePickerRangeStyles datePickerStyles;
|
|
||||||
|
|
||||||
/// The current date at the time the picker is displayed.
|
|
||||||
final DateTime currentDate;
|
|
||||||
|
|
||||||
/// Builder to get event decoration for each date.
|
|
||||||
///
|
|
||||||
/// All event styles are overridden by selected styles
|
|
||||||
/// except days with dayType is [DayType.notSelected].
|
|
||||||
final EventDecorationBuilder? eventDecorationBuilder;
|
|
||||||
|
|
||||||
final MaterialLocalizations localizations;
|
|
||||||
|
|
||||||
const _DayCell(
|
|
||||||
{Key? key,
|
|
||||||
required this.day,
|
|
||||||
required this.selectablePicker,
|
|
||||||
required this.datePickerStyles,
|
|
||||||
required this.currentDate,
|
|
||||||
required this.localizations,
|
|
||||||
this.eventDecorationBuilder})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
DayType dayType = selectablePicker.getDayType(day);
|
|
||||||
|
|
||||||
BoxDecoration? decoration;
|
|
||||||
TextStyle? itemStyle;
|
|
||||||
|
|
||||||
if (dayType != DayType.disabled && dayType != DayType.notSelected) {
|
|
||||||
itemStyle = _getSelectedTextStyle(dayType);
|
|
||||||
decoration = _getSelectedDecoration(dayType);
|
|
||||||
} else if (dayType == DayType.disabled) {
|
|
||||||
itemStyle = datePickerStyles.disabledDateStyle;
|
|
||||||
} else if (DatePickerUtils.sameDate(currentDate, day)) {
|
|
||||||
itemStyle = datePickerStyles.currentDateStyle;
|
|
||||||
} else {
|
|
||||||
itemStyle = datePickerStyles.defaultDateTextStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Merges decoration and textStyle with [EventDecoration].
|
|
||||||
//
|
|
||||||
// Merges only in cases if [dayType] is DayType.notSelected.
|
|
||||||
// If day is current day it is also gets event decoration
|
|
||||||
// instead of decoration for current date.
|
|
||||||
if (dayType == DayType.notSelected && eventDecorationBuilder != null) {
|
|
||||||
EventDecoration? eDecoration = eventDecorationBuilder != null
|
|
||||||
? eventDecorationBuilder!.call(day)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
decoration = eDecoration?.boxDecoration ?? decoration;
|
|
||||||
itemStyle = eDecoration?.textStyle ?? itemStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
String semanticLabel = '${localizations.formatDecimal(day.day)}, '
|
|
||||||
'${localizations.formatFullDate(day)}';
|
|
||||||
|
|
||||||
bool daySelected =
|
|
||||||
dayType != DayType.disabled && dayType != DayType.notSelected;
|
|
||||||
|
|
||||||
Widget dayWidget = Container(
|
|
||||||
decoration: decoration,
|
|
||||||
child: Center(
|
|
||||||
child: Semantics(
|
|
||||||
// We want the day of month to be spoken first irrespective of the
|
|
||||||
// locale-specific preferences or TextDirection. This is because
|
|
||||||
// an accessibility user is more likely to be interested in the
|
|
||||||
// day of month before the rest of the date, as they are looking
|
|
||||||
// for the day of month. To do that we prepend day of month to the
|
|
||||||
// formatted full date.
|
|
||||||
label: semanticLabel,
|
|
||||||
selected: daySelected,
|
|
||||||
child: ExcludeSemantics(
|
|
||||||
child: Text(localizations.formatDecimal(day.day), style: itemStyle),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return dayWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
BoxDecoration? _getSelectedDecoration(DayType dayType) {
|
|
||||||
BoxDecoration? result;
|
|
||||||
|
|
||||||
if (dayType == DayType.single) {
|
|
||||||
result = datePickerStyles.selectedSingleDateDecoration;
|
|
||||||
} else if (dayType == DayType.start) {
|
|
||||||
result = datePickerStyles.selectedPeriodStartDecoration;
|
|
||||||
} else if (dayType == DayType.end) {
|
|
||||||
result = datePickerStyles.selectedPeriodLastDecoration;
|
|
||||||
} else {
|
|
||||||
result = datePickerStyles.selectedPeriodMiddleDecoration;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
TextStyle? _getSelectedTextStyle(DayType dayType) {
|
|
||||||
TextStyle? result;
|
|
||||||
|
|
||||||
if (dayType == DayType.single) {
|
|
||||||
result = datePickerStyles.selectedDateStyle;
|
|
||||||
} else if (dayType == DayType.start) {
|
|
||||||
result = datePickerStyles.selectedPeriodStartTextStyle;
|
|
||||||
} else if (dayType == DayType.end) {
|
|
||||||
result = datePickerStyles.selectedPeriodEndTextStyle;
|
|
||||||
} else {
|
|
||||||
result = datePickerStyles.selectedPeriodMiddleTextStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
/// Date period.
|
|
||||||
class DatePeriod {
|
|
||||||
/// Start of this period.
|
|
||||||
final DateTime start;
|
|
||||||
|
|
||||||
/// End of this period.
|
|
||||||
final DateTime end;
|
|
||||||
|
|
||||||
///
|
|
||||||
const DatePeriod(this.start, this.end)
|
|
||||||
: assert(start != null),
|
|
||||||
assert(end != null);
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
/// Keys for some date picker's widgets.
|
|
||||||
///
|
|
||||||
/// Useful for integration tests to find widgets.
|
|
||||||
class DatePickerKeys {
|
|
||||||
/// Key for the previous page icon widget.
|
|
||||||
final Key previousPageIconKey;
|
|
||||||
|
|
||||||
/// Key for the next page icon widget.
|
|
||||||
final Key nextPageIconKey;
|
|
||||||
|
|
||||||
/// Key for showing month.
|
|
||||||
final Key selectedPeriodKeys;
|
|
||||||
|
|
||||||
///
|
|
||||||
DatePickerKeys(
|
|
||||||
this.previousPageIconKey, this.nextPageIconKey, this.selectedPeriodKeys);
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'date_picker_styles.dart';
|
|
||||||
|
|
||||||
///
|
|
||||||
mixin CommonDatePickerFunctions {
|
|
||||||
|
|
||||||
/// Builds widgets showing abbreviated days of week. The first widget in the
|
|
||||||
/// returned list corresponds to the first day of week for the current locale.
|
|
||||||
///
|
|
||||||
/// Examples:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// ┌ Sunday is the first day of week in the US (en_US)
|
|
||||||
/// |
|
|
||||||
/// S M T W T F S <-- the returned list contains these widgets
|
|
||||||
/// _ _ _ _ _ 1 2
|
|
||||||
/// 3 4 5 6 7 8 9
|
|
||||||
///
|
|
||||||
/// ┌ But it's Monday in the UK (en_GB)
|
|
||||||
/// |
|
|
||||||
/// M T W T F S S <-- the returned list contains these widgets
|
|
||||||
/// _ _ _ _ 1 2 3
|
|
||||||
/// 4 5 6 7 8 9 10
|
|
||||||
/// ```
|
|
||||||
List<Widget> getDayHeaders(
|
|
||||||
DayHeaderStyleBuilder headerStyleBuilder,
|
|
||||||
List<String> narrowWeekdays,
|
|
||||||
int firstDayOfWeekIndex) {
|
|
||||||
|
|
||||||
final List<Widget> result = <Widget>[];
|
|
||||||
|
|
||||||
for (int i = firstDayOfWeekIndex; true; i = (i + 1) % 7) {
|
|
||||||
DayHeaderStyle? headerStyle = headerStyleBuilder(i);
|
|
||||||
final String weekday = narrowWeekdays[i];
|
|
||||||
|
|
||||||
Widget header = ExcludeSemantics(
|
|
||||||
child: Container(
|
|
||||||
decoration: headerStyle?.decoration,
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
weekday,
|
|
||||||
style: headerStyle?.textStyle
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
result.add(header);
|
|
||||||
if (i == (firstDayOfWeekIndex - 1) % 7) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Computes the offset from the first day of week that the first day of the
|
|
||||||
/// [month] falls on.
|
|
||||||
///
|
|
||||||
/// For example, September 1, 2017 falls on a Friday, which in the calendar
|
|
||||||
/// localized for United States English appears as:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// S M T W T F S
|
|
||||||
/// _ _ _ _ _ 1 2
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// The offset for the first day of the months is the number of leading blanks
|
|
||||||
/// in the calendar, i.e. 5.
|
|
||||||
///
|
|
||||||
/// The same date localized for the Russian calendar has a different offset,
|
|
||||||
/// because the first day of week is Monday rather than Sunday:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// M T W T F S S
|
|
||||||
/// _ _ _ _ 1 2 3
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// So the offset is 4, rather than 5.
|
|
||||||
///
|
|
||||||
/// This code consolidates the following:
|
|
||||||
///
|
|
||||||
/// - [DateTime.weekday] provides a 1-based index into days of week, with 1
|
|
||||||
/// falling on Monday.
|
|
||||||
/// - [MaterialLocalizations.firstDayOfWeekIndex] provides a 0-based index
|
|
||||||
/// into the [MaterialLocalizations.narrowWeekdays] list.
|
|
||||||
/// - [MaterialLocalizations.narrowWeekdays] list provides localized names of
|
|
||||||
/// days of week, always starting with Sunday and ending with Saturday.
|
|
||||||
int computeFirstDayOffset(
|
|
||||||
int year, int month, int firstDayOfWeekFromSunday) {
|
|
||||||
// 0-based day of week, with 0 representing Monday.
|
|
||||||
final int weekdayFromMonday = DateTime(year, month).weekday - 1;
|
|
||||||
// firstDayOfWeekFromSunday recomputed to be Monday-based
|
|
||||||
final int firstDayOfWeekFromMonday = (firstDayOfWeekFromSunday - 1) % 7;
|
|
||||||
// Number of days between the first day of week appearing on the calendar,
|
|
||||||
// and the day corresponding to the 1-st of the month.
|
|
||||||
return (weekdayFromMonday - firstDayOfWeekFromMonday) % 7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,386 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'range_picker.dart';
|
|
||||||
import 'week_picker.dart';
|
|
||||||
|
|
||||||
/// 0 points to Sunday, and 6 points to Saturday.
|
|
||||||
typedef DayHeaderStyleBuilder = DayHeaderStyle? Function(int dayOfTheWeek);
|
|
||||||
|
|
||||||
/// Common styles for date pickers.
|
|
||||||
///
|
|
||||||
/// To define more styles for date pickers which allow select some range
|
|
||||||
/// (e.g. [RangePicker], [WeekPicker]) use [DatePickerRangeStyles].
|
|
||||||
@immutable
|
|
||||||
class DatePickerStyles {
|
|
||||||
/// Styles for title of displayed period
|
|
||||||
/// (e.g. month for day picker and year for month picker).
|
|
||||||
final TextStyle? displayedPeriodTitle;
|
|
||||||
|
|
||||||
/// Style for the number of current date.
|
|
||||||
final TextStyle? currentDateStyle;
|
|
||||||
|
|
||||||
/// Style for the numbers of disabled dates.
|
|
||||||
final TextStyle? disabledDateStyle;
|
|
||||||
|
|
||||||
/// Style for the number of selected date.
|
|
||||||
final TextStyle? selectedDateStyle;
|
|
||||||
|
|
||||||
/// Used for date which is neither current nor disabled nor selected.
|
|
||||||
final TextStyle? defaultDateTextStyle;
|
|
||||||
|
|
||||||
/// Day cell decoration for selected date in case only one date is selected.
|
|
||||||
final BoxDecoration? selectedSingleDateDecoration;
|
|
||||||
|
|
||||||
/// Style for the day header.
|
|
||||||
///
|
|
||||||
/// If you need to customize day header's style depends on day of the week
|
|
||||||
/// use [dayHeaderStyleBuilder] instead.
|
|
||||||
final DayHeaderStyle? dayHeaderStyle;
|
|
||||||
|
|
||||||
/// Builder to customize styles for day headers depends on day of the week.
|
|
||||||
/// Where 0 points to Sunday and 6 points to Saturday.
|
|
||||||
///
|
|
||||||
/// Builder must return not null value for every weekday from 0 to 6.
|
|
||||||
///
|
|
||||||
/// If styles should be the same for any day of the week
|
|
||||||
/// use [dayHeaderStyle] instead.
|
|
||||||
final DayHeaderStyleBuilder? dayHeaderStyleBuilder;
|
|
||||||
|
|
||||||
/// Widget which will be shown left side of the shown page title.
|
|
||||||
/// User goes to previous data period by click on it.
|
|
||||||
final Widget prevIcon;
|
|
||||||
|
|
||||||
/// Widget which will be shown right side of the shown page title.
|
|
||||||
/// User goes to next data period by click on it.
|
|
||||||
final Widget nextIcon;
|
|
||||||
|
|
||||||
/// Index of the first day of week, where 0 points to Sunday, and 6 points to
|
|
||||||
/// Saturday. Must not be less 0 or more then 6.
|
|
||||||
///
|
|
||||||
/// Can be null. In this case value from current locale will be used.
|
|
||||||
final int? firstDayOfeWeekIndex;
|
|
||||||
|
|
||||||
/// Styles for date picker.
|
|
||||||
DatePickerStyles({
|
|
||||||
this.displayedPeriodTitle,
|
|
||||||
this.currentDateStyle,
|
|
||||||
this.disabledDateStyle,
|
|
||||||
this.selectedDateStyle,
|
|
||||||
this.selectedSingleDateDecoration,
|
|
||||||
this.defaultDateTextStyle,
|
|
||||||
this.dayHeaderStyleBuilder,
|
|
||||||
this.dayHeaderStyle,
|
|
||||||
this.firstDayOfeWeekIndex,
|
|
||||||
this.prevIcon = const Icon(Icons.chevron_left),
|
|
||||||
this.nextIcon = const Icon(Icons.chevron_right)
|
|
||||||
}) : assert(!(dayHeaderStyle != null && dayHeaderStyleBuilder != null),
|
|
||||||
"Should be only one from: dayHeaderStyleBuilder, dayHeaderStyle."),
|
|
||||||
assert(dayHeaderStyleBuilder == null
|
|
||||||
|| _validateDayHeaderStyleBuilder(dayHeaderStyleBuilder),
|
|
||||||
"dayHeaderStyleBuilder must return not null value from every weekday "
|
|
||||||
"(from 0 to 6)."),
|
|
||||||
assert(_validateFirstDayOfWeek(firstDayOfeWeekIndex),
|
|
||||||
"firstDayOfeWeekIndex must be null or in correct range (from 0 to 6).");
|
|
||||||
|
|
||||||
/// Return new [DatePickerStyles] object where fields
|
|
||||||
/// with null values set with defaults from theme.
|
|
||||||
DatePickerStyles fulfillWithTheme(ThemeData theme) {
|
|
||||||
Color accentColor = theme.colorScheme.secondary;
|
|
||||||
|
|
||||||
TextStyle? _displayedPeriodTitle =
|
|
||||||
displayedPeriodTitle ?? theme.textTheme.titleMedium;
|
|
||||||
TextStyle? _currentDateStyle = currentDateStyle ??
|
|
||||||
theme.textTheme.bodyLarge?.copyWith(color: theme.colorScheme.secondary);
|
|
||||||
TextStyle? _disabledDateStyle = disabledDateStyle ??
|
|
||||||
theme.textTheme.bodyMedium?.copyWith(color: theme.disabledColor);
|
|
||||||
TextStyle? _selectedDateStyle =
|
|
||||||
selectedDateStyle ?? theme.textTheme.bodyLarge;
|
|
||||||
TextStyle? _defaultDateTextStyle =
|
|
||||||
defaultDateTextStyle ?? theme.textTheme.bodyMedium;
|
|
||||||
BoxDecoration _selectedSingleDateDecoration =
|
|
||||||
selectedSingleDateDecoration ??
|
|
||||||
BoxDecoration(
|
|
||||||
color: accentColor,
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)));
|
|
||||||
|
|
||||||
DayHeaderStyle? _dayHeaderStyle = dayHeaderStyle;
|
|
||||||
if (dayHeaderStyleBuilder == null && _dayHeaderStyle == null) {
|
|
||||||
_dayHeaderStyle = DayHeaderStyle(textStyle: theme.textTheme.bodySmall);
|
|
||||||
}
|
|
||||||
|
|
||||||
return DatePickerStyles(
|
|
||||||
disabledDateStyle: _disabledDateStyle,
|
|
||||||
currentDateStyle: _currentDateStyle,
|
|
||||||
displayedPeriodTitle: _displayedPeriodTitle,
|
|
||||||
selectedDateStyle: _selectedDateStyle,
|
|
||||||
selectedSingleDateDecoration: _selectedSingleDateDecoration,
|
|
||||||
defaultDateTextStyle: _defaultDateTextStyle,
|
|
||||||
dayHeaderStyle: _dayHeaderStyle,
|
|
||||||
dayHeaderStyleBuilder: dayHeaderStyleBuilder,
|
|
||||||
nextIcon: nextIcon,
|
|
||||||
prevIcon: prevIcon
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
if (identical(this, other)) return true;
|
|
||||||
if (other.runtimeType != runtimeType) return false;
|
|
||||||
|
|
||||||
return other is DatePickerStyles
|
|
||||||
&& other.displayedPeriodTitle == displayedPeriodTitle
|
|
||||||
&& other.currentDateStyle == currentDateStyle
|
|
||||||
&& other.disabledDateStyle == disabledDateStyle
|
|
||||||
&& other.selectedDateStyle == selectedDateStyle
|
|
||||||
&& other.defaultDateTextStyle == defaultDateTextStyle
|
|
||||||
&& other.selectedSingleDateDecoration == selectedSingleDateDecoration
|
|
||||||
&& other.dayHeaderStyle == dayHeaderStyle
|
|
||||||
&& other.dayHeaderStyleBuilder == dayHeaderStyleBuilder
|
|
||||||
&& other.prevIcon == prevIcon
|
|
||||||
&& other.nextIcon == nextIcon
|
|
||||||
&& other.firstDayOfeWeekIndex == firstDayOfeWeekIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode =>
|
|
||||||
Object.hash(
|
|
||||||
displayedPeriodTitle,
|
|
||||||
currentDateStyle,
|
|
||||||
disabledDateStyle,
|
|
||||||
selectedDateStyle,
|
|
||||||
defaultDateTextStyle,
|
|
||||||
selectedSingleDateDecoration,
|
|
||||||
dayHeaderStyle,
|
|
||||||
dayHeaderStyleBuilder,
|
|
||||||
prevIcon,
|
|
||||||
nextIcon,
|
|
||||||
firstDayOfeWeekIndex
|
|
||||||
);
|
|
||||||
|
|
||||||
static bool _validateDayHeaderStyleBuilder(DayHeaderStyleBuilder builder) {
|
|
||||||
List<int> weekdays = const [0, 1, 2, 3, 4, 5, 6];
|
|
||||||
|
|
||||||
// ignore: avoid_types_on_closure_parameters
|
|
||||||
bool valid = weekdays.every((int weekday) => builder(weekday) != null);
|
|
||||||
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool _validateFirstDayOfWeek(int? index) {
|
|
||||||
if (index == null) return true;
|
|
||||||
|
|
||||||
bool valid = index >= 0 && index <= 6;
|
|
||||||
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Styles for date pickers which allow select some range
|
|
||||||
/// (e.g. RangePicker, WeekPicker).
|
|
||||||
@immutable
|
|
||||||
class DatePickerRangeStyles extends DatePickerStyles {
|
|
||||||
/// Decoration for the first date of the selected range.
|
|
||||||
final BoxDecoration? selectedPeriodStartDecoration;
|
|
||||||
|
|
||||||
/// Text style for the first date of the selected range.
|
|
||||||
///
|
|
||||||
/// If null - default [DatePickerStyles.selectedDateStyle] will be used.
|
|
||||||
final TextStyle? selectedPeriodStartTextStyle;
|
|
||||||
|
|
||||||
/// Decoration for the last date of the selected range.
|
|
||||||
final BoxDecoration? selectedPeriodLastDecoration;
|
|
||||||
|
|
||||||
/// Text style for the last date of the selected range.
|
|
||||||
///
|
|
||||||
/// If null - default [DatePickerStyles.selectedDateStyle] will be used.
|
|
||||||
final TextStyle? selectedPeriodEndTextStyle;
|
|
||||||
|
|
||||||
/// Decoration for the date of the selected range
|
|
||||||
/// which is not first date and not end date of this range.
|
|
||||||
///
|
|
||||||
/// If there is only one date selected
|
|
||||||
/// [DatePickerStyles.selectedSingleDateDecoration] will be used.
|
|
||||||
final BoxDecoration? selectedPeriodMiddleDecoration;
|
|
||||||
|
|
||||||
/// Text style for the middle date of the selected range.
|
|
||||||
///
|
|
||||||
/// If null - default [DatePickerStyles.selectedDateStyle] will be used.
|
|
||||||
final TextStyle? selectedPeriodMiddleTextStyle;
|
|
||||||
|
|
||||||
/// Return new [DatePickerRangeStyles] object
|
|
||||||
/// where fields with null values set with defaults from given theme.
|
|
||||||
@override
|
|
||||||
DatePickerRangeStyles fulfillWithTheme(ThemeData theme) {
|
|
||||||
Color accentColor = theme.colorScheme.secondary;
|
|
||||||
|
|
||||||
DatePickerStyles commonStyles = super.fulfillWithTheme(theme);
|
|
||||||
|
|
||||||
final BoxDecoration _selectedPeriodStartDecoration =
|
|
||||||
selectedPeriodStartDecoration ??
|
|
||||||
BoxDecoration(
|
|
||||||
color: accentColor,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(10.0),
|
|
||||||
bottomLeft: Radius.circular(10.0)),
|
|
||||||
);
|
|
||||||
|
|
||||||
final BoxDecoration _selectedPeriodLastDecoration =
|
|
||||||
selectedPeriodLastDecoration ??
|
|
||||||
BoxDecoration(
|
|
||||||
color: accentColor,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topRight: Radius.circular(10.0),
|
|
||||||
bottomRight: Radius.circular(10.0)),
|
|
||||||
);
|
|
||||||
|
|
||||||
final BoxDecoration _selectedPeriodMiddleDecoration =
|
|
||||||
selectedPeriodMiddleDecoration ??
|
|
||||||
BoxDecoration(
|
|
||||||
color: accentColor,
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
);
|
|
||||||
|
|
||||||
final TextStyle? _selectedPeriodStartTextStyle =
|
|
||||||
selectedPeriodStartTextStyle ?? commonStyles.selectedDateStyle;
|
|
||||||
|
|
||||||
final TextStyle? _selectedPeriodMiddleTextStyle =
|
|
||||||
selectedPeriodMiddleTextStyle ?? commonStyles.selectedDateStyle;
|
|
||||||
|
|
||||||
final TextStyle? _selectedPeriodEndTextStyle =
|
|
||||||
selectedPeriodEndTextStyle ?? commonStyles.selectedDateStyle;
|
|
||||||
|
|
||||||
return DatePickerRangeStyles(
|
|
||||||
disabledDateStyle: commonStyles.disabledDateStyle,
|
|
||||||
currentDateStyle: commonStyles.currentDateStyle,
|
|
||||||
displayedPeriodTitle: commonStyles.displayedPeriodTitle,
|
|
||||||
selectedDateStyle: commonStyles.selectedDateStyle,
|
|
||||||
selectedSingleDateDecoration: commonStyles.selectedSingleDateDecoration,
|
|
||||||
defaultDateTextStyle: commonStyles.defaultDateTextStyle,
|
|
||||||
dayHeaderStyle: commonStyles.dayHeaderStyle,
|
|
||||||
dayHeaderStyleBuilder: commonStyles.dayHeaderStyleBuilder,
|
|
||||||
firstDayOfWeekIndex: firstDayOfeWeekIndex,
|
|
||||||
selectedPeriodStartDecoration: _selectedPeriodStartDecoration,
|
|
||||||
selectedPeriodMiddleDecoration: _selectedPeriodMiddleDecoration,
|
|
||||||
selectedPeriodLastDecoration: _selectedPeriodLastDecoration,
|
|
||||||
selectedPeriodStartTextStyle: _selectedPeriodStartTextStyle,
|
|
||||||
selectedPeriodMiddleTextStyle: _selectedPeriodMiddleTextStyle,
|
|
||||||
selectedPeriodEndTextStyle: _selectedPeriodEndTextStyle,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Styles for the pickers that allows to select range ([RangePicker],
|
|
||||||
/// [WeekPicker]).
|
|
||||||
DatePickerRangeStyles({
|
|
||||||
displayedPeriodTitle,
|
|
||||||
currentDateStyle,
|
|
||||||
disabledDateStyle,
|
|
||||||
selectedDateStyle,
|
|
||||||
selectedSingleDateDecoration,
|
|
||||||
defaultDateTextStyle,
|
|
||||||
dayHeaderStyle,
|
|
||||||
dayHeaderStyleBuilder,
|
|
||||||
Widget nextIcon = const Icon(Icons.chevron_right),
|
|
||||||
Widget prevIcon = const Icon(Icons.chevron_left),
|
|
||||||
firstDayOfWeekIndex,
|
|
||||||
this.selectedPeriodLastDecoration,
|
|
||||||
this.selectedPeriodMiddleDecoration,
|
|
||||||
this.selectedPeriodStartDecoration,
|
|
||||||
this.selectedPeriodStartTextStyle,
|
|
||||||
this.selectedPeriodMiddleTextStyle,
|
|
||||||
this.selectedPeriodEndTextStyle,
|
|
||||||
}) : super(
|
|
||||||
displayedPeriodTitle: displayedPeriodTitle,
|
|
||||||
currentDateStyle: currentDateStyle,
|
|
||||||
disabledDateStyle: disabledDateStyle,
|
|
||||||
selectedDateStyle: selectedDateStyle,
|
|
||||||
selectedSingleDateDecoration: selectedSingleDateDecoration,
|
|
||||||
defaultDateTextStyle: defaultDateTextStyle,
|
|
||||||
dayHeaderStyle: dayHeaderStyle,
|
|
||||||
dayHeaderStyleBuilder: dayHeaderStyleBuilder,
|
|
||||||
nextIcon: nextIcon,
|
|
||||||
prevIcon: prevIcon,
|
|
||||||
firstDayOfeWeekIndex: firstDayOfWeekIndex
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
if (identical(this, other)) return true;
|
|
||||||
if (other.runtimeType != runtimeType) return false;
|
|
||||||
|
|
||||||
return other is DatePickerRangeStyles
|
|
||||||
&& other.selectedPeriodStartDecoration == selectedPeriodStartDecoration
|
|
||||||
&& other.selectedPeriodStartTextStyle == selectedPeriodStartTextStyle
|
|
||||||
&& other.selectedPeriodLastDecoration == selectedPeriodLastDecoration
|
|
||||||
&& other.selectedPeriodEndTextStyle == selectedPeriodEndTextStyle
|
|
||||||
&& other.selectedPeriodMiddleDecoration ==selectedPeriodMiddleDecoration
|
|
||||||
&& other.selectedPeriodMiddleTextStyle == selectedPeriodMiddleTextStyle
|
|
||||||
&& other.displayedPeriodTitle == displayedPeriodTitle
|
|
||||||
&& other.currentDateStyle == currentDateStyle
|
|
||||||
&& other.disabledDateStyle == disabledDateStyle
|
|
||||||
&& other.selectedDateStyle == selectedDateStyle
|
|
||||||
&& other.defaultDateTextStyle == defaultDateTextStyle
|
|
||||||
&& other.selectedSingleDateDecoration == selectedSingleDateDecoration
|
|
||||||
&& other.dayHeaderStyle == dayHeaderStyle
|
|
||||||
&& other.dayHeaderStyleBuilder == dayHeaderStyleBuilder
|
|
||||||
&& other.prevIcon == prevIcon
|
|
||||||
&& other.nextIcon == nextIcon
|
|
||||||
&& other.firstDayOfeWeekIndex == firstDayOfeWeekIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode =>
|
|
||||||
Object.hash(
|
|
||||||
selectedPeriodStartDecoration,
|
|
||||||
selectedPeriodStartTextStyle,
|
|
||||||
selectedPeriodLastDecoration,
|
|
||||||
selectedPeriodEndTextStyle,
|
|
||||||
selectedPeriodMiddleDecoration,
|
|
||||||
selectedPeriodMiddleTextStyle,
|
|
||||||
displayedPeriodTitle,
|
|
||||||
currentDateStyle,
|
|
||||||
disabledDateStyle,
|
|
||||||
selectedDateStyle,
|
|
||||||
defaultDateTextStyle,
|
|
||||||
selectedSingleDateDecoration,
|
|
||||||
dayHeaderStyle,
|
|
||||||
dayHeaderStyleBuilder,
|
|
||||||
prevIcon,
|
|
||||||
nextIcon,
|
|
||||||
firstDayOfeWeekIndex
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// User styles for the day header in date picker.
|
|
||||||
@immutable
|
|
||||||
class DayHeaderStyle {
|
|
||||||
/// If null - textTheme.bodySmall from the Theme will be used.
|
|
||||||
final TextStyle? textStyle;
|
|
||||||
|
|
||||||
/// If null - no decoration will be applied for the day header;
|
|
||||||
final BoxDecoration? decoration;
|
|
||||||
|
|
||||||
/// Creates styles for the day headers in date pickers.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DatePickerStyles.dayHeaderStyleBuilder]
|
|
||||||
const DayHeaderStyle({
|
|
||||||
this.textStyle,
|
|
||||||
this.decoration
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
if (identical(this, other)) return true;
|
|
||||||
if (other.runtimeType != runtimeType) return false;
|
|
||||||
|
|
||||||
return other is DayHeaderStyle
|
|
||||||
&& other.textStyle == textStyle
|
|
||||||
&& other.decoration == decoration;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
textStyle,
|
|
||||||
decoration
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,363 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
||||||
|
|
||||||
import 'package:intl/intl.dart' as intl;
|
|
||||||
|
|
||||||
import 'basic_day_based_widget.dart';
|
|
||||||
import 'date_picker_keys.dart';
|
|
||||||
import 'date_picker_styles.dart';
|
|
||||||
import 'day_based_changeable_picker_presenter.dart';
|
|
||||||
import 'day_picker_selection.dart';
|
|
||||||
import 'day_type.dart';
|
|
||||||
import 'event_decoration.dart';
|
|
||||||
import 'i_selectable_picker.dart';
|
|
||||||
import 'layout_settings.dart';
|
|
||||||
import 'month_navigation_row.dart';
|
|
||||||
import 'semantic_sorting.dart';
|
|
||||||
import 'typedefs.dart';
|
|
||||||
import 'utils.dart';
|
|
||||||
|
|
||||||
|
|
||||||
const Locale _defaultLocale = Locale('en', 'US');
|
|
||||||
|
|
||||||
/// Date picker based on [DayBasedPicker] picker (for days, weeks, ranges).
|
|
||||||
/// Allows select previous/next month.
|
|
||||||
class DayBasedChangeablePicker<T> extends StatefulWidget {
|
|
||||||
/// The currently selected date.
|
|
||||||
///
|
|
||||||
/// This date is highlighted in the picker.
|
|
||||||
final DayPickerSelection selection;
|
|
||||||
|
|
||||||
/// Called when the user picks a new T.
|
|
||||||
final ValueChanged<T> onChanged;
|
|
||||||
|
|
||||||
/// Called when the error was thrown after user selection.
|
|
||||||
final OnSelectionError? onSelectionError;
|
|
||||||
|
|
||||||
/// The earliest date the user is permitted to pick.
|
|
||||||
final DateTime firstDate;
|
|
||||||
|
|
||||||
/// The latest date the user is permitted to pick.
|
|
||||||
final DateTime lastDate;
|
|
||||||
|
|
||||||
/// Date for defining what month should be shown initially.
|
|
||||||
///
|
|
||||||
/// Default value is [selection.earliest].
|
|
||||||
final DateTime initiallyShowDate;
|
|
||||||
|
|
||||||
/// Layout settings what can be customized by user
|
|
||||||
final DatePickerLayoutSettings datePickerLayoutSettings;
|
|
||||||
|
|
||||||
/// Styles what can be customized by user
|
|
||||||
final DatePickerRangeStyles datePickerStyles;
|
|
||||||
|
|
||||||
/// Some keys useful for integration tests
|
|
||||||
final DatePickerKeys? datePickerKeys;
|
|
||||||
|
|
||||||
/// Logic for date selections.
|
|
||||||
final ISelectablePicker<T> selectablePicker;
|
|
||||||
|
|
||||||
/// Builder to get event decoration for each date.
|
|
||||||
///
|
|
||||||
/// All event styles are overridden by selected styles
|
|
||||||
/// except days with dayType is [DayType.notSelected].
|
|
||||||
final EventDecorationBuilder? eventDecorationBuilder;
|
|
||||||
|
|
||||||
/// Called when the user changes the month
|
|
||||||
final ValueChanged<DateTime>? onMonthChanged;
|
|
||||||
|
|
||||||
/// Create picker with option to change month.
|
|
||||||
DayBasedChangeablePicker(
|
|
||||||
{Key? key,
|
|
||||||
required this.selection,
|
|
||||||
required this.onChanged,
|
|
||||||
required this.firstDate,
|
|
||||||
required this.lastDate,
|
|
||||||
required this.datePickerLayoutSettings,
|
|
||||||
required this.datePickerStyles,
|
|
||||||
required this.selectablePicker,
|
|
||||||
DateTime? initiallyShownDate,
|
|
||||||
this.datePickerKeys,
|
|
||||||
this.onSelectionError,
|
|
||||||
this.eventDecorationBuilder,
|
|
||||||
this.onMonthChanged})
|
|
||||||
: initiallyShowDate = initiallyShownDate ?? selection.earliest,
|
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<DayBasedChangeablePicker<T>> createState() =>
|
|
||||||
_DayBasedChangeablePickerState<T>();
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo: Check initial selection and call onSelectionError in case it has error
|
|
||||||
// todo: (ISelectablePicker.curSelectionIsCorrupted);
|
|
||||||
class _DayBasedChangeablePickerState<T>
|
|
||||||
extends State<DayBasedChangeablePicker<T>> {
|
|
||||||
DateTime _todayDate = DateTime.now();
|
|
||||||
|
|
||||||
Locale curLocale = _defaultLocale;
|
|
||||||
|
|
||||||
MaterialLocalizations localizations = _defaultLocalizations;
|
|
||||||
|
|
||||||
PageController _dayPickerController = PageController();
|
|
||||||
|
|
||||||
// Styles from widget fulfilled with current Theme.
|
|
||||||
DatePickerRangeStyles _resultStyles = DatePickerRangeStyles();
|
|
||||||
|
|
||||||
DayBasedChangeablePickerPresenter _presenter = _defaultPresenter;
|
|
||||||
|
|
||||||
Timer? _timer;
|
|
||||||
StreamSubscription<T>? _changesSubscription;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
// Initially display the pre-selected date.
|
|
||||||
final int monthPage = _getInitPage();
|
|
||||||
_dayPickerController = PageController(initialPage: monthPage);
|
|
||||||
|
|
||||||
_changesSubscription = widget.selectablePicker.onUpdate
|
|
||||||
.listen((newSelectedDate) => widget.onChanged(newSelectedDate))
|
|
||||||
..onError((e) => widget.onSelectionError != null
|
|
||||||
? widget.onSelectionError!.call(e)
|
|
||||||
: print(e.toString()));
|
|
||||||
|
|
||||||
_updateCurrentDate();
|
|
||||||
_initPresenter();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didUpdateWidget(DayBasedChangeablePicker<T> oldWidget) {
|
|
||||||
super.didUpdateWidget(oldWidget);
|
|
||||||
|
|
||||||
if (widget.datePickerStyles != oldWidget.datePickerStyles) {
|
|
||||||
final ThemeData theme = Theme.of(context);
|
|
||||||
_resultStyles = widget.datePickerStyles.fulfillWithTheme(theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (widget.selectablePicker != oldWidget.selectablePicker) {
|
|
||||||
_changesSubscription = widget.selectablePicker.onUpdate
|
|
||||||
.listen((newSelectedDate) => widget.onChanged(newSelectedDate))
|
|
||||||
..onError((e) => widget.onSelectionError != null
|
|
||||||
? widget.onSelectionError!.call(e)
|
|
||||||
: print(e.toString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
curLocale = Localizations.localeOf(context);
|
|
||||||
|
|
||||||
MaterialLocalizations? curLocalizations =
|
|
||||||
Localizations.of<MaterialLocalizations>(context, MaterialLocalizations);
|
|
||||||
if (curLocalizations != null && localizations != curLocalizations) {
|
|
||||||
localizations = curLocalizations;
|
|
||||||
_initPresenter();
|
|
||||||
}
|
|
||||||
|
|
||||||
final ThemeData theme = Theme.of(context);
|
|
||||||
_resultStyles = widget.datePickerStyles.fulfillWithTheme(theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return SizedBox(
|
|
||||||
width: widget.datePickerLayoutSettings.monthPickerPortraitWidth,
|
|
||||||
height: widget.datePickerLayoutSettings.maxDayPickerHeight,
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
widget.datePickerLayoutSettings.hideMonthNavigationRow
|
|
||||||
? const SizedBox()
|
|
||||||
: SizedBox(
|
|
||||||
height: widget.datePickerLayoutSettings.dayPickerRowHeight,
|
|
||||||
child: Padding(
|
|
||||||
//match _DayPicker main layout padding
|
|
||||||
padding: widget.datePickerLayoutSettings.contentPadding,
|
|
||||||
child: _buildMonthNavigationRow()),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Semantics(
|
|
||||||
sortKey: MonthPickerSortKey.calendar,
|
|
||||||
child: _buildDayPickerPageView(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_timer?.cancel();
|
|
||||||
_dayPickerController.dispose();
|
|
||||||
_changesSubscription?.cancel();
|
|
||||||
widget.selectablePicker.dispose();
|
|
||||||
_presenter.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
void _updateCurrentDate() {
|
|
||||||
_todayDate = DateTime.now();
|
|
||||||
final DateTime tomorrow =
|
|
||||||
DateTime(_todayDate.year, _todayDate.month, _todayDate.day + 1);
|
|
||||||
Duration timeUntilTomorrow = tomorrow.difference(_todayDate);
|
|
||||||
timeUntilTomorrow +=
|
|
||||||
const Duration(seconds: 1); // so we don't miss it by rounding
|
|
||||||
_timer?.cancel();
|
|
||||||
_timer = Timer(timeUntilTomorrow, () {
|
|
||||||
setState(_updateCurrentDate);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget _buildMonthNavigationRow() {
|
|
||||||
return StreamBuilder<DayBasedChangeablePickerState>(
|
|
||||||
stream: _presenter.data,
|
|
||||||
initialData: _presenter.lastVal,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (!snapshot.hasData) {
|
|
||||||
return const SizedBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
DayBasedChangeablePickerState state = snapshot.data!;
|
|
||||||
|
|
||||||
return MonthNavigationRow(
|
|
||||||
previousPageIconKey: widget.datePickerKeys?.previousPageIconKey,
|
|
||||||
nextPageIconKey: widget.datePickerKeys?.nextPageIconKey,
|
|
||||||
previousMonthTooltip: state.prevTooltip,
|
|
||||||
nextMonthTooltip: state.nextTooltip,
|
|
||||||
onPreviousMonthTapped:
|
|
||||||
state.isFirstMonth ? null : _presenter.gotoPrevMonth,
|
|
||||||
onNextMonthTapped:
|
|
||||||
state.isLastMonth ? null : _presenter.gotoNextMonth,
|
|
||||||
title: Text(
|
|
||||||
state.curMonthDis,
|
|
||||||
key: widget.datePickerKeys?.selectedPeriodKeys,
|
|
||||||
style: _resultStyles.displayedPeriodTitle,
|
|
||||||
),
|
|
||||||
nextIcon: widget.datePickerStyles.nextIcon,
|
|
||||||
prevIcon: widget.datePickerStyles.prevIcon,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildDayPickerPageView() => PageView.builder(
|
|
||||||
controller: _dayPickerController,
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
itemCount:
|
|
||||||
DatePickerUtils.monthDelta(widget.firstDate, widget.lastDate) + 1,
|
|
||||||
itemBuilder: _buildCalendar,
|
|
||||||
onPageChanged: _handleMonthPageChanged,
|
|
||||||
);
|
|
||||||
|
|
||||||
Widget _buildCalendar(BuildContext context, int index) {
|
|
||||||
final DateTime targetDate =
|
|
||||||
DatePickerUtils.addMonthsToMonthDate(widget.firstDate, index);
|
|
||||||
|
|
||||||
return DayBasedPicker(
|
|
||||||
key: ValueKey<DateTime>(targetDate),
|
|
||||||
selectablePicker: widget.selectablePicker,
|
|
||||||
currentDate: _todayDate,
|
|
||||||
firstDate: widget.firstDate,
|
|
||||||
lastDate: widget.lastDate,
|
|
||||||
displayedMonth: targetDate,
|
|
||||||
datePickerLayoutSettings: widget.datePickerLayoutSettings,
|
|
||||||
selectedPeriodKey: widget.datePickerKeys?.selectedPeriodKeys,
|
|
||||||
datePickerStyles: _resultStyles,
|
|
||||||
eventDecorationBuilder: widget.eventDecorationBuilder,
|
|
||||||
localizations: localizations,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns appropriate date to be shown for init.
|
|
||||||
// If [widget.initiallyShowDate] is out of bounds [widget.firstDate]
|
|
||||||
// - [widget.lastDate], nearest bound will be used.
|
|
||||||
DateTime _getCheckedInitialDate() {
|
|
||||||
DateTime initiallyShowDateChecked = widget.initiallyShowDate;
|
|
||||||
if (initiallyShowDateChecked.isBefore(widget.firstDate)) {
|
|
||||||
initiallyShowDateChecked = widget.firstDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (initiallyShowDateChecked.isAfter(widget.lastDate)) {
|
|
||||||
initiallyShowDateChecked = widget.lastDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
return initiallyShowDateChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
int _getInitPage() {
|
|
||||||
final initialDate = _getCheckedInitialDate();
|
|
||||||
int initPage = DatePickerUtils.monthDelta(
|
|
||||||
widget.firstDate, initialDate
|
|
||||||
);
|
|
||||||
|
|
||||||
return initPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _initPresenter() {
|
|
||||||
_presenter.dispose();
|
|
||||||
|
|
||||||
_presenter = DayBasedChangeablePickerPresenter(
|
|
||||||
firstDate: widget.firstDate,
|
|
||||||
lastDate: widget.lastDate,
|
|
||||||
localizations: localizations,
|
|
||||||
showPrevMonthDates: widget.datePickerLayoutSettings.showPrevMonthEnd,
|
|
||||||
showNextMonthDates: widget.datePickerLayoutSettings.showNextMonthStart,
|
|
||||||
firstDayOfWeekIndex: widget.datePickerStyles.firstDayOfeWeekIndex);
|
|
||||||
_presenter.data.listen(_onStateChanged);
|
|
||||||
|
|
||||||
// date used to define what month should be shown
|
|
||||||
DateTime initSelection = _getCheckedInitialDate();
|
|
||||||
|
|
||||||
// Give information about initial selection to presenter.
|
|
||||||
// It should be done after first frame when PageView is already created.
|
|
||||||
// Otherwise event from presenter will cause a error.
|
|
||||||
WidgetsBinding.instance!.addPostFrameCallback((_) {
|
|
||||||
_presenter.setSelectedDate(initSelection);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onStateChanged(DayBasedChangeablePickerState newState) {
|
|
||||||
DateTime newMonth = newState.currentMonth;
|
|
||||||
final int monthPage =
|
|
||||||
DatePickerUtils.monthDelta(widget.firstDate, newMonth);
|
|
||||||
_dayPickerController.animateToPage(monthPage,
|
|
||||||
duration: const Duration(milliseconds: 200), curve: Curves.easeInOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _handleMonthPageChanged(int monthPage) {
|
|
||||||
DateTime firstMonth = widget.firstDate;
|
|
||||||
DateTime newMonth = DateTime(firstMonth.year, firstMonth.month + monthPage);
|
|
||||||
_presenter.changeMonth(newMonth);
|
|
||||||
|
|
||||||
widget.onMonthChanged?.call(newMonth);
|
|
||||||
}
|
|
||||||
|
|
||||||
static MaterialLocalizations get _defaultLocalizations =>
|
|
||||||
MaterialLocalizationEn(
|
|
||||||
twoDigitZeroPaddedFormat:
|
|
||||||
intl.NumberFormat('00', _defaultLocale.toString()),
|
|
||||||
fullYearFormat: intl.DateFormat.y(_defaultLocale.toString()),
|
|
||||||
longDateFormat: intl.DateFormat.yMMMMEEEEd(_defaultLocale.toString()),
|
|
||||||
shortMonthDayFormat: intl.DateFormat.MMMd(_defaultLocale.toString()),
|
|
||||||
decimalFormat:
|
|
||||||
intl.NumberFormat.decimalPattern(_defaultLocale.toString()),
|
|
||||||
shortDateFormat: intl.DateFormat.yMMMd(_defaultLocale.toString()),
|
|
||||||
mediumDateFormat: intl.DateFormat.MMMEd(_defaultLocale.toString()),
|
|
||||||
compactDateFormat: intl.DateFormat.yMd(_defaultLocale.toString()),
|
|
||||||
yearMonthFormat: intl.DateFormat.yMMMM(_defaultLocale.toString()),
|
|
||||||
);
|
|
||||||
|
|
||||||
static DayBasedChangeablePickerPresenter get _defaultPresenter =>
|
|
||||||
DayBasedChangeablePickerPresenter(
|
|
||||||
firstDate: DateTime.now(),
|
|
||||||
lastDate: DateTime.now(),
|
|
||||||
localizations: _defaultLocalizations,
|
|
||||||
showPrevMonthDates: false,
|
|
||||||
showNextMonthDates: false,
|
|
||||||
firstDayOfWeekIndex: 1);
|
|
||||||
}
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'day_based_changable_picker.dart';
|
|
||||||
import 'utils.dart';
|
|
||||||
|
|
||||||
/// Presenter for [DayBasedChangeablePicker] to handle month changes.
|
|
||||||
class DayBasedChangeablePickerPresenter {
|
|
||||||
/// First date user can select.
|
|
||||||
final DateTime firstDate;
|
|
||||||
|
|
||||||
/// Last date user can select.
|
|
||||||
final DateTime lastDate;
|
|
||||||
|
|
||||||
/// Localization.
|
|
||||||
final MaterialLocalizations localizations;
|
|
||||||
|
|
||||||
/// If empty day cells before 1st day of showing month should be filled with
|
|
||||||
/// date from the last week of the previous month.
|
|
||||||
final bool showPrevMonthDates;
|
|
||||||
|
|
||||||
/// If empty day cells after last day of showing month should be filled with
|
|
||||||
/// date from the first week of the next month.
|
|
||||||
final bool showNextMonthDates;
|
|
||||||
|
|
||||||
/// Index of the first day in week.
|
|
||||||
/// 0 is Sunday, 6 is Saturday.
|
|
||||||
final int firstDayOfWeekIndex;
|
|
||||||
|
|
||||||
/// View model stream for the [DayBasedChangeablePicker].
|
|
||||||
Stream<DayBasedChangeablePickerState> get data => _controller.stream;
|
|
||||||
|
|
||||||
/// Last view model state of the [DayBasedChangeablePicker].
|
|
||||||
DayBasedChangeablePickerState? get lastVal => _lastVal;
|
|
||||||
|
|
||||||
/// Creates presenter to use for [DayBasedChangeablePicker].
|
|
||||||
DayBasedChangeablePickerPresenter(
|
|
||||||
{required this.firstDate,
|
|
||||||
required this.lastDate,
|
|
||||||
required this.localizations,
|
|
||||||
required this.showPrevMonthDates,
|
|
||||||
required this.showNextMonthDates,
|
|
||||||
int? firstDayOfWeekIndex})
|
|
||||||
: firstDayOfWeekIndex =
|
|
||||||
firstDayOfWeekIndex ?? localizations.firstDayOfWeekIndex;
|
|
||||||
|
|
||||||
/// Update state according to the [selectedDate] if it needs.
|
|
||||||
void setSelectedDate(DateTime selectedDate) {
|
|
||||||
changeMonth(selectedDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Update state to show previous month.
|
|
||||||
void gotoPrevMonth() {
|
|
||||||
DateTime oldCur = _lastVal!.currentMonth;
|
|
||||||
DateTime newCurDate = DateTime(oldCur.year, oldCur.month - 1);
|
|
||||||
|
|
||||||
changeMonth(newCurDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Update state to show next month.
|
|
||||||
void gotoNextMonth() {
|
|
||||||
DateTime oldCur = _lastVal!.currentMonth;
|
|
||||||
DateTime newCurDate = DateTime(oldCur.year, oldCur.month + 1);
|
|
||||||
|
|
||||||
changeMonth(newCurDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Update state to change month to the [newMonth].
|
|
||||||
void changeMonth(DateTime newMonth) {
|
|
||||||
bool sameMonth = _lastVal != null &&
|
|
||||||
DatePickerUtils.sameMonth(_lastVal!.currentMonth, newMonth);
|
|
||||||
if (sameMonth) return;
|
|
||||||
|
|
||||||
int monthPage = DatePickerUtils.monthDelta(firstDate, newMonth);
|
|
||||||
DateTime prevMonth =
|
|
||||||
DatePickerUtils.addMonthsToMonthDate(firstDate, monthPage - 1);
|
|
||||||
|
|
||||||
DateTime curMonth =
|
|
||||||
DatePickerUtils.addMonthsToMonthDate(firstDate, monthPage);
|
|
||||||
|
|
||||||
DateTime nextMonth =
|
|
||||||
DatePickerUtils.addMonthsToMonthDate(firstDate, monthPage + 1);
|
|
||||||
|
|
||||||
String prevMonthStr = localizations.formatMonthYear(prevMonth);
|
|
||||||
String curMonthStr = localizations.formatMonthYear(curMonth);
|
|
||||||
String nextMonthStr = localizations.formatMonthYear(nextMonth);
|
|
||||||
|
|
||||||
bool isFirstMonth = DatePickerUtils.sameMonth(curMonth, firstDate);
|
|
||||||
bool isLastMonth = DatePickerUtils.sameMonth(curMonth, lastDate);
|
|
||||||
|
|
||||||
String? prevTooltip = isFirstMonth
|
|
||||||
? null
|
|
||||||
: "${localizations.previousMonthTooltip} $prevMonthStr";
|
|
||||||
|
|
||||||
String? nextTooltip =
|
|
||||||
isLastMonth ? null : "${localizations.nextMonthTooltip} $nextMonthStr";
|
|
||||||
|
|
||||||
DayBasedChangeablePickerState newState = DayBasedChangeablePickerState(
|
|
||||||
currentMonth: curMonth,
|
|
||||||
curMonthDis: curMonthStr,
|
|
||||||
prevMonthDis: prevMonthStr,
|
|
||||||
nextMonthDis: nextMonthStr,
|
|
||||||
prevTooltip: prevTooltip,
|
|
||||||
nextTooltip: nextTooltip,
|
|
||||||
isFirstMonth: isFirstMonth,
|
|
||||||
isLastMonth: isLastMonth);
|
|
||||||
|
|
||||||
_updateState(newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Closes controller.
|
|
||||||
void dispose() {
|
|
||||||
_controller.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void _updateState(DayBasedChangeablePickerState newState) {
|
|
||||||
_lastVal = newState;
|
|
||||||
_controller.add(newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
final StreamController<DayBasedChangeablePickerState> _controller =
|
|
||||||
StreamController.broadcast();
|
|
||||||
|
|
||||||
DayBasedChangeablePickerState? _lastVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// View Model for the [DayBasedChangeablePicker].
|
|
||||||
class DayBasedChangeablePickerState {
|
|
||||||
/// Display name of the current month.
|
|
||||||
final String curMonthDis;
|
|
||||||
|
|
||||||
/// Display name of the previous month.
|
|
||||||
final String prevMonthDis;
|
|
||||||
|
|
||||||
/// Display name of the next month.
|
|
||||||
final String nextMonthDis;
|
|
||||||
|
|
||||||
/// Tooltip for the previous month icon.
|
|
||||||
final String? prevTooltip;
|
|
||||||
|
|
||||||
/// Tooltip for the next month icon.
|
|
||||||
final String? nextTooltip;
|
|
||||||
|
|
||||||
/// Tooltip for the current month icon.
|
|
||||||
final DateTime currentMonth;
|
|
||||||
|
|
||||||
/// If selected month is the month contains last date user can select.
|
|
||||||
final bool isLastMonth;
|
|
||||||
|
|
||||||
/// If selected month is the month contains first date user can select.
|
|
||||||
final bool isFirstMonth;
|
|
||||||
|
|
||||||
/// Creates view model for the [DayBasedChangeablePicker].
|
|
||||||
DayBasedChangeablePickerState({
|
|
||||||
required this.curMonthDis,
|
|
||||||
required this.prevMonthDis,
|
|
||||||
required this.nextMonthDis,
|
|
||||||
required this.currentMonth,
|
|
||||||
required this.isLastMonth,
|
|
||||||
required this.isFirstMonth,
|
|
||||||
this.prevTooltip,
|
|
||||||
this.nextTooltip,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'date_picker_keys.dart';
|
|
||||||
import 'date_picker_styles.dart';
|
|
||||||
import 'day_based_changable_picker.dart';
|
|
||||||
import 'day_picker_selection.dart';
|
|
||||||
import 'day_type.dart';
|
|
||||||
import 'event_decoration.dart';
|
|
||||||
import 'i_selectable_picker.dart';
|
|
||||||
import 'layout_settings.dart';
|
|
||||||
|
|
||||||
/// Date picker for selection one day.
|
|
||||||
class DayPicker<T extends Object> extends StatelessWidget {
|
|
||||||
DayPicker._({Key? key,
|
|
||||||
required this.onChanged,
|
|
||||||
required this.firstDate,
|
|
||||||
required this.lastDate,
|
|
||||||
required this.selectionLogic,
|
|
||||||
required this.selection,
|
|
||||||
this.initiallyShowDate,
|
|
||||||
this.datePickerLayoutSettings = const DatePickerLayoutSettings(),
|
|
||||||
this.datePickerStyles,
|
|
||||||
this.datePickerKeys,
|
|
||||||
this.selectableDayPredicate,
|
|
||||||
this.eventDecorationBuilder,
|
|
||||||
this.onMonthChanged}) : super(key: key);
|
|
||||||
|
|
||||||
/// Creates a day picker where only one single day can be selected.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DayPicker.multi] - day picker where many single days can be selected.
|
|
||||||
static DayPicker<DateTime> single({
|
|
||||||
Key? key,
|
|
||||||
required DateTime selectedDate,
|
|
||||||
required ValueChanged<DateTime> onChanged,
|
|
||||||
required DateTime firstDate,
|
|
||||||
required DateTime lastDate,
|
|
||||||
DatePickerLayoutSettings datePickerLayoutSettings
|
|
||||||
= const DatePickerLayoutSettings(),
|
|
||||||
DateTime? initiallyShowDate,
|
|
||||||
DatePickerRangeStyles? datePickerStyles,
|
|
||||||
DatePickerKeys? datePickerKeys,
|
|
||||||
SelectableDayPredicate? selectableDayPredicate,
|
|
||||||
EventDecorationBuilder? eventDecorationBuilder,
|
|
||||||
ValueChanged<DateTime>? onMonthChanged
|
|
||||||
})
|
|
||||||
{
|
|
||||||
assert(!firstDate.isAfter(lastDate));
|
|
||||||
assert(!lastDate.isBefore(firstDate));
|
|
||||||
assert(!selectedDate.isBefore(firstDate));
|
|
||||||
assert(!selectedDate.isAfter(lastDate));
|
|
||||||
assert(initiallyShowDate == null
|
|
||||||
|| !initiallyShowDate.isAfter(lastDate));
|
|
||||||
assert(initiallyShowDate == null
|
|
||||||
|| !initiallyShowDate.isBefore(firstDate));
|
|
||||||
|
|
||||||
final selection = DayPickerSingleSelection(selectedDate);
|
|
||||||
final selectionLogic = DaySelectable(
|
|
||||||
selectedDate, firstDate, lastDate,
|
|
||||||
selectableDayPredicate: selectableDayPredicate);
|
|
||||||
|
|
||||||
return DayPicker<DateTime>._(
|
|
||||||
onChanged: onChanged,
|
|
||||||
firstDate: firstDate,
|
|
||||||
lastDate: lastDate,
|
|
||||||
initiallyShowDate: initiallyShowDate,
|
|
||||||
selectionLogic: selectionLogic,
|
|
||||||
selection: selection,
|
|
||||||
eventDecorationBuilder: eventDecorationBuilder,
|
|
||||||
onMonthChanged: onMonthChanged,
|
|
||||||
selectableDayPredicate: selectableDayPredicate,
|
|
||||||
datePickerKeys: datePickerKeys,
|
|
||||||
datePickerStyles: datePickerStyles,
|
|
||||||
datePickerLayoutSettings: datePickerLayoutSettings,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Creates a day picker where many single days can be selected.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DayPicker.single] - day picker where only one single day
|
|
||||||
/// can be selected.
|
|
||||||
static DayPicker<List<DateTime>> multi({Key? key,
|
|
||||||
required List<DateTime> selectedDates,
|
|
||||||
required ValueChanged<List<DateTime>> onChanged,
|
|
||||||
required DateTime firstDate,
|
|
||||||
required DateTime lastDate,
|
|
||||||
DatePickerLayoutSettings datePickerLayoutSettings
|
|
||||||
= const DatePickerLayoutSettings(),
|
|
||||||
DateTime? initiallyShowDate,
|
|
||||||
DatePickerRangeStyles? datePickerStyles,
|
|
||||||
DatePickerKeys? datePickerKeys,
|
|
||||||
SelectableDayPredicate? selectableDayPredicate,
|
|
||||||
EventDecorationBuilder? eventDecorationBuilder,
|
|
||||||
ValueChanged<DateTime>? onMonthChanged})
|
|
||||||
{
|
|
||||||
assert(!firstDate.isAfter(lastDate));
|
|
||||||
assert(!lastDate.isBefore(firstDate));
|
|
||||||
assert(initiallyShowDate == null
|
|
||||||
|| !initiallyShowDate.isAfter(lastDate));
|
|
||||||
assert(initiallyShowDate == null
|
|
||||||
|| !initiallyShowDate.isBefore(lastDate));
|
|
||||||
|
|
||||||
final selection = DayPickerMultiSelection(selectedDates);
|
|
||||||
final selectionLogic = DayMultiSelectable(
|
|
||||||
selectedDates, firstDate, lastDate,
|
|
||||||
selectableDayPredicate: selectableDayPredicate);
|
|
||||||
|
|
||||||
return DayPicker<List<DateTime>>._(
|
|
||||||
onChanged: onChanged,
|
|
||||||
firstDate: firstDate,
|
|
||||||
lastDate: lastDate,
|
|
||||||
initiallyShowDate: initiallyShowDate,
|
|
||||||
selectionLogic: selectionLogic,
|
|
||||||
selection: selection,
|
|
||||||
eventDecorationBuilder: eventDecorationBuilder,
|
|
||||||
onMonthChanged: onMonthChanged,
|
|
||||||
selectableDayPredicate: selectableDayPredicate,
|
|
||||||
datePickerKeys: datePickerKeys,
|
|
||||||
datePickerStyles: datePickerStyles,
|
|
||||||
datePickerLayoutSettings: datePickerLayoutSettings,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The currently selected date.
|
|
||||||
///
|
|
||||||
/// This date is highlighted in the picker.
|
|
||||||
final DayPickerSelection selection;
|
|
||||||
|
|
||||||
/// Called when the user picks a day.
|
|
||||||
final ValueChanged<T> onChanged;
|
|
||||||
|
|
||||||
/// The earliest date the user is permitted to pick.
|
|
||||||
final DateTime firstDate;
|
|
||||||
|
|
||||||
/// The latest date the user is permitted to pick.
|
|
||||||
final DateTime lastDate;
|
|
||||||
|
|
||||||
/// Date for defining what month should be shown initially.
|
|
||||||
///
|
|
||||||
/// In case of null earliest of the [selection] will be shown.
|
|
||||||
final DateTime? initiallyShowDate;
|
|
||||||
|
|
||||||
/// Layout settings what can be customized by user
|
|
||||||
final DatePickerLayoutSettings datePickerLayoutSettings;
|
|
||||||
|
|
||||||
/// Styles what can be customized by user
|
|
||||||
final DatePickerRangeStyles? datePickerStyles;
|
|
||||||
|
|
||||||
/// Some keys useful for integration tests
|
|
||||||
final DatePickerKeys? datePickerKeys;
|
|
||||||
|
|
||||||
/// Function returns if day can be selected or not.
|
|
||||||
///
|
|
||||||
/// If null
|
|
||||||
final SelectableDayPredicate? selectableDayPredicate;
|
|
||||||
|
|
||||||
/// Builder to get event decoration for each date.
|
|
||||||
///
|
|
||||||
/// All event styles are overriden by selected styles
|
|
||||||
/// except days with dayType is [DayType.notSelected].
|
|
||||||
final EventDecorationBuilder? eventDecorationBuilder;
|
|
||||||
|
|
||||||
// Called when the user changes the month.
|
|
||||||
/// New DateTime object represents first day of new month and 00:00 time.
|
|
||||||
final ValueChanged<DateTime>? onMonthChanged;
|
|
||||||
|
|
||||||
/// Logic to handle user's selections.
|
|
||||||
final ISelectablePicker<T> selectionLogic;
|
|
||||||
|
|
||||||
@override
|
|
||||||
// ignore: prefer_expression_function_bodies
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return DayBasedChangeablePicker<T>(
|
|
||||||
selectablePicker: selectionLogic,
|
|
||||||
selection: selection,
|
|
||||||
firstDate: firstDate,
|
|
||||||
lastDate: lastDate,
|
|
||||||
initiallyShownDate: initiallyShowDate,
|
|
||||||
onChanged: onChanged,
|
|
||||||
datePickerLayoutSettings: datePickerLayoutSettings,
|
|
||||||
datePickerStyles: datePickerStyles ?? DatePickerRangeStyles(),
|
|
||||||
datePickerKeys: datePickerKeys,
|
|
||||||
eventDecorationBuilder: eventDecorationBuilder,
|
|
||||||
onMonthChanged: onMonthChanged,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
import 'date_period.dart';
|
|
||||||
import 'utils.dart';
|
|
||||||
|
|
||||||
/// Base class for day based pickers selection.
|
|
||||||
abstract class DayPickerSelection {
|
|
||||||
|
|
||||||
/// If this is before [dateTime].
|
|
||||||
bool isBefore(DateTime dateTime);
|
|
||||||
|
|
||||||
/// If this is after [dateTime].
|
|
||||||
bool isAfter(DateTime dateTime);
|
|
||||||
|
|
||||||
/// Returns earliest [DateTime] in this selection.
|
|
||||||
DateTime get earliest;
|
|
||||||
|
|
||||||
/// If this selection is empty.
|
|
||||||
bool get isEmpty;
|
|
||||||
|
|
||||||
/// If this selection is not empty.
|
|
||||||
bool get isNotEmpty;
|
|
||||||
|
|
||||||
/// Constructor to allow children to have constant constructor.
|
|
||||||
const DayPickerSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Selection with only one selected date.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DayPickerMultiSelection] - selection with one or many single dates.
|
|
||||||
/// * [DayPickerRangeSelection] - date period selection.
|
|
||||||
class DayPickerSingleSelection extends DayPickerSelection {
|
|
||||||
|
|
||||||
/// Selected date.
|
|
||||||
final DateTime selectedDate;
|
|
||||||
|
|
||||||
/// Creates selection with only one selected date.
|
|
||||||
const DayPickerSingleSelection(this.selectedDate)
|
|
||||||
: assert(selectedDate != null);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isAfter(DateTime dateTime) => selectedDate.isAfter(dateTime);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isBefore(DateTime dateTime) => selectedDate.isAfter(dateTime);
|
|
||||||
|
|
||||||
@override
|
|
||||||
DateTime get earliest => selectedDate;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isEmpty => selectedDate == null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isNotEmpty => selectedDate != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Selection with one or many single dates.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DayPickerSingleSelection] - selection with only one selected date.
|
|
||||||
/// * [DayPickerRangeSelection] - date period selection.
|
|
||||||
class DayPickerMultiSelection extends DayPickerSelection {
|
|
||||||
|
|
||||||
/// List of the selected dates.
|
|
||||||
final List<DateTime> selectedDates;
|
|
||||||
|
|
||||||
/// Selection with one or many single dates.
|
|
||||||
DayPickerMultiSelection(this.selectedDates)
|
|
||||||
: assert(selectedDates != null);
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isAfter(DateTime dateTime)
|
|
||||||
=> selectedDates.every((d) => d.isAfter(dateTime));
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isBefore(DateTime dateTime)
|
|
||||||
=> selectedDates.every((d) => d.isBefore(dateTime));
|
|
||||||
|
|
||||||
@override
|
|
||||||
DateTime get earliest => DatePickerUtils.getEarliestFromList(selectedDates);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isEmpty => selectedDates.isEmpty;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isNotEmpty => selectedDates.isNotEmpty;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Date period selection.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DayPickerSingleSelection] - selection with only one selected date.
|
|
||||||
/// * [DayPickerMultiSelection] - selection with one or many single dates.
|
|
||||||
class DayPickerRangeSelection extends DayPickerSelection {
|
|
||||||
|
|
||||||
/// Selected period.
|
|
||||||
final DatePeriod selectedRange;
|
|
||||||
|
|
||||||
/// Date period selection.
|
|
||||||
const DayPickerRangeSelection(this.selectedRange)
|
|
||||||
: assert(selectedRange != null);
|
|
||||||
|
|
||||||
@override
|
|
||||||
DateTime get earliest => selectedRange.start;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isAfter(DateTime dateTime) => selectedRange.start.isAfter(dateTime);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isBefore(DateTime dateTime) => selectedRange.end.isBefore(dateTime);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isEmpty => selectedRange == null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isNotEmpty => selectedRange != null;
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/// Type of the day in day based date picker.
|
|
||||||
enum DayType {
|
|
||||||
/// start of the selected period
|
|
||||||
start,
|
|
||||||
|
|
||||||
/// middle of the selected period
|
|
||||||
middle,
|
|
||||||
|
|
||||||
/// end of the selected period
|
|
||||||
end,
|
|
||||||
|
|
||||||
/// selected single day
|
|
||||||
single,
|
|
||||||
|
|
||||||
/// disabled day
|
|
||||||
disabled,
|
|
||||||
|
|
||||||
/// not selected day (but not disabled)
|
|
||||||
notSelected
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
|
||||||
|
|
||||||
import 'day_picker.dart';
|
|
||||||
import 'range_picker.dart';
|
|
||||||
import 'week_picker.dart';
|
|
||||||
|
|
||||||
|
|
||||||
/// Signature for function which is used to set set specific decoration for
|
|
||||||
/// some days in [DayPicker], [WeekPicker] and [RangePicker].
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [DayPicker.eventDecorationBuilder]
|
|
||||||
/// * [WeekPicker.eventDecorationBuilder]
|
|
||||||
/// * [RangePicker.eventDecorationBuilder]
|
|
||||||
typedef EventDecorationBuilder = EventDecoration? Function(DateTime date);
|
|
||||||
|
|
||||||
|
|
||||||
/// Class to store styles for event (specific day in the date picker).
|
|
||||||
@immutable
|
|
||||||
class EventDecoration {
|
|
||||||
|
|
||||||
/// Cell decoration for the specific day in the date picker (event).
|
|
||||||
final BoxDecoration? boxDecoration;
|
|
||||||
|
|
||||||
/// Style for number of the specific day in the date picker (event).
|
|
||||||
final TextStyle? textStyle;
|
|
||||||
|
|
||||||
/// Creates decoration for special day.
|
|
||||||
///
|
|
||||||
/// Used for [EventDecorationBuilder] function which is usually passed to
|
|
||||||
/// [DayPicker.eventDecorationBuilder], [WeekPicker.eventDecorationBuilder]
|
|
||||||
/// and [RangePicker.eventDecorationBuilder] to set specific decoration for
|
|
||||||
/// some days.
|
|
||||||
const EventDecoration({this.boxDecoration, this.textStyle});
|
|
||||||
}
|
|
||||||