From cc8cfb137487e3fe2fbc1baf226f018b91cf386f Mon Sep 17 00:00:00 2001 From: Gaspard Merten Date: Sun, 1 Mar 2020 23:29:41 +0100 Subject: [PATCH] Updating readme.md --- CHANGELOG.md | 4 +- LICENSE | 58 ++++++++++++++++++- README.md | 54 ++++++++++++++--- example/example.png | Bin 0 -> 16323 bytes example/main.dart | 53 +++++++++++++++++ pubspec.lock | 138 -------------------------------------------- pubspec.yaml | 43 +------------- 7 files changed, 159 insertions(+), 191 deletions(-) create mode 100644 example/example.png create mode 100644 example/main.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index ac07159..847d60d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -## [0.0.1] - TODO: Add release date. +## 0.0.1 -* TODO: Describe initial release. +* Initial version diff --git a/LICENSE b/LICENSE index ba75c69..b15d970 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,57 @@ -TODO: Add your license here. +Original location: https://www.apache.org/licenses/LICENSE-2.0 + +APACHE LICENSE, VERSION 2.0 + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.md b/README.md index 309dede..17f1211 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,52 @@ # date_field -Contains DateField and DateFormField +Contains DateField and DateFormField! ## Getting Started -This project is a starting point for a Dart -[package](https://flutter.dev/developing-packages/), -a library module containing code that can be shared easily across -multiple Flutter or Dart projects. +Just to let you know, this is how it looks like without any customization: -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. + + +The best way to discover this package is simply to check the example page! + +There are two widgets in this package: + +- DateField +- DateFormField + +The second one is wrapping the first one with a FormField widget! This way you can integrate it in your form structure flawlessly. + +The DateField widget returns an InputDecorator with an Inkwell which will display a date picker (*platform responsive*) which allows the user to select the date he wants! + +You can customize the widget a lot thanks to these parameters: + +

+  /// Callback for whenever the user selects a [DateTime]
+  final ValueChanged onDateSelected;
+
+  /// The current selected date to display inside the field
+  final DateTime selectedDate;
+
+  /// (optional) The first date that the user can select (default is 1900)
+  final DateTime firstDate;
+
+  /// (optional) The last date that the user can select (default is 2100)
+  final DateTime lastDate;
+
+  /// Let you choose the [DatePickerMode] for the date picker! (default is [DatePickerMode.day]
+  final DatePickerMode initialDatePickerMode;
+
+  /// The label to display for the field (default is 'Select date')
+  final String label;
+
+  /// (optional) The error text that should be displayed under the field
+  final String errorText;
+
+  /// (optional) Custom [InputDecoration] for the [InputDecorator] widget
+  final InputDecoration decoration;
+
+  /// (optional) How to display the [DateTime] for the user (default is [DateFormat.yMMMD])
+  final DateFormat dateFormat;
+
+
\ No newline at end of file diff --git a/example/example.png b/example/example.png new file mode 100644 index 0000000000000000000000000000000000000000..88d633c043052f2ff517ad7cabc2a90e40f81b77 GIT binary patch literal 16323 zcmeHuc|4SF-}Wf|(83^v?4pnmA`B&wJ!L6tNOl_gSSw-_rbWn_U4+QK7Q+xfdO%+8{UMt%SyrHzdqIm^{Dj*!$H9rLJX&zj^KT~4 zrj_6PSu~RomoXV-biPGlf7dqswZ2-MW67O<&k?__H`a-7IJ~EmSGT5;3<8hCS2RzOPr@TNo;VPsf4=HZon2&S$$(QFt=yka z-)jT*XQSvf<+mnmXVRm!_BR6dqoXghiNUE$x3f5fl_-s~ zcq*`5R(X`=!f6xN7Rhp7^1IALwfyRJ!&r}g+pa;^wgmm#=1&IA%*R5{^wRP&Dr<&U)qaxL#Q^+`|KTg}7`MoANNu87&RzpWaaOpi8gTC|R}%}`zW zCa!I05z5zTXrKFx2(hCRV%H{Qy<=Jwyoz?E;KdUrzB6Uv?(OP zr|}Y98sd|#HQTc}Q*E##)A1X_J|ZF}0TAoiM&6CVr<`J@%qc$BQi6rdn z&B_t76NhI=!2Zt23?X3G(tD*vD#xhiJpaQG4sRR7`){nWjcW2fQYd<2oP|A7@jIp- zKdici9cAZ>x;mGeMUvw98_RerShj#3Q zJxLrs4#Se%j~}ipO-tPU^pH(g;whSM*hr(Yp*}rS% zE>zW;nM8=}qIz1{iG8{eM*sDXNs~zhxnm{|+tnm)gqbiaYA8Z5?Z_=;ztWb!q&;RY zlwajy=<=1XEA5q5Y`&dY0C{cesXw!G)lz5ZnZy`uJM_blF& zA>5))cCl(jUnRk{OH(R6!E?CW>g7njS#8m<_uS-cV3}~q&#>O(`^sI-BYW$mGX}NW zdNs~I6m=?`ev$dJDtuS*uE)Ctb!^d#BEuU2dn-w+L`Ln25f%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YL1w_S|m@sW?zbcmV4m+duOY9UfynI*T6 zCcQnD)2M5av>W3U67$V-Qq5B%53$YCt5v2-)inv_$KMA!dhqA@lA33^%RCZzpjR-xHB8TBG?I3Wm&Na-135^%{@D0Q=1KWN6y4QP^`4tEwGvdWv|=iyyaY7 z#DaYLS^fn?dUB8K1PM~1?qV1_eSRq|m*KO!Q*Q%lvm+lJgGI?oFh-}ZwQ4xNV`M#Y|~VE@~UoC(DXjqk1eH+%flK!Dc0ef zd?HEPpvD@JRRL`(dHzGq-LsGc_-pI1Bj%l>wni)O<*dpzsqBM6F;)8jgPP{XH$aq( zl3Z?4%0e5AB3AL)s23j*1{4{0WmqqD97(yu_(_^H?`Y3FbvpK?131LXi)t_hd$mi| zU_uG!EuQ#^Op@IcCIziBb4A8)oQ3zgDt|sc(#ajd*2!>Og0Y1f==h%(PhD)p%|%SI zbtrJxW!_J@G=^w*9-fwXVL@KBtpfuMv>}ct(XazpJt;ME>Wn#Pq4JakQSxdnse`h4 z%=tjKmq%YVu4V_0pzF_D9f__Z*xIun3F$|%ul;~tX?Zo@m%zoJuj9eNIGPtsg%RdY zz&@#!Khu#V+WJ*Xc0N)_n1>Rda7b;m2ikmN zW)fT~SH8_a7D~Bk?&cg?28VnmKa95p?72G8vNpSp`JC8?vvn0)KI|jnqtK34O$E`@ z?kRQ?z(0H$e_>Jsr06HSE?4{9_hVX!oO}UKK>-i#<<-wgbiLE^=O}-97d!Os1%7;K71R{ZBey z>=%5@AiTB!IqfL{p08QN5ZK6p&_sVvou(%8US>XjAP5f7>Z`ytX*dKkI$?=Jx(Jo2itW{P7T2 PT9oQFEu}ogyN~}D{guEz literal 0 HcmV?d00001 diff --git a/example/main.dart b/example/main.dart new file mode 100644 index 0000000..dd19ffc --- /dev/null +++ b/example/main.dart @@ -0,0 +1,53 @@ +import 'package:date_field/date_field.dart'; +import 'package:flutter/material.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + + runApp(ExampleApp()); +} + +class ExampleApp extends StatelessWidget { + + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Example app', + home: HomeWidget() + ); + } +} + + +class HomeWidget extends StatefulWidget { + @override + _HomeWidgetState createState() => _HomeWidgetState(); +} + +class _HomeWidgetState extends State { + DateTime selectedDate; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Column( + children: [ + Column( + children: [ + DateField( + selectedDate: selectedDate, + onDateSelected: (DateTime date) { + setState(() { + selectedDate = date; + }); + }, + lastDate: DateTime(2020), + ), + ], + ), + ], + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 884569d..ea0fc89 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,41 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" collection: dependency: transitive description: @@ -43,37 +8,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.11" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" intl: dependency: "direct main" description: @@ -81,13 +20,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.16.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.6" meta: dependency: transitive description: @@ -102,74 +34,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.6.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.5" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.11" typed_data: dependency: transitive description: @@ -184,12 +53,5 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" sdks: dart: ">=2.5.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8fa9e43..76bbab8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: date_field description: Contains DateField and DateFormField version: 0.0.1 - +homepage: 'https://github.com/GaspardMerten/date_field' environment: sdk: ">=2.1.0 <3.0.0" @@ -10,44 +10,3 @@ dependencies: intl: ^0.16.1 flutter: sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # To add custom fonts to your package, 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 in packages, see - # https://flutter.dev/custom-fonts/#from-packages