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
|
||||
* Formatting with DartFM
|
||||
|
||||
## 0.1.0
|
||||
|
||||
* Updating documentation!
|
||||
|
|
|
@ -2,8 +2,19 @@ import 'dart:io';
|
|||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.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 {
|
||||
/// An optional method to call with the final value when the form is saved via
|
||||
/// [FormState.save].
|
||||
|
@ -92,7 +103,7 @@ class DateFormField extends StatelessWidget {
|
|||
/// [DateField]
|
||||
///
|
||||
/// 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 {
|
||||
/// Default constructor
|
||||
DateField({
|
||||
|
@ -136,6 +147,8 @@ class DateField extends StatelessWidget {
|
|||
|
||||
/// Shows a dialog asking the user to pick a date !
|
||||
Future<void> _selectDate(BuildContext context) async {
|
||||
|
||||
TextFormField();
|
||||
if (!Platform.isIOS) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
|
@ -223,6 +236,8 @@ class _InputDropdown extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
assert(text != null);
|
||||
|
||||
BorderRadius inkwellBorderRadius;
|
||||
|
||||
if (decoration?.border?.runtimeType == OutlineInputBorder) {
|
||||
|
@ -235,8 +250,7 @@ class _InputDropdown extends StatelessWidget {
|
|||
borderRadius: inkwellBorderRadius,
|
||||
onTap: onPressed,
|
||||
child: InputDecorator(
|
||||
decoration: decoration ??
|
||||
InputDecoration(
|
||||
decoration: decoration ?? InputDecoration(
|
||||
labelText: label,
|
||||
errorText: errorText,
|
||||
border: UnderlineInputBorder(borderSide: BorderSide()),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: date_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'
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Reference in a new issue