1.21.0-9.1.pre cherrypicks (#64050)
* Update engine hash to 1.21.0-9.1.pre
* Removed the inputFormatters from the text input fields used by the Date Pickers (#63461)
* Fix App.framework path in Podfile (#63412)
Co-authored-by: Darren Austin <darrenaustin@google.com>
Co-authored-by: Jenn Magder <magder@google.com>
diff --git a/bin/internal/engine.version b/bin/internal/engine.version
index 1ba4fb6..52c3615 100644
--- a/bin/internal/engine.version
+++ b/bin/internal/engine.version
@@ -1 +1 @@
-6d86e67f04d8b8cf16c64b466a4e7a04c497f271
+267070c17a6956de1a03dbe09cda56f0c485f41b
diff --git a/dev/devicelab/bin/tasks/module_test_ios.dart b/dev/devicelab/bin/tasks/module_test_ios.dart
index e16a068..1d58782 100644
--- a/dev/devicelab/bin/tasks/module_test_ios.dart
+++ b/dev/devicelab/bin/tasks/module_test_ios.dart
@@ -191,6 +191,16 @@
// Android-only, no embedded framework.
checkDirectoryNotExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', 'android_alarm_manager.framework'));
+ section('Clean and pub get module');
+
+ await inDirectory(projectDir, () async {
+ await flutter('clean');
+ });
+
+ await inDirectory(projectDir, () async {
+ await flutter('pub', options: <String>['get']);
+ });
+
section('Add to existing iOS Objective-C app');
final Directory objectiveCHostApp = Directory(path.join(tempDir.path, 'hello_host_app'));
@@ -241,6 +251,23 @@
return TaskResult.failure('Failed to build existing Objective-C app .app');
}
+ checkFileExists(path.join(
+ objectiveCBuildDirectory.path,
+ 'Host.app',
+ 'Frameworks',
+ 'Flutter.framework',
+ 'Flutter',
+ ));
+
+ checkFileExists(path.join(
+ objectiveCBuildDirectory.path,
+ 'Host.app',
+ 'Frameworks',
+ 'App.framework',
+ 'flutter_assets',
+ 'isolate_snapshot_data',
+ ));
+
final String objectiveCAnalyticsOutput = objectiveCAnalyticsOutputFile.readAsStringSync();
if (!objectiveCAnalyticsOutput.contains('cd24: ios')
|| !objectiveCAnalyticsOutput.contains('cd25: true')
diff --git a/packages/flutter/lib/src/material/pickers/input_date_picker.dart b/packages/flutter/lib/src/material/pickers/input_date_picker.dart
index dda9714..2ef7544 100644
--- a/packages/flutter/lib/src/material/pickers/input_date_picker.dart
+++ b/packages/flutter/lib/src/material/pickers/input_date_picker.dart
@@ -16,12 +16,12 @@
import 'date_picker_common.dart';
import 'date_utils.dart' as utils;
-/// A [TextFormField] configured to accept and validate a date entered by the user.
+/// A [TextFormField] configured to accept and validate a date entered by a user.
///
-/// The text entered into this field will be constrained to only allow digits
-/// and separators. When saved or submitted, the text will be parsed into a
-/// [DateTime] according to the ambient locale. If the input text doesn't parse
-/// into a date, the [errorFormatText] message will be displayed under the field.
+/// When the field is saved or submitted, the text will be parsed into a
+/// [DateTime] according to the ambient locale's compact date format. If the
+/// input text doesn't parse into a date, the [errorFormatText] message will
+/// be displayed under the field.
///
/// [firstDate], [lastDate], and [selectableDayPredicate] provide constraints on
/// what days are valid. If the input date isn't in the date range or doesn't pass
@@ -231,9 +231,6 @@
labelText: widget.fieldLabelText ?? localizations.dateInputLabel,
),
validator: _validateDate,
- inputFormatters: <TextInputFormatter>[
- DateTextInputFormatter(localizations.dateSeparator),
- ],
keyboardType: TextInputType.datetime,
onSaved: _handleSaved,
onFieldSubmitted: _handleSubmitted,
@@ -242,39 +239,3 @@
);
}
}
-
-/// A `TextInputFormatter` set up to format dates.
-//
-// This is not publicly exported (see pickers.dart), as it is
-// just meant for internal use by `InputDatePickerFormField` and
-// `InputDateRangePicker`.
-class DateTextInputFormatter extends TextInputFormatter {
-
- /// Creates a date formatter with the given separator.
- DateTextInputFormatter(
- this.separator
- ) : _filterFormatter = FilteringTextInputFormatter.allow(RegExp('[\\d$_commonSeparators\\$separator]+'));
-
- /// List of common separators that are used in dates. This is used to make
- /// sure that if given platform's [TextInputType.datetime] keyboard doesn't
- /// provide the given locale's separator character, they can still enter the
- /// separator using one of these characters (slash, period, comma, dash, or
- /// space).
- static const String _commonSeparators = r'\/\.,-\s';
-
- /// The date separator for the current locale.
- final String separator;
-
- // Formatter that will filter out all characters except digits and date
- // separators.
- final TextInputFormatter _filterFormatter;
-
- @override
- TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
- final TextEditingValue filteredValue = _filterFormatter.formatEditUpdate(oldValue, newValue);
- return filteredValue.copyWith(
- // Replace any non-digits with the given separator
- text: filteredValue.text.replaceAll(RegExp(r'[\D]'), separator),
- );
- }
-}
diff --git a/packages/flutter/lib/src/material/pickers/input_date_range_picker.dart b/packages/flutter/lib/src/material/pickers/input_date_range_picker.dart
index 6029733..fbe9b3b 100644
--- a/packages/flutter/lib/src/material/pickers/input_date_range_picker.dart
+++ b/packages/flutter/lib/src/material/pickers/input_date_range_picker.dart
@@ -14,7 +14,6 @@
import '../theme.dart';
import 'date_utils.dart' as utils;
-import 'input_date_picker.dart' show DateTextInputFormatter;
/// Provides a pair of text fields that allow the user to enter the start and
/// end dates that represent a range of dates.
@@ -124,7 +123,6 @@
String _startErrorText;
String _endErrorText;
bool _autoSelected = false;
- List<TextInputFormatter> _inputFormatters;
@override
void initState() {
@@ -146,9 +144,6 @@
void didChangeDependencies() {
super.didChangeDependencies();
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
- _inputFormatters = <TextInputFormatter>[
- DateTextInputFormatter(localizations.dateSeparator),
- ];
if (_startDate != null) {
_startInputText = localizations.formatCompactDate(_startDate);
final bool selectText = widget.autofocus && !_autoSelected;
@@ -247,7 +242,6 @@
labelText: widget.fieldStartLabelText ?? localizations.dateRangeStartLabel,
errorText: _startErrorText,
),
- inputFormatters: _inputFormatters,
keyboardType: TextInputType.datetime,
onChanged: _handleStartChanged,
autofocus: widget.autofocus,
@@ -264,7 +258,6 @@
labelText: widget.fieldEndLabelText ?? localizations.dateRangeEndLabel,
errorText: _endErrorText,
),
- inputFormatters: _inputFormatters,
keyboardType: TextInputType.datetime,
onChanged: _handleEndChanged,
),
diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart
index cd583e3..2241bc8 100644
--- a/packages/flutter/test/material/date_picker_test.dart
+++ b/packages/flutter/test/material/date_picker_test.dart
@@ -741,7 +741,8 @@
field.controller.clear();
await tester.pumpAndSettle();
- await tester.enterText(find.byType(TextField), '20202014');
+ await tester.enterText(find.byType(TextField), '20 days, 3 months, 2003');
+ expect(find.text('20 days, 3 months, 2003'), findsOneWidget);
expect(find.text(errorFormatText), findsNothing);
await tester.tap(find.text('OK'));
diff --git a/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl b/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl
index 4d7715a..892a281 100644
--- a/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl
+++ b/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl
@@ -96,7 +96,8 @@
# Optional, defaults to two levels up from the directory of this script.
# MyApp/my_flutter/.ios/Flutter/../..
def install_flutter_application_pod(flutter_application_path)
- app_framework_dir = File.expand_path('App.framework', File.join('..', __FILE__))
+ current_directory_pathname = Pathname.new File.expand_path('..', __FILE__)
+ app_framework_dir = File.expand_path('App.framework', current_directory_pathname.to_path)
app_framework_dylib = File.join(app_framework_dir, 'App')
if !File.exist?(app_framework_dylib)
# Fake an App.framework to have something to link against if the xcode backend script has not run yet.
@@ -108,7 +109,7 @@
# Keep pod and script phase paths relative so they can be checked into source control.
# Process will be run from project directory.
- current_directory_pathname = Pathname.new File.expand_path('..', __FILE__)
+
# defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
project_directory_pathname = defined_in_file.dirname
relative = current_directory_pathname.relative_path_from project_directory_pathname