Updating documentatino
This commit is contained in:
parent
4f27d54cc6
commit
c3898a8c57
3 changed files with 42 additions and 25 deletions
|
@ -8,3 +8,6 @@
|
||||||
* Updating package description
|
* Updating package description
|
||||||
* Formatting with DartFM
|
* Formatting with DartFM
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
* Updating documentation!
|
||||||
|
|
|
@ -2,8 +2,19 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
|
||||||
|
/// A [FormField] that contains a [DateField].
|
||||||
|
///
|
||||||
|
/// This is a convenience widget that wraps a [DateField] widget in a
|
||||||
|
/// [FormField].
|
||||||
|
///
|
||||||
|
/// A [Form] ancestor is not required. The [Form] simply makes it easier to
|
||||||
|
/// save, reset, or validate multiple fields at once. To use without a [Form],
|
||||||
|
/// pass a [GlobalKey] to the constructor and use [GlobalKey.currentState] to
|
||||||
|
/// save or reset the form field.
|
||||||
class DateFormField extends StatelessWidget {
|
class DateFormField extends StatelessWidget {
|
||||||
/// An optional method to call with the final value when the form is saved via
|
/// An optional method to call with the final value when the form is saved via
|
||||||
/// [FormState.save].
|
/// [FormState.save].
|
||||||
|
@ -92,7 +103,7 @@ class DateFormField extends StatelessWidget {
|
||||||
/// [DateField]
|
/// [DateField]
|
||||||
///
|
///
|
||||||
/// Shows an [_InputDropdown] that'll trigger [DateField._selectDate] whenever the user
|
/// Shows an [_InputDropdown] that'll trigger [DateField._selectDate] whenever the user
|
||||||
/// clicks on it !
|
/// clicks on it ! The date picker is **platform responsive** (ios date picker style for ios, ...)
|
||||||
class DateField extends StatelessWidget {
|
class DateField extends StatelessWidget {
|
||||||
/// Default constructor
|
/// Default constructor
|
||||||
DateField({
|
DateField({
|
||||||
|
@ -136,6 +147,8 @@ class DateField extends StatelessWidget {
|
||||||
|
|
||||||
/// Shows a dialog asking the user to pick a date !
|
/// Shows a dialog asking the user to pick a date !
|
||||||
Future<void> _selectDate(BuildContext context) async {
|
Future<void> _selectDate(BuildContext context) async {
|
||||||
|
|
||||||
|
TextFormField();
|
||||||
if (!Platform.isIOS) {
|
if (!Platform.isIOS) {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -223,6 +236,8 @@ class _InputDropdown extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
assert(text != null);
|
||||||
|
|
||||||
BorderRadius inkwellBorderRadius;
|
BorderRadius inkwellBorderRadius;
|
||||||
|
|
||||||
if (decoration?.border?.runtimeType == OutlineInputBorder) {
|
if (decoration?.border?.runtimeType == OutlineInputBorder) {
|
||||||
|
@ -235,8 +250,7 @@ class _InputDropdown extends StatelessWidget {
|
||||||
borderRadius: inkwellBorderRadius,
|
borderRadius: inkwellBorderRadius,
|
||||||
onTap: onPressed,
|
onTap: onPressed,
|
||||||
child: InputDecorator(
|
child: InputDecorator(
|
||||||
decoration: decoration ??
|
decoration: decoration ?? InputDecoration(
|
||||||
InputDecoration(
|
|
||||||
labelText: label,
|
labelText: label,
|
||||||
errorText: errorText,
|
errorText: errorText,
|
||||||
border: UnderlineInputBorder(borderSide: BorderSide()),
|
border: UnderlineInputBorder(borderSide: BorderSide()),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: date_field
|
name: date_field
|
||||||
description: Contains DateField and DateFormField which allows the user to pick a DateTime from an input field!
|
description: Contains DateField and DateFormField which allows the user to pick a DateTime from an input field!
|
||||||
version: 0.0.2
|
version: 0.1.0
|
||||||
homepage: 'https://github.com/GaspardMerten/date_field'
|
homepage: 'https://github.com/GaspardMerten/date_field'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in a new issue