Skip to content

Commit

Permalink
Upgraded to v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyyy688 committed Feb 2, 2023
1 parent 2d8a5ae commit e658eed
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 98 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.2.0]
* Updated some dependencies to support Dart 3
* Updated flutter version
* Added linting support
* Fixed some linting warnings
* Edited REAME.md
## [0.1.0]
* Edited REAME.md
* Upgraded Example's Android Dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Add the textfield_datepicker package to your `pubspec.yml` file.

```yml
dependencies:
textfield_datepicker: ^0.1.0
textfield_datepicker: ^0.2.0
```
Import the package into your dart file
Expand Down
29 changes: 29 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
48 changes: 17 additions & 31 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
Expand All @@ -21,28 +21,21 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +49,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -80,7 +73,7 @@ packages:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
version: "0.18.0"
lints:
dependency: transitive
description:
Expand All @@ -94,28 +87,28 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -127,7 +120,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
Expand All @@ -148,42 +141,35 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.12"
textfield_datepicker:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.1.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.2.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.18.6 <3.0.0"
flutter: ">=1.17.0"
15 changes: 10 additions & 5 deletions lib/src/textfield_dateAndTimePicker.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: library_private_types_in_public_api, file_names

library textfield_datepicker;

import 'package:flutter/cupertino.dart';
Expand Down Expand Up @@ -171,7 +173,7 @@ class TextfieldDateAndTimePicker extends StatefulWidget {
///
final EdgeInsetsGeometry? textfieldDateTimePickerPadding;

TextfieldDateAndTimePicker({
const TextfieldDateAndTimePicker({
Key? key,
required this.textfieldDateAndTimePickerController,
this.autofillHints,
Expand Down Expand Up @@ -287,8 +289,7 @@ class _TextfieldDateAndTimePickerState
return;
} else {
setState(() {
widget.textfieldDateAndTimePickerController.text =
value == null ? "" : value;
widget.textfieldDateAndTimePickerController.text = value ?? '';
});
}
});
Expand Down Expand Up @@ -316,8 +317,12 @@ class _TextfieldDateAndTimePickerState
textAlignVertical: widget.textAlignVertical,
textDirection: widget.textDirection,
textInputAction: widget.textInputAction,
toolbarOptions: ToolbarOptions(
copy: true, cut: true, paste: false, selectAll: true),
toolbarOptions: const ToolbarOptions(
copy: true,
cut: true,
paste: false,
selectAll: true,
),
enabled: true,
autofocus: false,
keyboardType: null,
Expand Down
13 changes: 9 additions & 4 deletions lib/src/textfield_datePicker.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names, library_private_types_in_public_api, prefer_const_constructors

library textfield_datepicker;

import 'package:flutter/cupertino.dart';
Expand Down Expand Up @@ -146,7 +148,7 @@ class TextfieldDatePicker extends StatefulWidget {
///
final EdgeInsetsGeometry? textfieldDatePickerPadding;

TextfieldDatePicker({
const TextfieldDatePicker({
Key? key,
required this.textfieldDatePickerController,
this.autofillHints,
Expand Down Expand Up @@ -245,8 +247,7 @@ class _TextfieldDatePickerState extends State<TextfieldDatePicker> {
return;
} else {
setState(() {
widget.textfieldDatePickerController.text =
value == null ? "" : value;
widget.textfieldDatePickerController.text = value ?? '';
});
}

Expand Down Expand Up @@ -277,7 +278,11 @@ class _TextfieldDatePickerState extends State<TextfieldDatePicker> {
textDirection: widget.textDirection,
textInputAction: widget.textInputAction,
toolbarOptions: ToolbarOptions(
copy: true, cut: true, paste: false, selectAll: true),
copy: true,
cut: true,
paste: false,
selectAll: true,
),
enabled: true,
autofocus: false,
keyboardType: null,
Expand Down
15 changes: 10 additions & 5 deletions lib/src/textfield_timePicker.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names, library_private_types_in_public_api

library textfield_datepicker;

import 'package:flutter/material.dart';
Expand Down Expand Up @@ -95,7 +97,7 @@ class TextfieldTimePicker extends StatefulWidget {
///
final EdgeInsetsGeometry? textfieldTimePickerPadding;

TextfieldTimePicker({
const TextfieldTimePicker({
Key? key,
required this.textfieldDateAndTimePickerController,
this.autofillHints,
Expand Down Expand Up @@ -177,8 +179,7 @@ class _TextfieldTimePickerState extends State<TextfieldTimePicker> {
return;
} else {
setState(() {
widget.textfieldDateAndTimePickerController.text =
value == null ? "" : value;
widget.textfieldDateAndTimePickerController.text = value ?? '';
});
}

Expand Down Expand Up @@ -208,8 +209,12 @@ class _TextfieldTimePickerState extends State<TextfieldTimePicker> {
textAlignVertical: widget.textAlignVertical,
textDirection: widget.textDirection,
textInputAction: widget.textInputAction,
toolbarOptions: ToolbarOptions(
copy: true, cut: true, paste: false, selectAll: true),
toolbarOptions: const ToolbarOptions(
copy: true,
cut: true,
paste: false,
selectAll: true,
),
enabled: true,
autofocus: false,
keyboardType: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utilities/utilities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Utils {
child,
],
cancelButton: CupertinoActionSheetAction(
child: Text('Done'),
child: const Text('Done'),
onPressed: () => onClicked(),
),
),
Expand Down
12 changes: 7 additions & 5 deletions lib/src/widgets/dateAndTimePicker.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
Expand Down Expand Up @@ -161,10 +163,10 @@ class DateAndTimePicker {

_minute = timePicked.minute.toString().padLeft(2, '0');

_time = _hour! + ':' + _minute!;
_time = '${_hour!}:${_minute!}';
}

_dateAndTime = _date! + ' ' + _time + ' ' + _period;
_dateAndTime = '${_date!} $_time $_period';

return _dateAndTime;
}
Expand All @@ -188,7 +190,7 @@ class DateAndTimePicker {
/// ignore: unused_local_variable
String? picked = await Utils().showSheet(
context,
child: Container(
child: SizedBox(
height: MediaQuery.of(context).copyWith().size.height / 3,
child: CupertinoDatePicker(
dateOrder: cupertinoDateOrder,
Expand Down Expand Up @@ -234,9 +236,9 @@ class DateAndTimePicker {

_minute = _selectedDate!.minute.toString().padLeft(2, '0');

_time = _hour! + ':' + _minute!;
_time = '${_hour!}:${_minute!}';

_dateAndTime = _date! + ' ' + _time + ' ' + _period;
_dateAndTime = '${_date!} $_time $_period';
},
initialDateTime: DateTime(
cupertinoDateInitialDateTime!.year,
Expand Down
4 changes: 3 additions & 1 deletion lib/src/widgets/datePicker.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
Expand Down Expand Up @@ -119,7 +121,7 @@ class DatePicker {
/// ignore: unused_local_variable
String? picked = await Utils().showSheet(
context,
child: Container(
child: SizedBox(
height: MediaQuery.of(context).copyWith().size.height / 3,
child: CupertinoDatePicker(
dateOrder: cupertinoDateOrder,
Expand Down
Loading

0 comments on commit e658eed

Please sign in to comment.