{"id":13789906,"url":"https://github.com/fluttercandies/flutter_custom_calendar","last_synced_at":"2025-05-12T07:31:13.342Z","repository":{"id":43695916,"uuid":"187379946","full_name":"fluttercandies/flutter_custom_calendar","owner":"fluttercandies","description":"Flutter的一个日历控件","archived":true,"fork":false,"pushed_at":"2024-06-24T09:47:00.000Z","size":1283,"stargazers_count":501,"open_issues_count":0,"forks_count":136,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-18T04:35:23.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluttercandies.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-18T16:21:59.000Z","updated_at":"2024-09-01T16:02:52.000Z","dependencies_parsed_at":"2024-08-03T22:12:32.849Z","dependency_job_id":null,"html_url":"https://github.com/fluttercandies/flutter_custom_calendar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_custom_calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_custom_calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_custom_calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_custom_calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluttercandies","download_url":"https://codeload.github.com/fluttercandies/flutter_custom_calendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253695082,"owners_count":21948810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T22:00:34.427Z","updated_at":"2025-05-12T07:31:12.909Z","avatar_url":"https://github.com/fluttercandies.png","language":"Dart","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"\u003e The code owner of the repo has not been actively building Flutter projects, thus the repo has been archived.\n\u003e 该项目的作者已经长时间未开发 Flutter 项目，故该项目已被归档。\n\n## flutter_custom_calendar\n\u003e 本插件是基于[flutter_custom_calendar](https://github.com/fluttercandies/flutter_custom_calendar)做了稍微的修改进行上传的。\n\n具体使用方法见[flutter_custom_calendar](https://github.com/ifgyong/flutter_custom_calendar)\n\n新增一个选择`mode`\n\n支持选择开始和结束，选择范围内的日期，使用方法\n\n```\ncontroller = new CalendarController(\n    minYear: 2019,\n    minYearMonth: 1,\n    maxYear: 2021,\n    maxYearMonth: 12,\n    showMode: CalendarConstants.MODE_SHOW_MONTH_AND_WEEK,\n    selectedDateTimeList: _selectedDate,\n    selectMode: CalendarSelectedMode.mutltiStartToEndSelect)\n  ..addOnCalendarSelectListener((dateModel) {\n    _selectedModels.add(dateModel);\n  })\n  ..addOnCalendarUnSelectListener((dateModel) {\n    if (_selectedModels.contains(dateModel)) {\n      _selectedModels.remove(dateModel);\n    }\n  });\n\n```\n`CalendarSelectedMode.mutltiStartToEndSelect`这个选择模式会选择开始和结束中间的 默认选择的。\n\n\n### 安装和使用\n\nUse this package as a library\n1. Depend on it\nAdd this to your package's pubspec.yaml file:\n\n```\ndependencies:\n  flutter_custom_calendar: ^1.0.4+0.5\n```\n\n2. Install it\nYou can install packages from the command line:\n\nwith Flutter:\n\n```\n$ flutter pub get\n```\n\nAlternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.\n\n3. Import it\nNow in your Dart code, you can use:\n\n```\nimport 'package:flutter_custom_calendar/flutter_custom_calendar.dart';\n```\n### 监听月视图和周视图状态\n\n```dart    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {\n  controller.addExpandChangeListener((value) {\n    /// 添加改变 月视图和 周视图的监听\n    _isMonthSelected = value;\n    setState(() {});\n  });\n});\n```\n### 变更月视图和周视图\n\u003e 前提条件是`showModel`是`CalendarConstants.MODE_SHOW_MONTH_AND_WEEK`或者`CalendarConstants.MODE_SHOW_WEEK_AND_MONTH`.\n\n#### 变更到周视图\n```dart\n setState(() {\n controller.weekAndMonthViewChange(CalendarConstants.MODE_SHOW_ONLY_WEEK);\n                  });\n```\n\n#### 变更到月视图\n```dart\nsetState(() {controller.weekAndMonthViewChange(CalendarConstants.MODE_SHOW_ONLY_MONTH);\n                  });\n```\n\n### 动画演示\n![](img.gif)\n### [查看API](https://github.com/ifgyong/flutter_custom_calendar/blob/master/API.md)\n\n### [查看一个例子 如何使用](https://github.com/ifgyong/flutter_custom_calendar/blob/master/example/lib/main.dart)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercandies%2Fflutter_custom_calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluttercandies%2Fflutter_custom_calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercandies%2Fflutter_custom_calendar/lists"}