ifgyong 4 years ago
parent fe04f186db
commit 5dccd93949

@ -8,7 +8,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="18463f0e-cf10-4ee2-975b-376476396e12" name="Default Changelist" comment=""> <list default="true" id="18463f0e-cf10-4ee2-975b-376476396e12" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

@ -58,6 +58,9 @@ Now in your Dart code, you can use:
import 'package:flutter_custom_calendar/flutter_custom_calendar.dart'; import 'package:flutter_custom_calendar/flutter_custom_calendar.dart';
``` ```
### 动画演示
![](./img.gif)
### [查看API](https://github.com/ifgyong/flutter_custom_calendar/blob/master/API.md) ### [查看API](https://github.com/ifgyong/flutter_custom_calendar/blob/master/API.md)
### [查看一个例子 如何使用](https://github.com/ifgyong/flutter_custom_calendar/blob/master/example/lib/main.dart) ### [查看一个例子 如何使用](https://github.com/ifgyong/flutter_custom_calendar/blob/master/example/lib/main.dart)

@ -106,11 +106,30 @@ class _MyHomePageState extends State<MyHomePage> {
appBar: AppBar( appBar: AppBar(
title: Text(widget.title), title: Text(widget.title),
), ),
body: Center( body: CupertinoScrollbar(
child: Column( child: CustomScrollView(
mainAxisAlignment: MainAxisAlignment.center, slivers: <Widget>[
children: <Widget>[ _topButtons(),
Wrap( SliverToBoxAdapter(
child: calendar,
),
SliverToBoxAdapter(
child: Container(
child: Text(
' $_selectDate ',
style: TextStyle(color: Theme.of(context).focusColor),
),
),
)
],
),
),
);
}
Widget _topButtons() {
return SliverToBoxAdapter(
child: Wrap(
direction: Axis.vertical, direction: Axis.vertical,
crossAxisAlignment: WrapCrossAlignment.start, crossAxisAlignment: WrapCrossAlignment.start,
children: <Widget>[ children: <Widget>[
@ -165,16 +184,6 @@ class _MyHomePageState extends State<MyHomePage> {
) )
], ],
), ),
calendar,
Expanded(
child: Text(
' $_selectDate ',
style: TextStyle(color: Theme.of(context).focusColor),
),
)
],
),
),
); );
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 KiB

@ -1,53 +1,55 @@
name: flutter_custom_calendar name: flutter_custom_calendar
description: A new Flutter Calendar package. description: A calendar control of flutter that supports three selection modes。
version: 0.0.1 version: 1.0.4
author: xiaodong <450468291@qq.com> homepage: http://www.fgyong.cn
homepage: https://github.com/LXD312569496/flutter_custom_calendar author: fgyong
repository: https://github.com/ifgyong/flutter_custom_calendar
issue_tracker: https://github.com/ifgyong/flutter_custom_calendar/issues
environment: environment:
sdk: ">=2.1.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
provider: ^4.0.4
provider: ^4.1.3
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter. # The following section is specific to Flutter.
flutter: flutter:
# To add assets to your package, add an assets section, like this: # To add assets to your package, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
# #
# For details regarding assets in packages, see # For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages # https://flutter.dev/assets-and-images/#from-packages
# #
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.
# To add custom fonts to your package, add a fonts section here, # To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a # 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 # "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For # list giving the asset and other descriptors for the font. For
# example: # example:
# fonts: # fonts:
# - family: Schyler # - family: Schyler
# fonts: # fonts:
# - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf # - asset: fonts/Schyler-Italic.ttf
# style: italic # style: italic
# - family: Trajan Pro # - family: Trajan Pro
# fonts: # fonts:
# - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf # - asset: fonts/TrajanPro_Bold.ttf
# weight: 700 # weight: 700
# #
# For details regarding fonts in packages, see # For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages # https://flutter.dev/custom-fonts/#from-packages

Loading…
Cancel
Save