Fixing inverted boolean issue (see changelog)

This commit is contained in:
Gaspard Merten 2020-03-13 00:13:31 +01:00
parent c3898a8c57
commit ddc994cdce
3 changed files with 33 additions and 26 deletions

View file

@ -11,3 +11,11 @@
## 0.1.0 ## 0.1.0
* Updating documentation! * Updating documentation!
## 0.1.1
* Formatting with DartFM!
## 0.1.2
* Fixing an incorrect boolean (iOS picker was inverted with the Android one)

View file

@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
/// A [FormField] that contains a [DateField]. /// A [FormField] that contains a [DateField].
/// ///
/// This is a convenience widget that wraps a [DateField] widget in a /// This is a convenience widget that wraps a [DateField] widget in a
@ -60,17 +59,17 @@ class DateFormField extends StatelessWidget {
const DateFormField( const DateFormField(
{Key key, {Key key,
this.onSaved, this.onSaved,
this.validator, this.validator,
this.initialValue, this.initialValue,
this.autovalidate = false, this.autovalidate = false,
this.enabled = true, this.enabled = true,
this.firstDate, this.firstDate,
this.lastDate, this.lastDate,
this.label = 'Select date', this.label = 'Select date',
this.dateFormat, this.dateFormat,
this.decoration, this.decoration,
this.initialDatePickerMode}) this.initialDatePickerMode})
: super(key: key); : super(key: key);
@override @override
@ -147,9 +146,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(); TextFormField();
if (!Platform.isIOS) { if (Platform.isIOS) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
builder: (BuildContext builder) { builder: (BuildContext builder) {
@ -208,12 +206,12 @@ class DateField extends StatelessWidget {
class _InputDropdown extends StatelessWidget { class _InputDropdown extends StatelessWidget {
const _InputDropdown( const _InputDropdown(
{Key key, {Key key,
this.label, this.label,
this.text, this.text,
this.decoration, this.decoration,
this.textStyle, this.textStyle,
this.onPressed, this.onPressed,
this.errorText}) this.errorText})
: super(key: key); : super(key: key);
/// The label to display for the field (default is 'Select date') /// The label to display for the field (default is 'Select date')
@ -250,11 +248,12 @@ class _InputDropdown extends StatelessWidget {
borderRadius: inkwellBorderRadius, borderRadius: inkwellBorderRadius,
onTap: onPressed, onTap: onPressed,
child: InputDecorator( child: InputDecorator(
decoration: decoration ?? InputDecoration( decoration: decoration ??
labelText: label, InputDecoration(
errorText: errorText, labelText: label,
border: UnderlineInputBorder(borderSide: BorderSide()), errorText: errorText,
contentPadding: EdgeInsets.only(bottom: 2.0)), border: UnderlineInputBorder(borderSide: BorderSide()),
contentPadding: EdgeInsets.only(bottom: 2.0)),
baseStyle: textStyle, baseStyle: textStyle,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View file

@ -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.1.0 version: 0.1.2
homepage: 'https://github.com/GaspardMerten/date_field' homepage: 'https://github.com/GaspardMerten/date_field'
environment: environment: