text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { test('SearchViewThemeData copyWith, ==, hashCode basics', () { expect(const SearchViewThemeData(), const SearchViewThemeData().copyWith()); expect(const SearchViewThemeData().hashCode, const SearchViewThemeData() .copyWith() .hashCode); }); test('SearchViewThemeData lerp special cases', () { expect(SearchViewThemeData.lerp(null, null, 0), null); const SearchViewThemeData data = SearchViewThemeData(); expect(identical(SearchViewThemeData.lerp(data, data, 0.5), data), true); }); test('SearchViewThemeData defaults', () { const SearchViewThemeData themeData = SearchViewThemeData(); expect(themeData.backgroundColor, null); expect(themeData.elevation, null); expect(themeData.surfaceTintColor, null); expect(themeData.constraints, null); expect(themeData.side, null); expect(themeData.shape, null); expect(themeData.headerHeight, null); expect(themeData.headerTextStyle, null); expect(themeData.headerHintStyle, null); expect(themeData.dividerColor, null); const SearchViewTheme theme = SearchViewTheme(data: SearchViewThemeData(), child: SizedBox()); expect(theme.data.backgroundColor, null); expect(theme.data.elevation, null); expect(theme.data.surfaceTintColor, null); expect(theme.data.constraints, null); expect(theme.data.side, null); expect(theme.data.shape, null); expect(theme.data.headerHeight, null); expect(theme.data.headerTextStyle, null); expect(theme.data.headerHintStyle, null); expect(theme.data.dividerColor, null); }); testWidgets('Default SearchViewThemeData debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SearchViewThemeData().debugFillProperties(builder); final List<String> description = builder.properties .where((DiagnosticsNode node) => !node.isFiltered(DiagnosticLevel.info)) .map((DiagnosticsNode node) => node.toString()) .toList(); expect(description, <String>[]); }); testWidgets('SearchViewThemeData implements debugFillProperties', ( WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const SearchViewThemeData( backgroundColor: Color(0xfffffff1), elevation: 3.5, surfaceTintColor: Color(0xfffffff3), side: BorderSide(width: 2.5, color: Color(0xfffffff5)), shape: RoundedRectangleBorder(), headerHeight: 35.5, headerTextStyle: TextStyle(fontSize: 24.0), headerHintStyle: TextStyle(fontSize: 16.0), constraints: BoxConstraints(minWidth: 350, minHeight: 240), ).debugFillProperties(builder); final List<String> description = builder.properties .where((DiagnosticsNode node) => !node.isFiltered(DiagnosticLevel.info)) .map((DiagnosticsNode node) => node.toString()) .toList(); expect(description[0], 'backgroundColor: Color(0xfffffff1)'); expect(description[1], 'elevation: 3.5'); expect(description[2], 'surfaceTintColor: Color(0xfffffff3)'); expect(description[3], 'side: BorderSide(color: Color(0xfffffff5), width: 2.5)'); expect(description[4], 'shape: RoundedRectangleBorder(BorderSide(width: 0.0, style: none), BorderRadius.zero)'); expect(description[5], 'headerHeight: 35.5'); expect(description[6], 'headerTextStyle: TextStyle(inherit: true, size: 24.0)'); expect(description[7], 'headerHintStyle: TextStyle(inherit: true, size: 16.0)'); expect(description[8], 'constraints: BoxConstraints(350.0<=w<=Infinity, 240.0<=h<=Infinity)'); }); group('[Theme, SearchViewTheme, SearchView properties overrides]', () { const Color backgroundColor = Color(0xff000001); const double elevation = 5.0; const Color surfaceTintColor = Color(0xff000002); const BorderSide side = BorderSide(color: Color(0xff000003), width: 2.0); const OutlinedBorder shape = RoundedRectangleBorder(side: side, borderRadius: BorderRadius.all(Radius.circular(20.0))); const double headerHeight = 45.0; const TextStyle headerTextStyle = TextStyle(color: Color(0xff000004), fontSize: 20.0); const TextStyle headerHintStyle = TextStyle(color: Color(0xff000005), fontSize: 18.0); const BoxConstraints constraints = BoxConstraints(minWidth: 250.0, maxWidth: 300.0, minHeight: 450.0); const SearchViewThemeData searchViewTheme = SearchViewThemeData( backgroundColor: backgroundColor, elevation: elevation, surfaceTintColor: surfaceTintColor, side: side, shape: shape, headerHeight: headerHeight, headerTextStyle: headerTextStyle, headerHintStyle: headerHintStyle, constraints: constraints, ); Widget buildFrame({ bool useSearchViewProperties = false, SearchViewThemeData? searchViewThemeData, SearchViewThemeData? overallTheme }) { final Widget child = Builder( builder: (BuildContext context) { if (!useSearchViewProperties) { return SearchAnchor( viewHintText: 'hint text', builder: (BuildContext context, SearchController controller) { return const Icon(Icons.search); }, suggestionsBuilder: (BuildContext context, SearchController controller) { return <Widget>[]; }, isFullScreen: false, ); } return SearchAnchor( viewHintText: 'hint text', builder: (BuildContext context, SearchController controller) { return const Icon(Icons.search); }, suggestionsBuilder: (BuildContext context, SearchController controller) { return <Widget>[]; }, isFullScreen: false, viewElevation: elevation, viewBackgroundColor: backgroundColor, viewSurfaceTintColor: surfaceTintColor, viewSide: side, viewShape: shape, headerHeight: headerHeight, headerTextStyle: headerTextStyle, headerHintStyle: headerHintStyle, viewConstraints: constraints, ); }, ); return MaterialApp( theme: ThemeData.from( colorScheme: const ColorScheme.light(), useMaterial3: true) .copyWith( searchViewTheme: overallTheme, ), home: Scaffold( body: Center( // If the SearchViewThemeData widget is present, it's used // instead of the Theme's ThemeData.searchViewTheme. child: searchViewThemeData == null ? child : SearchViewTheme( data: searchViewThemeData, child: child, ), ), ), ); } Finder findViewContent() { return find.byWidgetPredicate((Widget widget) { return widget.runtimeType.toString() == '_ViewContent'; }); } Material getSearchViewMaterial(WidgetTester tester) { return tester.widget<Material>(find.descendant(of: findViewContent(), matching: find.byType(Material)).first); } Future<void> checkSearchView(WidgetTester tester) async { final Material material = getSearchViewMaterial(tester); expect(material.elevation, elevation); expect(material.color, backgroundColor); expect(material.surfaceTintColor, surfaceTintColor); expect(material.shape, shape); final SizedBox sizedBox = tester.widget<SizedBox>(find.descendant(of: findViewContent(), matching: find.byType(SizedBox)).first); expect(sizedBox.width, 250.0); expect(sizedBox.height, 450.0); final Text hintText = tester.widget(find.text('hint text')); expect(hintText.style?.color, headerHintStyle.color); expect(hintText.style?.fontSize, headerHintStyle.fontSize); final RenderBox box = tester.renderObject(find.descendant(of: findViewContent(), matching: find.byType(SearchBar))); expect(box.size.height, headerHeight); await tester.enterText(find.byType(TextField), 'input'); final EditableText inputText = tester.widget(find.text('input')); expect(inputText.style.color, headerTextStyle.color); expect(inputText.style.fontSize, headerTextStyle.fontSize); } testWidgets('SearchView properties overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(useSearchViewProperties: true)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchView(tester); }); testWidgets('SearchView theme data overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(searchViewThemeData: searchViewTheme)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); checkSearchView(tester); }); testWidgets('Overall Theme SearchView theme overrides defaults', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallTheme: searchViewTheme)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); checkSearchView(tester); }); // Same as the previous tests with empty SearchViewThemeData's instead of null. testWidgets('SearchView properties overrides defaults, empty theme and overall theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(useSearchViewProperties: true, searchViewThemeData: const SearchViewThemeData(), overallTheme: const SearchViewThemeData())); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchView(tester); }); testWidgets('SearchView theme overrides defaults and overall theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(searchViewThemeData: searchViewTheme, overallTheme: const SearchViewThemeData())); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchView(tester); }); testWidgets('Overall Theme SearchView theme overrides defaults and null theme', (WidgetTester tester) async { await tester.pumpWidget(buildFrame(overallTheme: searchViewTheme)); await tester.tap(find.byIcon(Icons.search)); await tester.pumpAndSettle(); // allow the animations to finish checkSearchView(tester); }); }); }
flutter/packages/flutter/test/material/search_view_theme_test.dart/0
{ "file_path": "flutter/packages/flutter/test/material/search_view_theme_test.dart", "repo_id": "flutter", "token_count": 4024 }
739
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // This is a regression test for https://github.com/flutter/flutter/issues/10549 // which was failing because _SliverPersistentHeaderElement.visitChildren() // didn't check child != null before visiting its child. class MySliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate { @override double get minExtent => 50.0; @override double get maxExtent => 150.0; @override Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) => const Placeholder(color: Colors.teal); @override bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) => false; } class MyHomePage extends StatefulWidget { const MyHomePage({ super.key }); @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin { static const int tabCount = 3; late TabController tabController; @override void initState() { super.initState(); tabController = TabController(length: tabCount, vsync: this); } @override void dispose() { tabController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( bottom: TabBar( controller: tabController, tabs: List<Widget>.generate(tabCount, (int index) => Tab(text: 'Tab $index')).toList(), ), ), body: TabBarView( controller: tabController, children: List<Widget>.generate(tabCount, (int index) { return CustomScrollView( // The bug only occurs when this key is included key: ValueKey<String>('Page $index'), slivers: <Widget>[ SliverPersistentHeader( delegate: MySliverPersistentHeaderDelegate(), ), ], ); }).toList(), ), ); } } void main() { testWidgets('Tabbed CustomScrollViews, warp from tab 1 to 3', (WidgetTester tester) async { await tester.pumpWidget(const MaterialApp(home: MyHomePage())); // should not crash. await tester.tap(find.text('Tab 2')); await tester.pumpAndSettle(); }); }
flutter/packages/flutter/test/material/tabbed_scrollview_warp_test.dart/0
{ "file_path": "flutter/packages/flutter/test/material/tabbed_scrollview_warp_test.dart", "repo_id": "flutter", "token_count": 887 }
740
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { test('TextTheme copyWith apply, merge basics with const TextTheme()', () { expect(const TextTheme(), equals(const TextTheme().copyWith())); expect(const TextTheme(), equals(const TextTheme().apply())); expect(const TextTheme(), equals(const TextTheme().merge(null))); expect(const TextTheme().hashCode, equals(const TextTheme().copyWith().hashCode)); expect(const TextTheme(), equals(const TextTheme().copyWith())); }); test('TextTheme lerp special cases', () { expect(TextTheme.lerp(null, null, 0), const TextTheme()); const TextTheme theme = TextTheme(); expect(identical(TextTheme.lerp(theme, theme, 0.5), theme), true); }); test('TextTheme copyWith apply, merge basics with Typography.black', () { final Typography typography = Typography.material2018(); expect(typography.black, equals(typography.black.copyWith())); expect(typography.black, equals(typography.black.apply())); expect(typography.black, equals(typography.black.merge(null))); expect(typography.black, equals(const TextTheme().merge(typography.black))); expect(typography.black, equals(typography.black.merge(typography.black))); expect(typography.white, equals(typography.black.merge(typography.white))); expect(typography.black.hashCode, equals(typography.black.copyWith().hashCode)); expect(typography.black, isNot(equals(typography.white))); }); test('TextTheme copyWith', () { final Typography typography = Typography.material2018(); final TextTheme whiteCopy = typography.black.copyWith( displayLarge: typography.white.displayLarge, displayMedium: typography.white.displayMedium, displaySmall: typography.white.displaySmall, headlineLarge: typography.white.headlineLarge, headlineMedium: typography.white.headlineMedium, headlineSmall: typography.white.headlineSmall, titleLarge: typography.white.titleLarge, titleMedium: typography.white.titleMedium, titleSmall: typography.white.titleSmall, bodyLarge: typography.white.bodyLarge, bodyMedium: typography.white.bodyMedium, bodySmall: typography.white.bodySmall, labelLarge: typography.white.labelLarge, labelMedium: typography.white.labelMedium, labelSmall: typography.white.labelSmall, ); expect(typography.white, equals(whiteCopy)); }); test('TextTheme merges properly in the presence of null fields.', () { const TextTheme partialTheme = TextTheme(titleLarge: TextStyle(color: Color(0xcafefeed))); final TextTheme fullTheme = ThemeData.fallback().textTheme.merge(partialTheme); expect(fullTheme.titleLarge!.color, equals(partialTheme.titleLarge!.color)); const TextTheme onlyHeadlineSmallAndTitleLarge = TextTheme( headlineSmall: TextStyle(color: Color(0xcafefeed)), titleLarge: TextStyle(color: Color(0xbeefcafe)), ); const TextTheme onlyBodyMediumAndTitleLarge = TextTheme( bodyMedium: TextStyle(color: Color(0xfeedfeed)), titleLarge: TextStyle(color: Color(0xdeadcafe)), ); TextTheme merged = onlyHeadlineSmallAndTitleLarge.merge(onlyBodyMediumAndTitleLarge); expect(merged.bodyLarge, isNull); expect(merged.bodyMedium!.color, equals(onlyBodyMediumAndTitleLarge.bodyMedium!.color)); expect(merged.headlineSmall!.color, equals(onlyHeadlineSmallAndTitleLarge.headlineSmall!.color)); expect(merged.titleLarge!.color, equals(onlyBodyMediumAndTitleLarge.titleLarge!.color)); merged = onlyHeadlineSmallAndTitleLarge.merge(null); expect(merged, equals(onlyHeadlineSmallAndTitleLarge)); }); test('TextTheme apply', () { // The `displayColor` is applied to [displayLarge], [displayMedium], // [displaySmall], [headlineLarge], [headlineMedium], and [bodySmall]. The // `bodyColor` is applied to the remaining text styles. const Color displayColor = Color(0x00000001); const Color bodyColor = Color(0x00000002); const String fontFamily = 'fontFamily'; const List<String> fontFamilyFallback = <String>['font', 'family', 'fallback']; const Color decorationColor = Color(0x00000003); const TextDecorationStyle decorationStyle = TextDecorationStyle.dashed; final TextDecoration decoration = TextDecoration.combine(<TextDecoration>[ TextDecoration.underline, TextDecoration.lineThrough, ]); final Typography typography = Typography.material2018(); final TextTheme theme = typography.black.apply( fontFamily: fontFamily, fontFamilyFallback: fontFamilyFallback, displayColor: displayColor, bodyColor: bodyColor, decoration: decoration, decorationColor: decorationColor, decorationStyle: decorationStyle, ); expect(theme.displayLarge!.color, displayColor); expect(theme.displayMedium!.color, displayColor); expect(theme.displaySmall!.color, displayColor); expect(theme.headlineLarge!.color, displayColor); expect(theme.headlineMedium!.color, displayColor); expect(theme.headlineSmall!.color, bodyColor); expect(theme.titleLarge!.color, bodyColor); expect(theme.titleMedium!.color, bodyColor); expect(theme.titleSmall!.color, bodyColor); expect(theme.bodyLarge!.color, bodyColor); expect(theme.bodyMedium!.color, bodyColor); expect(theme.bodySmall!.color, displayColor); expect(theme.labelLarge!.color, bodyColor); expect(theme.labelMedium!.color, bodyColor); expect(theme.labelSmall!.color, bodyColor); final List<TextStyle> themeStyles = <TextStyle>[ theme.displayLarge!, theme.displayMedium!, theme.displaySmall!, theme.headlineLarge!, theme.headlineMedium!, theme.headlineSmall!, theme.titleLarge!, theme.titleMedium!, theme.titleSmall!, theme.bodyLarge!, theme.bodyMedium!, theme.bodySmall!, theme.labelLarge!, theme.labelMedium!, theme.labelSmall!, ]; expect(themeStyles.every((TextStyle style) => style.fontFamily == fontFamily), true); expect(themeStyles.every((TextStyle style) => style.fontFamilyFallback == fontFamilyFallback), true); expect(themeStyles.every((TextStyle style) => style.decorationColor == decorationColor), true); expect(themeStyles.every((TextStyle style) => style.decorationStyle == decorationStyle), true); expect(themeStyles.every((TextStyle style) => style.decoration == decoration), true); }); test('TextTheme apply fontSizeFactor fontSizeDelta', () { final Typography typography = Typography.material2018(); final TextTheme baseTheme = Typography.englishLike2018.merge(typography.black); final TextTheme sizeTheme = baseTheme.apply( fontSizeFactor: 2.0, fontSizeDelta: 5.0, ); expect(sizeTheme.displayLarge!.fontSize, baseTheme.displayLarge!.fontSize! * 2.0 + 5.0); expect(sizeTheme.displayMedium!.fontSize, baseTheme.displayMedium!.fontSize! * 2.0 + 5.0); expect(sizeTheme.displaySmall!.fontSize, baseTheme.displaySmall!.fontSize! * 2.0 + 5.0); expect(sizeTheme.headlineLarge!.fontSize, baseTheme.headlineLarge!.fontSize! * 2.0 + 5.0); expect(sizeTheme.headlineMedium!.fontSize, baseTheme.headlineMedium!.fontSize! * 2.0 + 5.0); expect(sizeTheme.headlineSmall!.fontSize, baseTheme.headlineSmall!.fontSize! * 2.0 + 5.0); expect(sizeTheme.titleLarge!.fontSize, baseTheme.titleLarge!.fontSize! * 2.0 + 5.0); expect(sizeTheme.titleMedium!.fontSize, baseTheme.titleMedium!.fontSize! * 2.0 + 5.0); expect(sizeTheme.titleSmall!.fontSize, baseTheme.titleSmall!.fontSize! * 2.0 + 5.0); expect(sizeTheme.bodyLarge!.fontSize, baseTheme.bodyLarge!.fontSize! * 2.0 + 5.0); expect(sizeTheme.bodyMedium!.fontSize, baseTheme.bodyMedium!.fontSize! * 2.0 + 5.0); expect(sizeTheme.bodySmall!.fontSize, baseTheme.bodySmall!.fontSize! * 2.0 + 5.0); expect(sizeTheme.labelLarge!.fontSize, baseTheme.labelLarge!.fontSize! * 2.0 + 5.0); expect(sizeTheme.labelMedium!.fontSize, baseTheme.labelMedium!.fontSize! * 2.0 + 5.0); expect(sizeTheme.labelSmall!.fontSize, baseTheme.labelSmall!.fontSize! * 2.0 + 5.0); }); test('TextTheme lerp with second parameter null', () { final TextTheme theme = Typography.material2018().black; final TextTheme lerped = TextTheme.lerp(theme, null, 0.25); expect(lerped.displayLarge, TextStyle.lerp(theme.displayLarge, null, 0.25)); expect(lerped.displayMedium, TextStyle.lerp(theme.displayMedium, null, 0.25)); expect(lerped.displaySmall, TextStyle.lerp(theme.displaySmall, null, 0.25)); expect(lerped.headlineLarge, TextStyle.lerp(theme.headlineLarge, null, 0.25)); expect(lerped.headlineMedium, TextStyle.lerp(theme.headlineMedium, null, 0.25)); expect(lerped.headlineSmall, TextStyle.lerp(theme.headlineSmall, null, 0.25)); expect(lerped.titleLarge, TextStyle.lerp(theme.titleLarge, null, 0.25)); expect(lerped.titleMedium, TextStyle.lerp(theme.titleMedium, null, 0.25)); expect(lerped.titleSmall, TextStyle.lerp(theme.titleSmall, null, 0.25)); expect(lerped.bodyLarge, TextStyle.lerp(theme.bodyLarge, null, 0.25)); expect(lerped.bodyMedium, TextStyle.lerp(theme.bodyMedium, null, 0.25)); expect(lerped.bodySmall, TextStyle.lerp(theme.bodySmall, null, 0.25)); expect(lerped.labelLarge, TextStyle.lerp(theme.labelLarge, null, 0.25)); expect(lerped.labelMedium, TextStyle.lerp(theme.labelMedium, null, 0.25)); expect(lerped.labelSmall, TextStyle.lerp(theme.labelSmall, null, 0.25)); }); test('TextTheme lerp with first parameter null', () { final TextTheme theme = Typography.material2018().black; final TextTheme lerped = TextTheme.lerp(null, theme, 0.25); expect(lerped.displayLarge, TextStyle.lerp(null, theme.displayLarge, 0.25)); expect(lerped.displayMedium, TextStyle.lerp(null, theme.displayMedium, 0.25)); expect(lerped.displaySmall, TextStyle.lerp(null, theme.displaySmall, 0.25)); expect(lerped.headlineLarge, TextStyle.lerp(null, theme.headlineLarge, 0.25)); expect(lerped.headlineMedium, TextStyle.lerp(null, theme.headlineMedium, 0.25)); expect(lerped.headlineSmall, TextStyle.lerp(null, theme.headlineSmall, 0.25)); expect(lerped.titleLarge, TextStyle.lerp(null, theme.titleLarge, 0.25)); expect(lerped.titleMedium, TextStyle.lerp(null, theme.titleMedium, 0.25)); expect(lerped.titleSmall, TextStyle.lerp(null, theme.titleSmall, 0.25)); expect(lerped.bodyLarge, TextStyle.lerp(null, theme.bodyLarge, 0.25)); expect(lerped.bodyMedium, TextStyle.lerp(null, theme.bodyMedium, 0.25)); expect(lerped.bodySmall, TextStyle.lerp(null, theme.bodySmall, 0.25)); expect(lerped.labelLarge, TextStyle.lerp(null, theme.labelLarge, 0.25)); expect(lerped.labelMedium, TextStyle.lerp(null, theme.labelMedium, 0.25)); expect(lerped.labelSmall, TextStyle.lerp(null, theme.labelSmall, 0.25)); }); test('TextTheme lerp with null parameters', () { final TextTheme lerped = TextTheme.lerp(null, null, 0.25); expect(lerped.displayLarge, null); expect(lerped.displayMedium, null); expect(lerped.displaySmall, null); expect(lerped.headlineLarge, null); expect(lerped.headlineMedium, null); expect(lerped.headlineSmall, null); expect(lerped.titleLarge, null); expect(lerped.titleMedium, null); expect(lerped.titleSmall, null); expect(lerped.bodyLarge, null); expect(lerped.bodyMedium, null); expect(lerped.bodySmall, null); expect(lerped.labelLarge, null); expect(lerped.labelMedium, null); expect(lerped.labelSmall, null); }); test('VisualDensity.lerp', () { const VisualDensity a = VisualDensity(horizontal: 1.0, vertical: .5); const VisualDensity b = VisualDensity(horizontal: 2.0, vertical: 1.0); final VisualDensity noLerp = VisualDensity.lerp(a, b, 0.0); expect(noLerp.horizontal, 1.0); expect(noLerp.vertical, .5); final VisualDensity quarterLerp = VisualDensity.lerp(a, b, .25); expect(quarterLerp.horizontal, 1.25); expect(quarterLerp.vertical, .625); final VisualDensity fullLerp = VisualDensity.lerp(a, b, 1.0); expect(fullLerp.horizontal, 2.0); expect(fullLerp.vertical, 1.0); }); }
flutter/packages/flutter/test/material/text_theme_test.dart/0
{ "file_path": "flutter/packages/flutter/test/material/text_theme_test.dart", "repo_id": "flutter", "token_count": 4315 }
741
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/src/painting/_network_image_web.dart'; import 'package:flutter/src/web.dart' as web_shim; import 'package:flutter_test/flutter_test.dart'; import 'package:web/web.dart' as web; import '../image_data.dart'; import '_test_http_request.dart'; void runTests() { tearDown(() { debugRestoreHttpRequestFactory(); }); testWidgets('loads an image from the network with headers', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 200 ..mockEvent = MockEvent('load', web.Event('test error')) ..response = (Uint8List.fromList(kTransparentImage)).buffer; httpRequestFactory = () { return testHttpRequest.getMock() as web_shim.XMLHttpRequest; }; const Map<String, String> headers = <String, String>{ 'flutter': 'flutter', 'second': 'second', }; final Image image = Image.network( 'https://www.example.com/images/frame.png', headers: headers, ); await tester.pumpWidget(image); assert(mapEquals(testHttpRequest.responseHeaders, headers), true); }); testWidgets('loads an image from the network with unsuccessful HTTP code', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 404 ..mockEvent = MockEvent('error', web.Event('test error')); httpRequestFactory = () { return testHttpRequest.getMock() as web_shim.XMLHttpRequest; }; const Map<String, String> headers = <String, String>{ 'flutter': 'flutter', 'second': 'second', }; final Image image = Image.network( 'https://www.example.com/images/frame2.png', headers: headers, ); await tester.pumpWidget(image); expect((tester.takeException() as web.ProgressEvent).type, 'test error'); }); testWidgets('loads an image from the network with empty response', (WidgetTester tester) async { final TestHttpRequest testHttpRequest = TestHttpRequest() ..status = 200 ..mockEvent = MockEvent('load', web.Event('test error')) ..response = (Uint8List.fromList(<int>[])).buffer; httpRequestFactory = () { return testHttpRequest.getMock() as web_shim.XMLHttpRequest; }; const Map<String, String> headers = <String, String>{ 'flutter': 'flutter', 'second': 'second', }; final Image image = Image.network( 'https://www.example.com/images/frame3.png', headers: headers, ); await tester.pumpWidget(image); expect(tester.takeException().toString(), 'HTTP request failed, statusCode: 200, https://www.example.com/images/frame3.png'); }); }
flutter/packages/flutter/test/painting/_network_image_test_web.dart/0
{ "file_path": "flutter/packages/flutter/test/painting/_network_image_test_web.dart", "repo_id": "flutter", "token_count": 1060 }
742
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is run as part of a reduced test set in CI on Mac and Windows // machines. @Tags(<String>['reduced-test-set']) library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { test('ContinuousRectangleBorder defaults', () { const ContinuousRectangleBorder border = ContinuousRectangleBorder(); expect(border.side, BorderSide.none); expect(border.borderRadius, BorderRadius.zero); }); test('ContinuousRectangleBorder copyWith, ==, hashCode', () { expect(const ContinuousRectangleBorder(), const ContinuousRectangleBorder().copyWith()); expect(const ContinuousRectangleBorder().hashCode, const ContinuousRectangleBorder().copyWith().hashCode); const BorderSide side = BorderSide(width: 10.0, color: Color(0xff123456)); const BorderRadius radius = BorderRadius.all(Radius.circular(16.0)); const BorderRadiusDirectional directionalRadius = BorderRadiusDirectional.all(Radius.circular(16.0)); expect( const ContinuousRectangleBorder().copyWith(side: side, borderRadius: radius), const ContinuousRectangleBorder(side: side, borderRadius: radius), ); expect( const ContinuousRectangleBorder().copyWith(side: side, borderRadius: directionalRadius), const ContinuousRectangleBorder(side: side, borderRadius: directionalRadius), ); }); test('ContinuousRectangleBorder scale and lerp', () { const ContinuousRectangleBorder c10 = ContinuousRectangleBorder(side: BorderSide(width: 10.0), borderRadius: BorderRadius.all(Radius.circular(100.0))); const ContinuousRectangleBorder c15 = ContinuousRectangleBorder(side: BorderSide(width: 15.0), borderRadius: BorderRadius.all(Radius.circular(150.0))); const ContinuousRectangleBorder c20 = ContinuousRectangleBorder(side: BorderSide(width: 20.0), borderRadius: BorderRadius.all(Radius.circular(200.0))); expect(c10.dimensions, const EdgeInsets.all(10.0)); expect(c10.scale(2.0), c20); expect(c20.scale(0.5), c10); expect(ShapeBorder.lerp(c10, c20, 0.0), c10); expect(ShapeBorder.lerp(c10, c20, 0.5), c15); expect(ShapeBorder.lerp(c10, c20, 1.0), c20); }); test('ContinuousRectangleBorder BorderRadius.zero', () { const Rect rect1 = Rect.fromLTRB(10.0, 20.0, 30.0, 40.0); final Matcher looksLikeRect1 = isPathThat( includes: const <Offset>[ Offset(10.0, 20.0), Offset(20.0, 30.0) ], excludes: const <Offset>[ Offset(9.0, 19.0), Offset(31.0, 41.0) ], ); // Default border radius and border side are zero, i.e. just a rectangle. expect(const ContinuousRectangleBorder().getOuterPath(rect1), looksLikeRect1); expect(const ContinuousRectangleBorder().getInnerPath(rect1), looksLikeRect1); // Represents the inner path when borderSide.width = 4, which is just rect1 // inset by 4 on all sides. final Matcher looksLikeInnerPath = isPathThat( includes: const <Offset>[ Offset(14.0, 24.0), Offset(16.0, 26.0) ], excludes: const <Offset>[ Offset(9.0, 23.0), Offset(27.0, 37.0) ], ); const BorderSide side = BorderSide(width: 4.0); expect(const ContinuousRectangleBorder(side: side).getOuterPath(rect1), looksLikeRect1); expect(const ContinuousRectangleBorder(side: side).getInnerPath(rect1), looksLikeInnerPath); }); test('ContinuousRectangleBorder non-zero BorderRadius', () { const Rect rect = Rect.fromLTRB(10.0, 20.0, 30.0, 40.0); final Matcher looksLikeRect = isPathThat( includes: const <Offset>[ Offset(15.0, 25.0), Offset(20.0, 30.0) ], excludes: const <Offset>[ Offset(10.0, 20.0), Offset(30.0, 40.0) ], ); const ContinuousRectangleBorder border = ContinuousRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), ); expect(border.getOuterPath(rect), looksLikeRect); expect(border.getInnerPath(rect), looksLikeRect); }); test('ContinuousRectangleBorder non-zero BorderRadiusDirectional', () { const Rect rect = Rect.fromLTRB(10.0, 20.0, 30.0, 40.0); final Matcher looksLikeRectLtr = isPathThat( includes: const <Offset>[Offset(15.0, 25.0), Offset(20.0, 30.0)], excludes: const <Offset>[Offset(10.0, 20.0), Offset(10.0, 40.0)], ); const ContinuousRectangleBorder border = ContinuousRectangleBorder( borderRadius: BorderRadiusDirectional.only( topStart: Radius.circular(5.0), bottomStart: Radius.circular(5.0), ), ); expect(border.getOuterPath(rect,textDirection: TextDirection.ltr), looksLikeRectLtr); expect(border.getInnerPath(rect,textDirection: TextDirection.ltr), looksLikeRectLtr); final Matcher looksLikeRectRtl = isPathThat( includes: const <Offset>[Offset(25.0, 35.0), Offset(25.0, 25.0)], excludes: const <Offset>[Offset(30.0, 20.0), Offset(30.0, 40.0)], ); expect(border.getOuterPath(rect,textDirection: TextDirection.rtl), looksLikeRectRtl); expect(border.getInnerPath(rect,textDirection: TextDirection.rtl), looksLikeRectRtl); }); testWidgets('Golden test even radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.blueAccent[400], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(28.0)), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_even_radii.png'), ); }); testWidgets('Golden test varying radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[100], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.elliptical(100.0, 200.0), topRight: Radius.circular(350.0), bottomLeft: Radius.elliptical(2000.0, 100.0), bottomRight: Radius.circular(700.0), ), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_varying_radii.png'), ); }); testWidgets('Golden test topLeft radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[200], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.elliptical(100.0, 200.0), ), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_topLeft_radii.png'), ); }); testWidgets('Golden test topRight radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[300], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.only( topRight: Radius.circular(350.0), ), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_topRight_radii.png'), ); }); testWidgets('Golden test bottomLeft radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[400], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.only( bottomLeft: Radius.elliptical(2000.0, 100.0), ), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_bottomLeft_radii.png'), ); }); testWidgets('Golden test bottomRight radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.green[500], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.only( bottomRight: Radius.circular(700.0), ), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_bottomRight_radii.png'), ); }); testWidgets('Golden test large radii', (WidgetTester tester) async { await tester.pumpWidget(RepaintBoundary( child: Material( color: Colors.redAccent[400], shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(50.0)), ), ), )); await tester.pumpAndSettle(); await expectLater( find.byType(RepaintBoundary), matchesGoldenFile('continuous_rectangle_border.golden_test_large_radii.png'), ); }); }
flutter/packages/flutter/test/painting/continuous_rectangle_border_test.dart/0
{ "file_path": "flutter/packages/flutter/test/painting/continuous_rectangle_border_test.dart", "repo_id": "flutter", "token_count": 3552 }
743
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/painting.dart'; import 'package:flutter_test/flutter_test.dart'; import '../image_data.dart'; import '../rendering/rendering_tester.dart'; import 'mocks_for_image_cache.dart'; void main() { TestRenderingFlutterBinding.ensureInitialized(); Future<ui.Codec> basicDecoder(ui.ImmutableBuffer bytes, {int? cacheWidth, int? cacheHeight, bool? allowUpscaling}) { return PaintingBinding.instance.instantiateImageCodecFromBuffer(bytes, cacheWidth: cacheWidth, cacheHeight: cacheHeight, allowUpscaling: allowUpscaling ?? false); } FlutterExceptionHandler? oldError; setUp(() { oldError = FlutterError.onError; }); tearDown(() { FlutterError.onError = oldError; PaintingBinding.instance.imageCache.clear(); PaintingBinding.instance.imageCache.clearLiveImages(); }); tearDown(() { imageCache.clear(); }); test('AssetImageProvider - evicts on failure to load', () async { final Completer<FlutterError> error = Completer<FlutterError>(); FlutterError.onError = (FlutterErrorDetails details) { error.complete(details.exception as FlutterError); }; const ImageProvider provider = ExactAssetImage('does-not-exist'); final Object key = await provider.obtainKey(ImageConfiguration.empty); expect(imageCache.statusForKey(provider).untracked, true); expect(imageCache.pendingImageCount, 0); provider.resolve(ImageConfiguration.empty); expect(imageCache.statusForKey(key).pending, true); expect(imageCache.pendingImageCount, 1); await error.future; expect(imageCache.statusForKey(provider).untracked, true); expect(imageCache.pendingImageCount, 0); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/56314 test('ImageProvider can evict images', () async { final Uint8List bytes = Uint8List.fromList(kTransparentImage); final MemoryImage imageProvider = MemoryImage(bytes); final ImageStream stream = imageProvider.resolve(ImageConfiguration.empty); final Completer<void> completer = Completer<void>(); stream.addListener(ImageStreamListener((ImageInfo info, bool syncCall) => completer.complete())); await completer.future; expect(imageCache.currentSize, 1); expect(await MemoryImage(bytes).evict(), true); expect(imageCache.currentSize, 0); }); test('ImageProvider.evict respects the provided ImageCache', () async { final ImageCache otherCache = ImageCache(); final Uint8List bytes = Uint8List.fromList(kTransparentImage); final MemoryImage imageProvider = MemoryImage(bytes); final ImageStreamCompleter cacheStream = otherCache.putIfAbsent( imageProvider, () => imageProvider.loadBuffer(imageProvider, basicDecoder), )!; final ImageStream stream = imageProvider.resolve(ImageConfiguration.empty); final Completer<void> completer = Completer<void>(); final Completer<void> cacheCompleter = Completer<void>(); stream.addListener(ImageStreamListener((ImageInfo info, bool syncCall) { completer.complete(); })); cacheStream.addListener(ImageStreamListener((ImageInfo info, bool syncCall) { cacheCompleter.complete(); })); await Future.wait(<Future<void>>[completer.future, cacheCompleter.future]); expect(otherCache.currentSize, 1); expect(imageCache.currentSize, 1); expect(await imageProvider.evict(cache: otherCache), true); expect(otherCache.currentSize, 0); expect(imageCache.currentSize, 1); }); test('ImageProvider errors can always be caught', () async { final ErrorImageProvider imageProvider = ErrorImageProvider(); final Completer<bool> caughtError = Completer<bool>(); FlutterError.onError = (FlutterErrorDetails details) { caughtError.complete(false); }; final ImageStream stream = imageProvider.resolve(ImageConfiguration.empty); stream.addListener(ImageStreamListener((ImageInfo info, bool syncCall) { caughtError.complete(false); }, onError: (dynamic error, StackTrace? stackTrace) { caughtError.complete(true); })); expect(await caughtError.future, true); }); }
flutter/packages/flutter/test/painting/image_provider_and_image_cache_test.dart/0
{ "file_path": "flutter/packages/flutter/test/painting/image_provider_and_image_cache_test.dart", "repo_id": "flutter", "token_count": 1414 }
744
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; Future<void> main() async { test('ShaderWarmUp', () { final FakeShaderWarmUp shaderWarmUp = FakeShaderWarmUp(); PaintingBinding.shaderWarmUp = shaderWarmUp; debugCaptureShaderWarmUpImage = expectAsync1((ui.Image image) => true); WidgetsFlutterBinding.ensureInitialized(); expect(shaderWarmUp.ranWarmUp, true); }, skip: kIsWeb && !isCanvasKit); // [intended] Testing only for canvasKit } class FakeShaderWarmUp extends ShaderWarmUp { bool ranWarmUp = false; @override Future<bool> warmUpOnCanvas(ui.Canvas canvas) { ranWarmUp = true; return Future<bool>.delayed(Duration.zero, () => true); } }
flutter/packages/flutter/test/painting/shader_warm_up_test.dart/0
{ "file_path": "flutter/packages/flutter/test/painting/shader_warm_up_test.dart", "repo_id": "flutter", "token_count": 336 }
745
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/foundation.dart'; import 'package:flutter/physics.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { test('test_friction', () { final FrictionSimulation friction = FrictionSimulation(0.3, 100.0, 400.0); friction.tolerance = const Tolerance(velocity: 1.0); expect(friction.isDone(0.0), false); expect(friction.x(0.0), 100); expect(friction.dx(0.0), 400.0); expect(friction.x(1.0) > 330 && friction.x(1.0) < 335, true); expect(friction.dx(1.0), 120.0); expect(friction.dx(2.0), 36.0); expect(friction.dx(3.0), moreOrLessEquals(10.8)); expect(friction.dx(4.0) < 3.5, true); expect(friction.isDone(5.0), true); expect(friction.x(5.0) > 431 && friction.x(5.0) < 432, true); }); test('test_friction_through', () { // Use a normal FrictionSimulation to generate start and end // velocity and positions with drag = 0.025. double startPosition = 10.0; double startVelocity = 600.0; FrictionSimulation f = FrictionSimulation(0.025, startPosition, startVelocity); double endPosition = f.x(1.0); double endVelocity = f.dx(1.0); expect(endPosition, greaterThan(startPosition)); expect(endVelocity, lessThan(startVelocity)); // Verify that the "through" FrictionSimulation ends up at // endPosition and endVelocity; implies that it computed the right // value for _drag. FrictionSimulation friction = FrictionSimulation.through(startPosition, endPosition, startVelocity, endVelocity); expect(friction.isDone(0.0), false); expect(friction.x(0.0), 10.0); expect(friction.dx(0.0), 600.0); expect(friction.isDone(1.0 + precisionErrorTolerance), true); expect(friction.x(1.0), moreOrLessEquals(endPosition)); expect(friction.dx(1.0), moreOrLessEquals(endVelocity)); // Same scenario as above except that the velocities are // negative. startPosition = 1000.0; startVelocity = -500.0; f = FrictionSimulation(0.025, 1000.0, -500.0); endPosition = f.x(1.0); endVelocity = f.dx(1.0); expect(endPosition, lessThan(startPosition)); expect(endVelocity, greaterThan(startVelocity)); friction = FrictionSimulation.through(startPosition, endPosition, startVelocity, endVelocity); expect(friction.isDone(1.0 + precisionErrorTolerance), true); expect(friction.x(1.0), moreOrLessEquals(endPosition)); expect(friction.dx(1.0), moreOrLessEquals(endVelocity)); }); test('BoundedFrictionSimulation control test', () { final BoundedFrictionSimulation friction = BoundedFrictionSimulation(0.3, 100.0, 400.0, 50.0, 150.0); friction.tolerance = const Tolerance(velocity: 1.0); expect(friction.isDone(0.0), false); expect(friction.x(0.0), 100); expect(friction.dx(0.0), 400.0); expect(friction.x(1.0), equals(150.0)); expect(friction.isDone(1.0), true); }); test('test_gravity', () { final GravitySimulation gravity = GravitySimulation(200.0, 100.0, 600.0, 0.0); expect(gravity.isDone(0.0), false); expect(gravity.x(0.0), 100.0); expect(gravity.dx(0.0), 0.0); // Starts at 100 expect(gravity.x(0.25), 106.25); expect(gravity.x(0.50), 125); expect(gravity.x(0.75), 156.25); expect(gravity.x(1.00), 200); expect(gravity.x(1.25), 256.25); expect(gravity.x(1.50), 325); expect(gravity.x(1.75), 406.25); // Starts at 0.0 expect(gravity.dx(0.25), 50.0); expect(gravity.dx(0.50), 100); expect(gravity.dx(0.75), 150.00); expect(gravity.dx(1.00), 200.0); expect(gravity.dx(1.25), 250.0); expect(gravity.dx(1.50), 300); expect(gravity.dx(1.75), 350); expect(gravity.isDone(2.5), true); expect(gravity.x(2.5), 725); expect(gravity.dx(2.5), 500.0); }); test('spring_types', () { SpringSimulation crit = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ), 0.0, 300.0, 0.0); expect(crit.type, SpringType.criticallyDamped); crit = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ), 0.0, 300.0, 0.0); expect(crit.type, SpringType.criticallyDamped); final SpringSimulation under = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ratio: 0.75, ), 0.0, 300.0, 0.0); expect(under.type, SpringType.underDamped); final SpringSimulation over = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ratio: 1.25, ), 0.0, 300.0, 0.0); expect(over.type, SpringType.overDamped); // Just so we don't forget how to create a desc without the ratio. final SpringSimulation other = SpringSimulation(const SpringDescription( mass: 1.0, stiffness: 100.0, damping: 20.0, ), 0.0, 20.0, 20.0); expect(other.type, SpringType.criticallyDamped); }); test('crit_spring', () { final SpringSimulation crit = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ), 0.0, 500.0, 0.0); crit.tolerance = const Tolerance(distance: 0.01, velocity: 0.01); expect(crit.type, SpringType.criticallyDamped); expect(crit.isDone(0.0), false); expect(crit.x(0.0), 0.0); expect(crit.dx(0.0), 0.0); expect(crit.x(0.25).floor(), 356); expect(crit.x(0.50).floor(), 479); expect(crit.x(0.75).floor(), 497); expect(crit.dx(0.25).floor(), 1026); expect(crit.dx(0.50).floor(), 168); expect(crit.dx(0.75).floor(), 20); expect(crit.x(1.5) > 499.0 && crit.x(1.5) < 501.0, true); expect(crit.dx(1.5) < 0.1, true /* basically within tolerance */); expect(crit.isDone(1.60), true); }); test('overdamped_spring', () { final SpringSimulation over = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ratio: 1.25, ), 0.0, 500.0, 0.0); over.tolerance = const Tolerance(distance: 0.01, velocity: 0.01); expect(over.type, SpringType.overDamped); expect(over.isDone(0.0), false); expect(over.x(0.0), 0.0); expect(over.dx(0.0), moreOrLessEquals(0.0)); expect(over.x(0.5).floor(), 445.0); expect(over.x(1.0).floor(), 495.0); expect(over.x(1.5).floor(), 499.0); expect(over.dx(0.5).floor(), 273.0); expect(over.dx(1.0).floor(), 22.0); expect(over.dx(1.5).floor(), 1.0); expect(over.isDone(3.0), true); }); test('underdamped_spring', () { final SpringSimulation under = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, ratio: 0.25, ), 0.0, 300.0, 0.0); expect(under.type, SpringType.underDamped); expect(under.isDone(0.0), false); expect(under.x(0.0), moreOrLessEquals(0.0)); expect(under.dx(0.0), moreOrLessEquals(0.0)); // Overshot with negative velocity expect(under.x(1.0).floor(), 325); expect(under.dx(1.0).floor(), -65); expect(under.dx(6.0).floor(), 0.0); expect(under.x(6.0).floor(), 299); expect(under.isDone(6.0), true); }); test('test_kinetic_scroll', () { final SpringDescription spring = SpringDescription.withDampingRatio( mass: 1.0, stiffness: 50.0, ratio: 0.5, ); final BouncingScrollSimulation scroll = BouncingScrollSimulation( position: 100.0, velocity: 800.0, leadingExtent: 0.0, trailingExtent: 300.0, spring: spring, ); scroll.tolerance = const Tolerance(velocity: 0.5, distance: 0.1); expect(scroll.isDone(0.0), false); expect(scroll.isDone(0.5), false); // switch from friction to spring expect(scroll.isDone(3.5), true); final BouncingScrollSimulation scroll2 = BouncingScrollSimulation( position: 100.0, velocity: -800.0, leadingExtent: 0.0, trailingExtent: 300.0, spring: spring, ); scroll2.tolerance = const Tolerance(velocity: 0.5, distance: 0.1); expect(scroll2.isDone(0.0), false); expect(scroll2.isDone(0.5), false); // switch from friction to spring expect(scroll2.isDone(3.5), true); }); test('scroll_with_inf_edge_ends', () { final SpringDescription spring = SpringDescription.withDampingRatio( mass: 1.0, stiffness: 50.0, ratio: 0.5, ); final BouncingScrollSimulation scroll = BouncingScrollSimulation( position: 100.0, velocity: 400.0, leadingExtent: 0.0, trailingExtent: double.infinity, spring: spring, ); scroll.tolerance = const Tolerance(velocity: 1.0); expect(scroll.isDone(0.0), false); expect(scroll.x(0.0), 100); expect(scroll.dx(0.0), 400.0); expect(scroll.x(1.0), moreOrLessEquals(272.0, epsilon: 1.0)); expect(scroll.dx(1.0), moreOrLessEquals(54.0, epsilon: 1.0)); expect(scroll.dx(2.0), moreOrLessEquals(7.0, epsilon: 1.0)); expect(scroll.dx(3.0), lessThan(1.0)); expect(scroll.isDone(5.0), true); expect(scroll.x(5.0), moreOrLessEquals(300.0, epsilon: 1.0)); }); test('over/under scroll spring', () { final SpringDescription spring = SpringDescription.withDampingRatio(mass: 1.0, stiffness: 170.0, ratio: 1.1); final BouncingScrollSimulation scroll = BouncingScrollSimulation( position: 500.0, velocity: -7500.0, leadingExtent: 0.0, trailingExtent: 1000.0, spring: spring, ); scroll.tolerance = const Tolerance(velocity: 45.0, distance: 1.5); expect(scroll.isDone(0.0), false); expect(scroll.x(0.0), moreOrLessEquals(500.0)); expect(scroll.dx(0.0), moreOrLessEquals(-7500.0)); // Expect to reach 0.0 at about t=.07 at which point the simulation will // switch from friction to the spring expect(scroll.isDone(0.065), false); expect(scroll.x(0.065), moreOrLessEquals(42.0, epsilon: 1.0)); expect(scroll.dx(0.065), moreOrLessEquals(-6584.0, epsilon: 1.0)); // We've overscrolled (0.1 > 0.07). Trigger the underscroll // simulation, and reverse direction expect(scroll.isDone(0.1), false); expect(scroll.x(0.1), moreOrLessEquals(-123.0, epsilon: 1.0)); expect(scroll.dx(0.1), moreOrLessEquals(-2613.0, epsilon: 1.0)); // Headed back towards 0.0 and slowing down. expect(scroll.isDone(0.5), false); expect(scroll.x(0.5), moreOrLessEquals(-15.0, epsilon: 1.0)); expect(scroll.dx(0.5), moreOrLessEquals(124.0, epsilon: 1.0)); // Now jump back to the beginning, because we can. expect(scroll.isDone(0.0), false); expect(scroll.x(0.0), moreOrLessEquals(500.0)); expect(scroll.dx(0.0), moreOrLessEquals(-7500.0)); expect(scroll.isDone(2.0), true); expect(scroll.x(2.0), 0.0); expect(scroll.dx(2.0), moreOrLessEquals(0.0, epsilon: 1.0)); }); }
flutter/packages/flutter/test/physics/newton_test.dart/0
{ "file_path": "flutter/packages/flutter/test/physics/newton_test.dart", "repo_id": "flutter", "token_count": 4539 }
746
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; import 'rendering_tester.dart'; class RenderFixedSize extends RenderBox { double dimension = 100.0; void grow() { dimension *= 2.0; markNeedsLayout(); } @override double computeMinIntrinsicWidth(double height) => dimension; @override double computeMaxIntrinsicWidth(double height) => dimension; @override double computeMinIntrinsicHeight(double width) => dimension; @override double computeMaxIntrinsicHeight(double width) => dimension; @override void performLayout() { size = Size.square(dimension); } } class RenderParentSize extends RenderProxyBox { RenderParentSize({ required RenderBox child }) : super(child); @override bool get sizedByParent => true; @override void performResize() { size = constraints.biggest; } @override void performLayout() { child!.layout(constraints); } } class RenderIntrinsicSize extends RenderProxyBox { RenderIntrinsicSize({ required RenderBox child }) : super(child); @override void performLayout() { child!.layout(constraints); size = Size( child!.getMinIntrinsicWidth(double.infinity), child!.getMinIntrinsicHeight(double.infinity), ); } } class RenderInvalidIntrinsics extends RenderBox { @override bool get sizedByParent => true; @override double computeMinIntrinsicWidth(double height) => -1; @override double computeMaxIntrinsicWidth(double height) => -1; @override double computeMinIntrinsicHeight(double width) => -1; @override double computeMaxIntrinsicHeight(double width) => -1; @override Size computeDryLayout(BoxConstraints constraints) => Size.zero; } void main() { TestRenderingFlutterBinding.ensureInitialized(); test('Whether using intrinsics means you get hooked into layout', () { RenderBox root; RenderFixedSize inner; layout( root = RenderIntrinsicSize( child: RenderParentSize( child: inner = RenderFixedSize(), ), ), constraints: const BoxConstraints( maxWidth: 1000.0, maxHeight: 1000.0, ), ); expect(root.size, equals(inner.size)); inner.grow(); pumpFrame(); expect(root.size, equals(inner.size)); }); test('Parent returns correct intrinsics', () { RenderParentSize parent; RenderFixedSize inner; layout( RenderIntrinsicSize( child: parent = RenderParentSize( child: inner = RenderFixedSize(), ), ), constraints: const BoxConstraints( maxWidth: 1000.0, maxHeight: 1000.0, ), ); _expectIntrinsicDimensions(parent, 100); inner.grow(); pumpFrame(); _expectIntrinsicDimensions(parent, 200); }); test('Intrinsic checks are turned on', () async { final List<FlutterErrorDetails> errorDetails = <FlutterErrorDetails>[]; layout( RenderInvalidIntrinsics(), constraints: const BoxConstraints( maxWidth: 1000.0, maxHeight: 1000.0, ), onErrors: () { errorDetails.addAll(TestRenderingFlutterBinding.instance.takeAllFlutterErrorDetails()); }, ); expect(errorDetails, isNotEmpty); expect( errorDetails.map((FlutterErrorDetails details) => details.toString()), everyElement(contains('violate the intrinsic protocol')), ); }); } /// Asserts that all unbounded intrinsic dimensions for [object] match /// [dimension]. void _expectIntrinsicDimensions(RenderBox object, double dimension) { expect(object.getMinIntrinsicWidth(double.infinity), equals(dimension)); expect(object.getMaxIntrinsicWidth(double.infinity), equals(dimension)); expect(object.getMinIntrinsicHeight(double.infinity), equals(dimension)); expect(object.getMaxIntrinsicHeight(double.infinity), equals(dimension)); }
flutter/packages/flutter/test/rendering/dynamic_intrinsics_test.dart/0
{ "file_path": "flutter/packages/flutter/test/rendering/dynamic_intrinsics_test.dart", "repo_id": "flutter", "token_count": 1424 }
747
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:ui' as ui; import 'dart:ui' show PointerChange; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'mouse_tracker_test_utils.dart'; typedef MethodCallHandler = Future<dynamic> Function(MethodCall call); typedef SimpleAnnotationFinder = Iterable<HitTestTarget> Function(Offset offset); void main() { final TestMouseTrackerFlutterBinding binding = TestMouseTrackerFlutterBinding(); MethodCallHandler? methodCallHandler; // Only one of `logCursors` and `cursorHandler` should be specified. void setUpMouseTracker({ required SimpleAnnotationFinder annotationFinder, List<_CursorUpdateDetails>? logCursors, MethodCallHandler? cursorHandler, }) { assert(logCursors == null || cursorHandler == null); methodCallHandler = logCursors != null ? (MethodCall call) async { logCursors.add(_CursorUpdateDetails.wrap(call)); return; } : cursorHandler; binding.setHitTest((BoxHitTestResult result, Offset position) { for (final HitTestTarget target in annotationFinder(position)) { result.addWithRawTransform( transform: Matrix4.identity(), position: position, hitTest: (BoxHitTestResult result, Offset position) { result.add(HitTestEntry(target)); return true; }, ); } return true; }); } void dispatchRemoveDevice([int device = 0]) { RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, Offset.zero, device: device), ])); } setUp(() { binding.postFrameCallbacks.clear(); binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.mouseCursor, (MethodCall call) async { if (methodCallHandler != null) { return methodCallHandler!(call); } return null; }); }); tearDown(() { binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.mouseCursor, null); }); test('Should work on platforms that does not support mouse cursor', () async { const TestAnnotationTarget annotation = TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); setUpMouseTracker( annotationFinder: (Offset position) => <TestAnnotationTarget>[annotation], cursorHandler: (MethodCall call) async { return null; }, ); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); addTearDown(dispatchRemoveDevice); // Passes if no errors are thrown }); test('pointer is added and removed out of any annotations', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; TestAnnotationTarget? annotation; setUpMouseTracker( annotationFinder: (Offset position) => <TestAnnotationTarget>[if (annotation != null) annotation], logCursors: logCursors, ); // Pointer is added outside of the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); // Pointer moves into the annotation annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(5.0, 0.0)), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.grabbing.kind), ]); logCursors.clear(); // Pointer moves within the annotation annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(10.0, 0.0)), ])); expect(logCursors, <_CursorUpdateDetails>[]); logCursors.clear(); // Pointer moves out of the annotation annotation = null; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); // Pointer is removed outside of the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, Offset.zero), ])); expect(logCursors, const <_CursorUpdateDetails>[]); }); test('pointer is added and removed in an annotation', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; TestAnnotationTarget? annotation; setUpMouseTracker( annotationFinder: (Offset position) => <TestAnnotationTarget>[if (annotation != null) annotation], logCursors: logCursors, ); // Pointer is added in the annotation. annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.grabbing.kind), ]); logCursors.clear(); // Pointer moves out of the annotation annotation = null; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(5.0, 0.0)), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); // Pointer moves around out of the annotation annotation = null; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(10.0, 0.0)), ])); expect(logCursors, <_CursorUpdateDetails>[]); logCursors.clear(); // Pointer moves back into the annotation annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.grabbing.kind), ]); logCursors.clear(); // Pointer is removed within the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[]); }); test('pointer change caused by new frames', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; TestAnnotationTarget? annotation; setUpMouseTracker( annotationFinder: (Offset position) => <TestAnnotationTarget>[if (annotation != null) annotation], logCursors: logCursors, ); // Pointer is added outside of the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); // Synthesize a new frame while changing annotation annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); binding.scheduleMouseTrackerPostFrameCheck(); binding.flushPostFrameCallbacks(Duration.zero); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.grabbing.kind), ]); logCursors.clear(); // Synthesize a new frame without changing annotation annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing); binding.scheduleMouseTrackerPostFrameCheck(); expect(logCursors, <_CursorUpdateDetails>[]); logCursors.clear(); // Pointer is removed outside of the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[]); }); test('The first annotation with non-deferring cursor is used', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; late List<TestAnnotationTarget> annotations; setUpMouseTracker( annotationFinder: (Offset position) sync* { yield* annotations; }, logCursors: logCursors, ); annotations = <TestAnnotationTarget>[ const TestAnnotationTarget(), const TestAnnotationTarget(cursor: SystemMouseCursors.click), const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing), ]; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.click.kind), ]); logCursors.clear(); // Remove RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, const Offset(5.0, 0.0)), ])); }); test('Annotations with deferring cursors are ignored', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; late List<TestAnnotationTarget> annotations; setUpMouseTracker( annotationFinder: (Offset position) sync* { yield* annotations; }, logCursors: logCursors, ); annotations = <TestAnnotationTarget>[ const TestAnnotationTarget(), const TestAnnotationTarget(), const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing), ]; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.grabbing.kind), ]); logCursors.clear(); // Remove RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, const Offset(5.0, 0.0)), ])); }); test('Finding no annotation is equivalent to specifying default cursor', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; TestAnnotationTarget? annotation; setUpMouseTracker( annotationFinder: (Offset position) => <TestAnnotationTarget>[if (annotation != null) annotation], logCursors: logCursors, ); // Pointer is added outside of the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); // Pointer moved to an annotation specified with the default cursor annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.basic); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(5.0, 0.0)), ])); expect(logCursors, <_CursorUpdateDetails>[]); logCursors.clear(); // Pointer moved to no annotations annotation = null; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, Offset.zero), ])); expect(logCursors, <_CursorUpdateDetails>[]); logCursors.clear(); // Remove RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.remove, Offset.zero), ])); }); test('Removing a pointer resets it back to the default cursor', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; TestAnnotationTarget? annotation; setUpMouseTracker( annotationFinder: (Offset position) => <TestAnnotationTarget>[if (annotation != null) annotation], logCursors: logCursors, ); // Pointer is added to the annotation, then removed annotation = const TestAnnotationTarget(cursor: SystemMouseCursors.click); RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), _pointerData(PointerChange.hover, const Offset(5.0, 0.0)), _pointerData(PointerChange.remove, const Offset(5.0, 0.0)), ])); logCursors.clear(); // Pointer is added out of the annotation annotation = null; RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero), ])); addTearDown(dispatchRemoveDevice); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 0, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); }); test('Pointing devices display cursors separately', () { final List<_CursorUpdateDetails> logCursors = <_CursorUpdateDetails>[]; setUpMouseTracker( annotationFinder: (Offset position) sync* { if (position.dx > 200) { yield const TestAnnotationTarget(cursor: SystemMouseCursors.forbidden); } else if (position.dx > 100) { yield const TestAnnotationTarget(cursor: SystemMouseCursors.click); } else {} }, logCursors: logCursors, ); // Pointers are added outside of the annotation. RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.add, Offset.zero, device: 1), _pointerData(PointerChange.add, Offset.zero, device: 2), ])); addTearDown(() => dispatchRemoveDevice(1)); addTearDown(() => dispatchRemoveDevice(2)); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 1, kind: SystemMouseCursors.basic.kind), _CursorUpdateDetails.activateSystemCursor(device: 2, kind: SystemMouseCursors.basic.kind), ]); logCursors.clear(); // Pointer 1 moved to cursor "click" RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(101.0, 0.0), device: 1), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 1, kind: SystemMouseCursors.click.kind), ]); logCursors.clear(); // Pointer 2 moved to cursor "click" RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(102.0, 0.0), device: 2), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 2, kind: SystemMouseCursors.click.kind), ]); logCursors.clear(); // Pointer 2 moved to cursor "forbidden" RendererBinding.instance.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[ _pointerData(PointerChange.hover, const Offset(202.0, 0.0), device: 2), ])); expect(logCursors, <_CursorUpdateDetails>[ _CursorUpdateDetails.activateSystemCursor(device: 2, kind: SystemMouseCursors.forbidden.kind), ]); logCursors.clear(); }); } ui.PointerData _pointerData( PointerChange change, Offset logicalPosition, { int device = 0, PointerDeviceKind kind = PointerDeviceKind.mouse, }) { final double devicePixelRatio = RendererBinding.instance.platformDispatcher.implicitView!.devicePixelRatio; return ui.PointerData( change: change, physicalX: logicalPosition.dx * devicePixelRatio, physicalY: logicalPosition.dy * devicePixelRatio, kind: kind, device: device, ); } class _CursorUpdateDetails extends MethodCall { const _CursorUpdateDetails(super.method, Map<String, dynamic> super.arguments); _CursorUpdateDetails.wrap(MethodCall call) : super(call.method, Map<String, dynamic>.from(call.arguments as Map<dynamic, dynamic>)); _CursorUpdateDetails.activateSystemCursor({ required int device, required String kind, }) : this('activateSystemCursor', <String, dynamic>{'device': device, 'kind': kind}); @override Map<String, dynamic> get arguments => super.arguments as Map<String, dynamic>; @override bool operator ==(Object other) { if (identical(other, this)) { return true; } if (other.runtimeType != runtimeType) { return false; } return other is _CursorUpdateDetails && other.method == method && other.arguments.length == arguments.length && other.arguments.entries.every( (MapEntry<String, dynamic> entry) => arguments.containsKey(entry.key) && arguments[entry.key] == entry.value, ); } @override int get hashCode => Object.hash(method, arguments); @override String toString() { return '_CursorUpdateDetails(method: $method, arguments: $arguments)'; } }
flutter/packages/flutter/test/rendering/mouse_tracker_cursor_test.dart/0
{ "file_path": "flutter/packages/flutter/test/rendering/mouse_tracker_cursor_test.dart", "repo_id": "flutter", "token_count": 6709 }
748
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; import 'rendering_tester.dart'; void main() { TestRenderingFlutterBinding.ensureInitialized(); test('RenderPositionedBox expands', () { final RenderConstrainedBox sizer = RenderConstrainedBox( additionalConstraints: BoxConstraints.tight(const Size(100.0, 100.0)), child: RenderDecoratedBox(decoration: const BoxDecoration()), ); final RenderPositionedBox positioner = RenderPositionedBox(child: sizer); layout(positioner, constraints: BoxConstraints.loose(const Size(200.0, 200.0))); expect(positioner.size.width, equals(200.0), reason: 'positioner width'); expect(positioner.size.height, equals(200.0), reason: 'positioner height'); }); test('RenderPositionedBox shrink wraps', () { final RenderConstrainedBox sizer = RenderConstrainedBox( additionalConstraints: BoxConstraints.tight(const Size(100.0, 100.0)), child: RenderDecoratedBox(decoration: const BoxDecoration()), ); final RenderPositionedBox positioner = RenderPositionedBox(child: sizer, widthFactor: 1.0); layout(positioner, constraints: BoxConstraints.loose(const Size(200.0, 200.0))); expect(positioner.size.width, equals(100.0), reason: 'positioner width'); expect(positioner.size.height, equals(200.0), reason: 'positioner height'); positioner.widthFactor = null; positioner.heightFactor = 1.0; pumpFrame(); expect(positioner.size.width, equals(200.0), reason: 'positioner width'); expect(positioner.size.height, equals(100.0), reason: 'positioner height'); positioner.widthFactor = 1.0; pumpFrame(); expect(positioner.size.width, equals(100.0), reason: 'positioner width'); expect(positioner.size.height, equals(100.0), reason: 'positioner height'); }); test('RenderPositionedBox width and height factors', () { final RenderConstrainedBox sizer = RenderConstrainedBox( additionalConstraints: BoxConstraints.tight(const Size(100.0, 100.0)), child: RenderDecoratedBox(decoration: const BoxDecoration()), ); final RenderPositionedBox positioner = RenderPositionedBox(child: sizer, widthFactor: 1.0, heightFactor: 0.0); layout(positioner, constraints: BoxConstraints.loose(const Size(200.0, 200.0))); expect(positioner.computeMinIntrinsicWidth(200), equals(100.0)); expect(positioner.computeMaxIntrinsicWidth(200), equals(100.0)); expect(positioner.computeMinIntrinsicHeight(200), equals(0)); expect(positioner.computeMaxIntrinsicHeight(200), equals(0)); expect(positioner.size.width, equals(100.0)); expect(positioner.size.height, equals(0.0)); positioner.widthFactor = 0.5; positioner.heightFactor = 0.5; pumpFrame(); expect(positioner.computeMinIntrinsicWidth(200), equals(50.0)); expect(positioner.computeMaxIntrinsicWidth(200), equals(50.0)); expect(positioner.computeMinIntrinsicHeight(200), equals(50.0)); expect(positioner.computeMaxIntrinsicHeight(200), equals(50.0)); expect(positioner.size.width, equals(50.0)); expect(positioner.size.height, equals(50.0)); positioner.widthFactor = null; positioner.heightFactor = null; pumpFrame(); expect(positioner.computeMinIntrinsicWidth(200), equals(100.0)); expect(positioner.computeMaxIntrinsicWidth(200), equals(100.0)); expect(positioner.computeMinIntrinsicHeight(200), equals(100.0)); expect(positioner.computeMaxIntrinsicHeight(200), equals(100.0)); expect(positioner.size.width, equals(200.0)); expect(positioner.size.height, equals(200.0)); }); }
flutter/packages/flutter/test/rendering/positioned_box_test.dart/0
{ "file_path": "flutter/packages/flutter/test/rendering/positioned_box_test.dart", "repo_id": "flutter", "token_count": 1317 }
749
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; import 'rendering_tester.dart'; void main() { TestRenderingFlutterBinding.ensureInitialized(); // Regression test for https://github.com/flutter/flutter/issues/35426. test('RenderSliverFloatingPersistentHeader maxScrollObstructionExtent is 0', () { final TestRenderSliverFloatingPersistentHeader header = TestRenderSliverFloatingPersistentHeader(child: RenderSizedBox(const Size(400.0, 100.0))); final RenderViewport root = RenderViewport( crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 0, children: <RenderSliver>[ header, ], ); layout(root); expect(header.geometry!.maxScrollObstructionExtent, 0); }); test('RenderSliverFloatingPinnedPersistentHeader maxScrollObstructionExtent is minExtent', () { final TestRenderSliverFloatingPinnedPersistentHeader header = TestRenderSliverFloatingPinnedPersistentHeader( child: RenderSizedBox(const Size(400.0, 100.0)), ); final RenderViewport root = RenderViewport( crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 0, children: <RenderSliver>[ header, ], ); layout(root); expect(header.geometry!.maxScrollObstructionExtent, 100.0); }); } class TestRenderSliverFloatingPersistentHeader extends RenderSliverFloatingPersistentHeader { TestRenderSliverFloatingPersistentHeader({ required RenderBox child, }) : super(child: child, vsync: null, showOnScreenConfiguration: null); @override double get maxExtent => 200; @override double get minExtent => 100; } class TestRenderSliverFloatingPinnedPersistentHeader extends RenderSliverFloatingPinnedPersistentHeader { TestRenderSliverFloatingPinnedPersistentHeader({ required RenderBox child, }) : super(child: child, vsync: null, showOnScreenConfiguration: null); @override double get maxExtent => 200; @override double get minExtent => 100; }
flutter/packages/flutter/test/rendering/sliver_persistent_header_test.dart/0
{ "file_path": "flutter/packages/flutter/test/rendering/sliver_persistent_header_test.dart", "repo_id": "flutter", "token_count": 738 }
750
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/foundation.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'scheduler_tester.dart'; class TestSchedulerBinding extends BindingBase with SchedulerBinding, ServicesBinding { } void main() { final SchedulerBinding scheduler = TestSchedulerBinding(); test('Check for a time dilation being in effect', () { expect(timeDilation, equals(1.0)); }); test('Can cancel queued callback', () { late int secondId; bool firstCallbackRan = false; bool secondCallbackRan = false; void firstCallback(Duration timeStamp) { expect(firstCallbackRan, isFalse); expect(secondCallbackRan, isFalse); expect(timeStamp.inMilliseconds, equals(0)); firstCallbackRan = true; scheduler.cancelFrameCallbackWithId(secondId); } void secondCallback(Duration timeStamp) { expect(firstCallbackRan, isTrue); expect(secondCallbackRan, isFalse); expect(timeStamp.inMilliseconds, equals(0)); secondCallbackRan = true; } scheduler.scheduleFrameCallback(firstCallback); secondId = scheduler.scheduleFrameCallback(secondCallback); tick(const Duration(milliseconds: 16)); expect(firstCallbackRan, isTrue); expect(secondCallbackRan, isFalse); firstCallbackRan = false; secondCallbackRan = false; tick(const Duration(milliseconds: 32)); expect(firstCallbackRan, isFalse); expect(secondCallbackRan, isFalse); }); }
flutter/packages/flutter/test/scheduler/animation_test.dart/0
{ "file_path": "flutter/packages/flutter/test/scheduler/animation_test.dart", "repo_id": "flutter", "token_count": 576 }
751
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:typed_data'; import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { SemanticsUpdateTestBinding(); testWidgets('Semantics update does not send update for merged nodes.', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); // Pumps a placeholder to trigger the warm up frame. await tester.pumpWidget( const Placeholder(), // Stops right after the warm up frame. phase: EnginePhase.build, ); // The warm up frame will send update for an empty semantics tree. We // ignore this one time update. SemanticsUpdateBuilderSpy.observations.clear(); // Builds the real widget tree. await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: MergeSemantics( child: Semantics( label: 'outer', // This semantics node should not be part of the semantics update // because it is under another semantics container. child: Semantics( label: 'inner', container: true, child: const Text('text'), ), ), ), ), ); expect(SemanticsUpdateBuilderSpy.observations.length, 2); expect(SemanticsUpdateBuilderSpy.observations.containsKey(0), isTrue); expect(SemanticsUpdateBuilderSpy.observations[0]!.childrenInTraversalOrder.length, 1); expect(SemanticsUpdateBuilderSpy.observations[0]!.childrenInTraversalOrder[0], 1); expect(SemanticsUpdateBuilderSpy.observations.containsKey(1), isTrue); expect(SemanticsUpdateBuilderSpy.observations[1]!.childrenInTraversalOrder.length, 0); expect(SemanticsUpdateBuilderSpy.observations[1]!.label, 'outer\ninner\ntext'); SemanticsUpdateBuilderSpy.observations.clear(); // Updates the inner semantics label and verifies it only sends update for // the merged parent. await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: MergeSemantics( child: Semantics( label: 'outer', // This semantics node should not be part of the semantics update // because it is under another semantics container. child: Semantics( label: 'inner-updated', container: true, child: const Text('text'), ), ), ), ), ); expect(SemanticsUpdateBuilderSpy.observations.length, 1); expect(SemanticsUpdateBuilderSpy.observations.containsKey(1), isTrue); expect(SemanticsUpdateBuilderSpy.observations[1]!.childrenInTraversalOrder.length, 0); expect(SemanticsUpdateBuilderSpy.observations[1]!.label, 'outer\ninner-updated\ntext'); SemanticsUpdateBuilderSpy.observations.clear(); handle.dispose(); }, skip: true); // https://github.com/flutter/flutter/issues/97894 testWidgets('Semantics update receives attributed text', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); // Pumps a placeholder to trigger the warm up frame. await tester.pumpWidget( const Placeholder(), // Stops right after the warm up frame. phase: EnginePhase.build, ); // The warm up frame will send update for an empty semantics tree. We // ignore this one time update. SemanticsUpdateBuilderSpy.observations.clear(); // Builds the real widget tree. await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Semantics( attributedLabel: AttributedString( 'label', attributes: <StringAttribute>[ SpellOutStringAttribute(range: const TextRange(start: 0, end: 5)), ], ), attributedValue: AttributedString( 'value', attributes: <StringAttribute>[ LocaleStringAttribute(range: const TextRange(start: 0, end: 5), locale: const Locale('en', 'MX')), ], ), attributedHint: AttributedString( 'hint', attributes: <StringAttribute>[ SpellOutStringAttribute(range: const TextRange(start: 1, end: 2)), ], ), child: const Placeholder(), ), ), ); expect(SemanticsUpdateBuilderSpy.observations.length, 2); expect(SemanticsUpdateBuilderSpy.observations.containsKey(0), isTrue); expect(SemanticsUpdateBuilderSpy.observations[0]!.childrenInTraversalOrder.length, 1); expect(SemanticsUpdateBuilderSpy.observations[0]!.childrenInTraversalOrder[0], 1); expect(SemanticsUpdateBuilderSpy.observations.containsKey(1), isTrue); expect(SemanticsUpdateBuilderSpy.observations[1]!.childrenInTraversalOrder.length, 0); expect(SemanticsUpdateBuilderSpy.observations[1]!.label, 'label'); expect(SemanticsUpdateBuilderSpy.observations[1]!.labelAttributes!.length, 1); expect(SemanticsUpdateBuilderSpy.observations[1]!.labelAttributes![0] is SpellOutStringAttribute, isTrue); expect(SemanticsUpdateBuilderSpy.observations[1]!.labelAttributes![0].range, const TextRange(start: 0, end: 5)); expect(SemanticsUpdateBuilderSpy.observations[1]!.value, 'value'); expect(SemanticsUpdateBuilderSpy.observations[1]!.valueAttributes!.length, 1); expect(SemanticsUpdateBuilderSpy.observations[1]!.valueAttributes![0] is LocaleStringAttribute, isTrue); final LocaleStringAttribute localeAttribute = SemanticsUpdateBuilderSpy.observations[1]!.valueAttributes![0] as LocaleStringAttribute; expect(localeAttribute.range, const TextRange(start: 0, end: 5)); expect(localeAttribute.locale, const Locale('en', 'MX')); expect(SemanticsUpdateBuilderSpy.observations[1]!.hint, 'hint'); expect(SemanticsUpdateBuilderSpy.observations[1]!.hintAttributes!.length, 1); expect(SemanticsUpdateBuilderSpy.observations[1]!.hintAttributes![0] is SpellOutStringAttribute, isTrue); expect(SemanticsUpdateBuilderSpy.observations[1]!.hintAttributes![0].range, const TextRange(start: 1, end: 2)); expect( tester.widget(find.byType(Semantics)).toString(), 'Semantics(' 'container: false, ' 'properties: SemanticsProperties, ' 'attributedLabel: "label" [SpellOutStringAttribute(TextRange(start: 0, end: 5))], ' 'attributedValue: "value" [LocaleStringAttribute(TextRange(start: 0, end: 5), en-MX)], ' 'attributedHint: "hint" [SpellOutStringAttribute(TextRange(start: 1, end: 2))]' // ignore: missing_whitespace_between_adjacent_strings ')', ); SemanticsUpdateBuilderSpy.observations.clear(); handle.dispose(); }, skip: true); // https://github.com/flutter/flutter/issues/97894 } class SemanticsUpdateTestBinding extends AutomatedTestWidgetsFlutterBinding { @override ui.SemanticsUpdateBuilder createSemanticsUpdateBuilder() { return SemanticsUpdateBuilderSpy(); } } class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilder { final SemanticsUpdateBuilder _builder = ui.SemanticsUpdateBuilder(); static Map<int, SemanticsNodeUpdateObservation> observations = <int, SemanticsNodeUpdateObservation>{}; @override void updateNode({ required int id, required int flags, required int actions, required int maxValueLength, required int currentValueLength, required int textSelectionBase, required int textSelectionExtent, required int platformViewId, required int scrollChildren, required int scrollIndex, required double scrollPosition, required double scrollExtentMax, required double scrollExtentMin, required double elevation, required double thickness, required Rect rect, required String identifier, required String label, List<StringAttribute>? labelAttributes, required String value, List<StringAttribute>? valueAttributes, required String increasedValue, List<StringAttribute>? increasedValueAttributes, required String decreasedValue, List<StringAttribute>? decreasedValueAttributes, required String hint, List<StringAttribute>? hintAttributes, String? tooltip, TextDirection? textDirection, required Float64List transform, required Int32List childrenInTraversalOrder, required Int32List childrenInHitTestOrder, required Int32List additionalActions, }) { // Makes sure we don't send the same id twice. assert(!observations.containsKey(id)); observations[id] = SemanticsNodeUpdateObservation( label: label, labelAttributes: labelAttributes, hint: hint, hintAttributes: hintAttributes, value: value, valueAttributes: valueAttributes, childrenInTraversalOrder: childrenInTraversalOrder, ); } @override void updateCustomAction({required int id, String? label, String? hint, int overrideId = -1}) => _builder.updateCustomAction(id: id, label: label, hint: hint, overrideId: overrideId); @override ui.SemanticsUpdate build() => _builder.build(); } class SemanticsNodeUpdateObservation { const SemanticsNodeUpdateObservation({ required this.label, this.labelAttributes, required this.value, this.valueAttributes, required this.hint, this.hintAttributes, required this.childrenInTraversalOrder, }); final String label; final List<StringAttribute>? labelAttributes; final String value; final List<StringAttribute>? valueAttributes; final String hint; final List<StringAttribute>? hintAttributes; final Int32List childrenInTraversalOrder; }
flutter/packages/flutter/test/semantics/semantics_update_test.dart/0
{ "file_path": "flutter/packages/flutter/test/semantics/semantics_update_test.dart", "repo_id": "flutter", "token_count": 3530 }
752
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('HardwareKeyboard records pressed keys and enabled locks', (WidgetTester tester) async { await simulateKeyDownEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numLock})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{LogicalKeyboardKey.numLock})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{KeyboardLockMode.numLock})); await simulateKeyDownEvent(LogicalKeyboardKey.numpad1, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numLock, PhysicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{LogicalKeyboardKey.numLock, LogicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{KeyboardLockMode.numLock})); await simulateKeyRepeatEvent(LogicalKeyboardKey.numpad1, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numLock, PhysicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{LogicalKeyboardKey.numLock, LogicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{KeyboardLockMode.numLock})); await simulateKeyUpEvent(LogicalKeyboardKey.numLock); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{LogicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{KeyboardLockMode.numLock})); await simulateKeyDownEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numLock, PhysicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{LogicalKeyboardKey.numLock, LogicalKeyboardKey.numpad1})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{})); await simulateKeyUpEvent(LogicalKeyboardKey.numpad1, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{PhysicalKeyboardKey.numLock})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{LogicalKeyboardKey.numLock})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{})); await simulateKeyUpEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.physicalKeysPressed, equals(<PhysicalKeyboardKey>{})); expect(HardwareKeyboard.instance.logicalKeysPressed, equals(<LogicalKeyboardKey>{})); expect(HardwareKeyboard.instance.lockModesEnabled, equals(<KeyboardLockMode>{})); }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); testWidgets('KeyEvent can tell which keys are pressed', (WidgetTester tester) async { await tester.pumpWidget(const Focus(autofocus: true, child: SizedBox())); await tester.pump(); await simulateKeyDownEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numLock), isTrue); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numLock), isTrue); await simulateKeyDownEvent(LogicalKeyboardKey.numpad1, platform: 'windows'); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numpad1), isTrue); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numpad1), isTrue); await simulateKeyRepeatEvent(LogicalKeyboardKey.numpad1, platform: 'windows'); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numpad1), isTrue); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numpad1), isTrue); await simulateKeyUpEvent(LogicalKeyboardKey.numLock); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numpad1), isTrue); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numpad1), isTrue); await simulateKeyDownEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numLock), isTrue); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numLock), isTrue); await simulateKeyUpEvent(LogicalKeyboardKey.numpad1, platform: 'windows'); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numpad1), isFalse); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numpad1), isFalse); await simulateKeyUpEvent(LogicalKeyboardKey.numLock, platform: 'windows'); expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numLock), isFalse); expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numLock), isFalse); }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); testWidgets('KeyboardManager synthesizes modifier keys in rawKeyData mode', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; HardwareKeyboard.instance.addHandler((KeyEvent event) { events.add(event); return false; }); // While ShiftLeft is held (the event of which was skipped), press keyA. final Map<String, dynamic> rawMessage = kIsWeb ? ( KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'web', )..['metaState'] = RawKeyEventDataWeb.modifierShift ) : ( KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'android', )..['metaState'] = RawKeyEventDataAndroid.modifierLeftShift | RawKeyEventDataAndroid.modifierShift ); tester.binding.keyEventManager.handleRawKeyMessage(rawMessage); expect(events, hasLength(2)); expect(events[0].physicalKey, PhysicalKeyboardKey.shiftLeft); expect(events[0].logicalKey, LogicalKeyboardKey.shiftLeft); expect(events[0].synthesized, true); expect(events[1].physicalKey, PhysicalKeyboardKey.keyA); expect(events[1].logicalKey, LogicalKeyboardKey.keyA); expect(events[1].synthesized, false); }); testWidgets('Dispatch events to all handlers', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<int> logs = <int>[]; await tester.pumpWidget( KeyboardListener( autofocus: true, focusNode: focusNode, child: Container(), onKeyEvent: (KeyEvent event) { logs.add(1); }, ), ); // Only the Service binding handler. expect(await simulateKeyDownEvent(LogicalKeyboardKey.keyA), false); expect(logs, <int>[1]); logs.clear(); // Add a handler. bool handler2Result = false; bool handler2(KeyEvent event) { logs.add(2); return handler2Result; } HardwareKeyboard.instance.addHandler(handler2); expect(await simulateKeyUpEvent(LogicalKeyboardKey.keyA), false); expect(logs, <int>[2, 1]); logs.clear(); handler2Result = true; expect(await simulateKeyDownEvent(LogicalKeyboardKey.keyA), true); expect(logs, <int>[2, 1]); logs.clear(); // Add another handler. handler2Result = false; bool handler3Result = false; bool handler3(KeyEvent event) { logs.add(3); return handler3Result; } HardwareKeyboard.instance.addHandler(handler3); expect(await simulateKeyUpEvent(LogicalKeyboardKey.keyA), false); expect(logs, <int>[2, 3, 1]); logs.clear(); handler2Result = true; expect(await simulateKeyDownEvent(LogicalKeyboardKey.keyA), true); expect(logs, <int>[2, 3, 1]); logs.clear(); handler3Result = true; expect(await simulateKeyUpEvent(LogicalKeyboardKey.keyA), true); expect(logs, <int>[2, 3, 1]); logs.clear(); // Add handler2 again. HardwareKeyboard.instance.addHandler(handler2); handler3Result = false; handler2Result = false; expect(await simulateKeyDownEvent(LogicalKeyboardKey.keyA), false); expect(logs, <int>[2, 3, 2, 1]); logs.clear(); handler2Result = true; expect(await simulateKeyUpEvent(LogicalKeyboardKey.keyA), true); expect(logs, <int>[2, 3, 2, 1]); logs.clear(); // Remove handler2 once. HardwareKeyboard.instance.removeHandler(handler2); expect(await simulateKeyDownEvent(LogicalKeyboardKey.keyA), true); expect(logs, <int>[3, 2, 1]); logs.clear(); }, variant: KeySimulatorTransitModeVariant.all()); // Regression test for https://github.com/flutter/flutter/issues/99196 . // // In rawKeyData mode, if a key down event is dispatched but immediately // synthesized to be released, the old logic would trigger a Null check // _CastError on _hardwareKeyboard.lookUpLayout(key). The original scenario // that this is triggered on Android is unknown. Here we make up a scenario // where a ShiftLeft key down is dispatched but the modifier bit is not set. testWidgets('Correctly convert down events that are synthesized released', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<KeyEvent> events = <KeyEvent>[]; await tester.pumpWidget( KeyboardListener( autofocus: true, focusNode: focusNode, child: Container(), onKeyEvent: (KeyEvent event) { events.add(event); }, ), ); // Dispatch an arbitrary event to bypass the pressedKeys check. await simulateKeyDownEvent(LogicalKeyboardKey.keyA, platform: 'web'); // Dispatch an final Map<String, dynamic> data2 = KeyEventSimulator.getKeyData( LogicalKeyboardKey.shiftLeft, platform: 'web', )..['metaState'] = 0; await tester.binding.defaultBinaryMessenger.handlePlatformMessage( SystemChannels.keyEvent.name, SystemChannels.keyEvent.codec.encodeMessage(data2), (ByteData? data) {}, ); expect(events, hasLength(3)); expect(events[1], isA<KeyDownEvent>()); expect(events[1].logicalKey, LogicalKeyboardKey.shiftLeft); expect(events[1].synthesized, false); expect(events[2], isA<KeyUpEvent>()); expect(events[2].logicalKey, LogicalKeyboardKey.shiftLeft); expect(events[2].synthesized, true); expect(ServicesBinding.instance.keyboard.physicalKeysPressed, equals(<PhysicalKeyboardKey>{ PhysicalKeyboardKey.keyA, })); }, variant: const KeySimulatorTransitModeVariant(<KeyDataTransitMode>{ KeyDataTransitMode.rawKeyData, })); testWidgets('Instantly dispatch synthesized key events when the queue is empty', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); final List<int> logs = <int>[]; await tester.pumpWidget( KeyboardListener( autofocus: true, focusNode: focusNode, child: Container(), onKeyEvent: (KeyEvent event) { logs.add(1); }, ), ); ServicesBinding.instance.keyboard.addHandler((KeyEvent event) { logs.add(2); return false; }); // Dispatch a solitary synthesized event. expect(ServicesBinding.instance.keyEventManager.handleKeyData(ui.KeyData( timeStamp: Duration.zero, type: ui.KeyEventType.down, logical: LogicalKeyboardKey.keyA.keyId, physical: PhysicalKeyboardKey.keyA.usbHidUsage, character: null, synthesized: true, )), false); expect(logs, <int>[2, 1]); logs.clear(); }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); testWidgets('Postpone synthesized key events when the queue is not empty', (WidgetTester tester) async { final FocusNode keyboardListenerFocusNode = FocusNode(); addTearDown(keyboardListenerFocusNode.dispose); final FocusNode rawKeyboardListenerFocusNode = FocusNode(); addTearDown(rawKeyboardListenerFocusNode.dispose); final List<String> logs = <String>[]; await tester.pumpWidget( RawKeyboardListener( focusNode: rawKeyboardListenerFocusNode, onKey: (RawKeyEvent event) { logs.add('${event.runtimeType}'); }, child: KeyboardListener( autofocus: true, focusNode: keyboardListenerFocusNode, child: Container(), onKeyEvent: (KeyEvent event) { logs.add('${event.runtimeType}'); }, ), ), ); // On macOS, a CapsLock tap yields a down event and a synthesized up event. expect(ServicesBinding.instance.keyEventManager.handleKeyData(ui.KeyData( timeStamp: Duration.zero, type: ui.KeyEventType.down, logical: LogicalKeyboardKey.capsLock.keyId, physical: PhysicalKeyboardKey.capsLock.usbHidUsage, character: null, synthesized: false, )), false); expect(ServicesBinding.instance.keyEventManager.handleKeyData(ui.KeyData( timeStamp: Duration.zero, type: ui.KeyEventType.up, logical: LogicalKeyboardKey.capsLock.keyId, physical: PhysicalKeyboardKey.capsLock.usbHidUsage, character: null, synthesized: true, )), false); expect(await ServicesBinding.instance.keyEventManager.handleRawKeyMessage(<String, dynamic>{ 'type': 'keydown', 'keymap': 'macos', 'keyCode': 0x00000039, 'characters': '', 'charactersIgnoringModifiers': '', 'modifiers': 0x10000, }), equals(<String, dynamic>{'handled': false})); expect(logs, <String>['RawKeyDownEvent', 'KeyDownEvent', 'KeyUpEvent']); logs.clear(); }, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData()); // The first key data received from the engine might be an empty key data. // In that case, the key data should not be converted to any [KeyEvent]s, // but is only used so that *a* key data comes before the raw key message // and makes [KeyEventManager] infer [KeyDataTransitMode.keyDataThenRawKeyData]. testWidgets('Empty keyData yields no event but triggers inference', (WidgetTester tester) async { final List<KeyEvent> events = <KeyEvent>[]; final List<RawKeyEvent> rawEvents = <RawKeyEvent>[]; tester.binding.keyboard.addHandler((KeyEvent event) { events.add(event); return true; }); RawKeyboard.instance.addListener((RawKeyEvent event) { rawEvents.add(event); }); tester.binding.keyEventManager.handleKeyData(const ui.KeyData( type: ui.KeyEventType.down, timeStamp: Duration.zero, logical: 0, physical: 0, character: 'a', synthesized: false, )); tester.binding.keyEventManager.handleRawKeyMessage(<String, dynamic>{ 'type': 'keydown', 'keymap': 'windows', 'keyCode': 0x04, 'scanCode': 0x04, 'characterCodePoint': 0, 'modifiers': 0, }); expect(events.length, 0); expect(rawEvents.length, 1); // Dispatch another key data to ensure it's in // [KeyDataTransitMode.keyDataThenRawKeyData] mode (otherwise assertion // will be thrown upon a KeyData). tester.binding.keyEventManager.handleKeyData(const ui.KeyData( type: ui.KeyEventType.down, timeStamp: Duration.zero, logical: 0x22, physical: 0x70034, character: '"', synthesized: false, )); tester.binding.keyEventManager.handleRawKeyMessage(<String, dynamic>{ 'type': 'keydown', 'keymap': 'windows', 'keyCode': 0x04, 'scanCode': 0x04, 'characterCodePoint': 0, 'modifiers': 0, }); expect(events.length, 1); expect(rawEvents.length, 2); }); testWidgets('Exceptions from keyMessageHandler are caught and reported', (WidgetTester tester) async { final KeyMessageHandler? oldKeyMessageHandler = tester.binding.keyEventManager.keyMessageHandler; addTearDown(() { tester.binding.keyEventManager.keyMessageHandler = oldKeyMessageHandler; }); // When keyMessageHandler throws an error... tester.binding.keyEventManager.keyMessageHandler = (KeyMessage message) { throw 1; }; // Simulate a key down event. FlutterErrorDetails? record; await _runWhileOverridingOnError( () => simulateKeyDownEvent(LogicalKeyboardKey.keyA), onError: (FlutterErrorDetails details) { record = details; } ); // ... the error should be caught. expect(record, isNotNull); expect(record!.exception, 1); final Map<String, DiagnosticsNode> infos = _groupDiagnosticsByName(record!.informationCollector!()); expect(infos['KeyMessage'], isA<DiagnosticsProperty<KeyMessage>>()); // But the exception should not interrupt recording the state. // Now the keyMessageHandler no longer throws an error. tester.binding.keyEventManager.keyMessageHandler = null; record = null; // Simulate a key up event. await _runWhileOverridingOnError( () => simulateKeyUpEvent(LogicalKeyboardKey.keyA), onError: (FlutterErrorDetails details) { record = details; } ); // If the previous state (key down) wasn't recorded, this key up event will // trigger assertions. expect(record, isNull); }); testWidgets('Exceptions from HardwareKeyboard handlers are caught and reported', (WidgetTester tester) async { bool throwingCallback(KeyEvent event) { throw 1; } // When the handler throws an error... HardwareKeyboard.instance.addHandler(throwingCallback); // Simulate a key down event. FlutterErrorDetails? record; await _runWhileOverridingOnError( () => simulateKeyDownEvent(LogicalKeyboardKey.keyA), onError: (FlutterErrorDetails details) { record = details; } ); // ... the error should be caught. expect(record, isNotNull); expect(record!.exception, 1); final Map<String, DiagnosticsNode> infos = _groupDiagnosticsByName(record!.informationCollector!()); expect(infos['Event'], isA<DiagnosticsProperty<KeyEvent>>()); // But the exception should not interrupt recording the state. // Now the key handler no longer throws an error. HardwareKeyboard.instance.removeHandler(throwingCallback); record = null; // Simulate a key up event. await _runWhileOverridingOnError( () => simulateKeyUpEvent(LogicalKeyboardKey.keyA), onError: (FlutterErrorDetails details) { record = details; } ); // If the previous state (key down) wasn't recorded, this key up event will // trigger assertions. expect(record, isNull); }, variant: KeySimulatorTransitModeVariant.all()); testWidgets('debugPrintKeyboardEvents causes logging of key events', (WidgetTester tester) async { final bool oldDebugPrintKeyboardEvents = debugPrintKeyboardEvents; final DebugPrintCallback oldDebugPrint = debugPrint; final StringBuffer messages = StringBuffer(); debugPrint = (String? message, {int? wrapWidth}) { messages.writeln(message ?? ''); }; debugPrintKeyboardEvents = true; try { await simulateKeyDownEvent(LogicalKeyboardKey.keyA); } finally { debugPrintKeyboardEvents = oldDebugPrintKeyboardEvents; debugPrint = oldDebugPrint; } final String messagesStr = messages.toString(); expect(messagesStr, contains('KEYBOARD: Key event received: ')); expect(messagesStr, contains('KEYBOARD: Pressed state before processing the event:')); expect(messagesStr, contains('KEYBOARD: Pressed state after processing the event:')); }); } Future<void> _runWhileOverridingOnError(AsyncCallback body, {required FlutterExceptionHandler onError}) async { final FlutterExceptionHandler? oldFlutterErrorOnError = FlutterError.onError; FlutterError.onError = onError; try { await body(); } finally { FlutterError.onError = oldFlutterErrorOnError; } } Map<String, DiagnosticsNode> _groupDiagnosticsByName(Iterable<DiagnosticsNode> infos) { return Map<String, DiagnosticsNode>.fromIterable( infos, key: (dynamic node) => (node as DiagnosticsNode).name ?? '', ); }
flutter/packages/flutter/test/services/hardware_keyboard_test.dart/0
{ "file_path": "flutter/packages/flutter/test/services/hardware_keyboard_test.dart", "repo_id": "flutter", "token_count": 7542 }
753
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { // We need a separate test file for this test case (instead of including it // in platform_channel_test.dart) since we rely on the WidgetsFlutterBinding // not being initialized and we call ensureInitialized() in the other test // file. test('throws assertion error iff WidgetsFlutterBinding is not yet initialized', () { const MethodChannel methodChannel = MethodChannel('mock'); // Verify an assertion error is thrown before the binary messenger is // accessed (which would result in a _CastError due to the non-null // assertion). This way we can hint the caller towards how to fix the error. expect(() => methodChannel.setMethodCallHandler(null), throwsAssertionError); // Verify the assertion is not thrown once the binding has been initialized. // This cannot be a separate test case since the execution order is random. TestWidgetsFlutterBinding.ensureInitialized(); expect(() => methodChannel.setMethodCallHandler(null), returnsNormally); }); }
flutter/packages/flutter/test/services/set_method_call_handler_test.dart/0
{ "file_path": "flutter/packages/flutter/test/services/set_method_call_handler_test.dart", "repo_id": "flutter", "token_count": 343 }
754
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('AnimatedCrossFade test', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( firstChild: SizedBox( width: 100.0, height: 100.0, ), secondChild: SizedBox( width: 200.0, height: 200.0, ), duration: Duration(milliseconds: 200), crossFadeState: CrossFadeState.showFirst, ), ), ), ); expect(find.byType(FadeTransition), findsNWidgets(2)); RenderBox box = tester.renderObject(find.byType(AnimatedCrossFade)); expect(box.size.width, equals(100.0)); expect(box.size.height, equals(100.0)); await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( firstChild: SizedBox( width: 100.0, height: 100.0, ), secondChild: SizedBox( width: 200.0, height: 200.0, ), duration: Duration(milliseconds: 200), crossFadeState: CrossFadeState.showSecond, ), ), ), ); await tester.pump(const Duration(milliseconds: 100)); expect(find.byType(FadeTransition), findsNWidgets(2)); box = tester.renderObject(find.byType(AnimatedCrossFade)); expect(box.size.width, equals(150.0)); expect(box.size.height, equals(150.0)); }); testWidgets('AnimatedCrossFade test showSecond', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( firstChild: SizedBox( width: 100.0, height: 100.0, ), secondChild: SizedBox( width: 200.0, height: 200.0, ), duration: Duration(milliseconds: 200), crossFadeState: CrossFadeState.showSecond, ), ), ), ); expect(find.byType(FadeTransition), findsNWidgets(2)); final RenderBox box = tester.renderObject(find.byType(AnimatedCrossFade)); expect(box.size.width, equals(200.0)); expect(box.size.height, equals(200.0)); }); testWidgets('AnimatedCrossFade alignment (VISUAL)', (WidgetTester tester) async { final Key firstKey = UniqueKey(); final Key secondKey = UniqueKey(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( alignment: Alignment.bottomRight, firstChild: SizedBox( key: firstKey, width: 100.0, height: 100.0, ), secondChild: SizedBox( key: secondKey, width: 200.0, height: 200.0, ), duration: const Duration(milliseconds: 200), crossFadeState: CrossFadeState.showFirst, ), ), ), ); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( alignment: Alignment.bottomRight, firstChild: SizedBox( key: firstKey, width: 100.0, height: 100.0, ), secondChild: SizedBox( key: secondKey, width: 200.0, height: 200.0, ), duration: const Duration(milliseconds: 200), crossFadeState: CrossFadeState.showSecond, ), ), ), ); await tester.pump(const Duration(milliseconds: 100)); final RenderBox box1 = tester.renderObject(find.byKey(firstKey)); final RenderBox box2 = tester.renderObject(find.byKey(secondKey)); expect(box1.localToGlobal(Offset.zero), const Offset(275.0, 175.0)); expect(box2.localToGlobal(Offset.zero), const Offset(275.0, 175.0)); }); testWidgets('AnimatedCrossFade alignment (LTR)', (WidgetTester tester) async { final Key firstKey = UniqueKey(); final Key secondKey = UniqueKey(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( alignment: AlignmentDirectional.bottomEnd, firstChild: SizedBox( key: firstKey, width: 100.0, height: 100.0, ), secondChild: SizedBox( key: secondKey, width: 200.0, height: 200.0, ), duration: const Duration(milliseconds: 200), crossFadeState: CrossFadeState.showFirst, ), ), ), ); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: AnimatedCrossFade( alignment: AlignmentDirectional.bottomEnd, firstChild: SizedBox( key: firstKey, width: 100.0, height: 100.0, ), secondChild: SizedBox( key: secondKey, width: 200.0, height: 200.0, ), duration: const Duration(milliseconds: 200), crossFadeState: CrossFadeState.showSecond, ), ), ), ); await tester.pump(const Duration(milliseconds: 100)); final RenderBox box1 = tester.renderObject(find.byKey(firstKey)); final RenderBox box2 = tester.renderObject(find.byKey(secondKey)); expect(box1.localToGlobal(Offset.zero), const Offset(275.0, 175.0)); expect(box2.localToGlobal(Offset.zero), const Offset(275.0, 175.0)); }); testWidgets('AnimatedCrossFade alignment (RTL)', (WidgetTester tester) async { final Key firstKey = UniqueKey(); final Key secondKey = UniqueKey(); await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, child: Center( child: AnimatedCrossFade( alignment: AlignmentDirectional.bottomEnd, firstChild: SizedBox( key: firstKey, width: 100.0, height: 100.0, ), secondChild: SizedBox( key: secondKey, width: 200.0, height: 200.0, ), duration: const Duration(milliseconds: 200), crossFadeState: CrossFadeState.showFirst, ), ), ), ); await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, child: Center( child: AnimatedCrossFade( alignment: AlignmentDirectional.bottomEnd, firstChild: SizedBox( key: firstKey, width: 100.0, height: 100.0, ), secondChild: SizedBox( key: secondKey, width: 200.0, height: 200.0, ), duration: const Duration(milliseconds: 200), crossFadeState: CrossFadeState.showSecond, ), ), ), ); await tester.pump(const Duration(milliseconds: 100)); final RenderBox box1 = tester.renderObject(find.byKey(firstKey)); final RenderBox box2 = tester.renderObject(find.byKey(secondKey)); expect(box1.localToGlobal(Offset.zero), const Offset(325.0, 175.0)); expect(box2.localToGlobal(Offset.zero), const Offset(325.0, 175.0)); }); Widget crossFadeWithWatcher({ bool towardsSecond = false }) { return Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: const _TickerWatchingWidget(), secondChild: Container(), crossFadeState: towardsSecond ? CrossFadeState.showSecond : CrossFadeState.showFirst, duration: const Duration(milliseconds: 50), ), ); } testWidgets('AnimatedCrossFade preserves widget state', (WidgetTester tester) async { await tester.pumpWidget(crossFadeWithWatcher()); _TickerWatchingWidgetState findState() => tester.state(find.byType(_TickerWatchingWidget)); final _TickerWatchingWidgetState state = findState(); await tester.pumpWidget(crossFadeWithWatcher(towardsSecond: true)); for (int i = 0; i < 3; i += 1) { await tester.pump(const Duration(milliseconds: 25)); expect(findState(), same(state)); } }); testWidgets('AnimatedCrossFade switches off TickerMode and semantics on faded out widget', (WidgetTester tester) async { ExcludeSemantics findSemantics() { return tester.widget(find.descendant( of: find.byKey(const ValueKey<CrossFadeState>(CrossFadeState.showFirst)), matching: find.byType(ExcludeSemantics), )); } await tester.pumpWidget(crossFadeWithWatcher()); final _TickerWatchingWidgetState state = tester.state(find.byType(_TickerWatchingWidget)); expect(state.ticker.muted, false); expect(findSemantics().excluding, false); await tester.pumpWidget(crossFadeWithWatcher(towardsSecond: true)); for (int i = 0; i < 2; i += 1) { await tester.pump(const Duration(milliseconds: 25)); // Animations are kept alive in the middle of cross-fade expect(state.ticker.muted, false); // Semantics are turned off immediately on the widget that's fading out expect(findSemantics().excluding, true); } // In the final state both animations and semantics should be off on the // widget that's faded out. await tester.pump(const Duration(milliseconds: 25)); expect(state.ticker.muted, true); expect(findSemantics().excluding, true); }); testWidgets('AnimatedCrossFade.layoutBuilder', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: Text('AAA', textDirection: TextDirection.ltr), secondChild: Text('BBB', textDirection: TextDirection.ltr), crossFadeState: CrossFadeState.showFirst, duration: Duration(milliseconds: 50), ), ), ); expect(find.text('AAA'), findsOneWidget); expect(find.text('BBB'), findsOneWidget); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: const Text('AAA', textDirection: TextDirection.ltr), secondChild: const Text('BBB', textDirection: TextDirection.ltr), crossFadeState: CrossFadeState.showFirst, duration: const Duration(milliseconds: 50), layoutBuilder: (Widget a, Key aKey, Widget b, Key bKey) => a, ), ), ); expect(find.text('AAA'), findsOneWidget); expect(find.text('BBB'), findsNothing); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: const Text('AAA', textDirection: TextDirection.ltr), secondChild: const Text('BBB', textDirection: TextDirection.ltr), crossFadeState: CrossFadeState.showSecond, duration: const Duration(milliseconds: 50), layoutBuilder: (Widget a, Key aKey, Widget b, Key bKey) => a, ), ), ); expect(find.text('BBB'), findsOneWidget); expect(find.text('AAA'), findsNothing); }); testWidgets('AnimatedCrossFade test focus', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: TextButton(onPressed: () {}, child: const Text('AAA')), secondChild: TextButton(onPressed: () {}, child: const Text('BBB')), crossFadeState: CrossFadeState.showFirst, duration: const Duration(milliseconds: 50), ), ), ); final FocusNode visibleNode = Focus.of(tester.element(find.text('AAA')), scopeOk: true); visibleNode.requestFocus(); await tester.pump(); expect(visibleNode.hasPrimaryFocus, isTrue); final FocusNode hiddenNode = Focus.of(tester.element(find.text('BBB')), scopeOk: true); hiddenNode.requestFocus(); await tester.pump(); expect(hiddenNode.hasPrimaryFocus, isFalse); }); testWidgets('AnimatedCrossFade bottom child can have focus', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: TextButton(onPressed: () {}, child: const Text('AAA')), secondChild: TextButton(onPressed: () {}, child: const Text('BBB')), crossFadeState: CrossFadeState.showFirst, duration: const Duration(milliseconds: 50), excludeBottomFocus: false, ), ), ); final FocusNode visibleNode = Focus.of(tester.element(find.text('AAA')), scopeOk: true); visibleNode.requestFocus(); await tester.pump(); expect(visibleNode.hasPrimaryFocus, isTrue); final FocusNode hiddenNode = Focus.of(tester.element(find.text('BBB')), scopeOk: true); hiddenNode.requestFocus(); await tester.pump(); expect(hiddenNode.hasPrimaryFocus, isTrue); }); testWidgets('AnimatedCrossFade second child do not receive touch events', (WidgetTester tester) async { int numberOfTouchEventNoticed = 0; Future<void> buildAnimatedFrame(CrossFadeState crossFadeState) { return tester.pumpWidget( SizedBox( width: 300, height: 600, child: Directionality( textDirection: TextDirection.ltr, child: AnimatedCrossFade( firstChild: const Text('AAA'), secondChild: TextButton( style: TextButton.styleFrom(minimumSize: const Size(double.infinity, 600)), onPressed: () { numberOfTouchEventNoticed++; }, child: const Text('BBB'), ), crossFadeState: crossFadeState, duration: const Duration(milliseconds: 50), ), ), ), ); } Future<void> touchSecondButton() async { final TestGesture gestureTouchSecondButton = await tester .startGesture(const Offset(150, 300)); return gestureTouchSecondButton.up(); } await buildAnimatedFrame(CrossFadeState.showSecond); await touchSecondButton(); expect(numberOfTouchEventNoticed, 1); await buildAnimatedFrame(CrossFadeState.showFirst); await touchSecondButton(); await touchSecondButton(); expect(numberOfTouchEventNoticed, 1); }); } class _TickerWatchingWidget extends StatefulWidget { const _TickerWatchingWidget(); @override State<StatefulWidget> createState() => _TickerWatchingWidgetState(); } class _TickerWatchingWidgetState extends State<_TickerWatchingWidget> with SingleTickerProviderStateMixin { late Ticker ticker; @override void initState() { super.initState(); ticker = createTicker((_) { })..start(); } @override Widget build(BuildContext context) => Container(); @override void dispose() { ticker.dispose(); super.dispose(); } }
flutter/packages/flutter/test/widgets/animated_cross_fade_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/animated_cross_fade_test.dart", "repo_id": "flutter", "token_count": 6991 }
755
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; class InvalidOnInitLifecycleWidget extends StatefulWidget { const InvalidOnInitLifecycleWidget({super.key}); @override InvalidOnInitLifecycleWidgetState createState() => InvalidOnInitLifecycleWidgetState(); } class InvalidOnInitLifecycleWidgetState extends State<InvalidOnInitLifecycleWidget> { @override Future<void> initState() async { super.initState(); } @override Widget build(BuildContext context) { return Container(); } } class InvalidDidUpdateWidgetLifecycleWidget extends StatefulWidget { const InvalidDidUpdateWidgetLifecycleWidget({super.key, required this.color}); final Color color; @override InvalidDidUpdateWidgetLifecycleWidgetState createState() => InvalidDidUpdateWidgetLifecycleWidgetState(); } class InvalidDidUpdateWidgetLifecycleWidgetState extends State<InvalidDidUpdateWidgetLifecycleWidget> { @override Future<void> didUpdateWidget(InvalidDidUpdateWidgetLifecycleWidget oldWidget) async { super.didUpdateWidget(oldWidget); } @override Widget build(BuildContext context) { return ColoredBox(color: widget.color); } } void main() { testWidgets('async onInit throws FlutterError', (WidgetTester tester) async { await tester.pumpWidget(const InvalidOnInitLifecycleWidget()); expect(tester.takeException(), isFlutterError); }); testWidgets('async didUpdateWidget throws FlutterError', (WidgetTester tester) async { await tester.pumpWidget(const InvalidDidUpdateWidgetLifecycleWidget(color: Colors.green)); await tester.pumpWidget(const InvalidDidUpdateWidgetLifecycleWidget(color: Colors.red)); expect(tester.takeException(), isFlutterError); }); }
flutter/packages/flutter/test/widgets/async_lifecycle_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/async_lifecycle_test.dart", "repo_id": "flutter", "token_count": 568 }
756
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; class MemoryPressureObserver with WidgetsBindingObserver { bool sawMemoryPressure = false; @override void didHaveMemoryPressure() { sawMemoryPressure = true; } } class AppLifecycleStateObserver with WidgetsBindingObserver { List<AppLifecycleState> accumulatedStates = <AppLifecycleState>[]; @override void didChangeAppLifecycleState(AppLifecycleState state) { accumulatedStates.add(state); } } class PushRouteObserver with WidgetsBindingObserver { late String pushedRoute; @override Future<bool> didPushRoute(String route) async { pushedRoute = route; return true; } } class PushRouteInformationObserver with WidgetsBindingObserver { late RouteInformation pushedRouteInformation; @override Future<bool> didPushRouteInformation(RouteInformation routeInformation) async { pushedRouteInformation = routeInformation; return true; } } // Implements to make sure all methods get coverage. class RentrantObserver implements WidgetsBindingObserver { RentrantObserver() { WidgetsBinding.instance.addObserver(this); } bool active = true; int removeSelf() { active = false; int count = 0; while (WidgetsBinding.instance.removeObserver(this)) { count += 1; } return count; } @override void didChangeAccessibilityFeatures() { assert(active); WidgetsBinding.instance.addObserver(this); } @override void didChangeAppLifecycleState(AppLifecycleState state) { assert(active); WidgetsBinding.instance.addObserver(this); } @override void didChangeLocales(List<Locale>? locales) { assert(active); WidgetsBinding.instance.addObserver(this); } @override void didChangeMetrics() { assert(active); WidgetsBinding.instance.addObserver(this); } @override void didChangePlatformBrightness() { assert(active); WidgetsBinding.instance.addObserver(this); } @override void didChangeTextScaleFactor() { assert(active); WidgetsBinding.instance.addObserver(this); } @override void didHaveMemoryPressure() { assert(active); WidgetsBinding.instance.addObserver(this); } @override Future<bool> didPopRoute() { assert(active); WidgetsBinding.instance.addObserver(this); return Future<bool>.value(true); } @override Future<bool> didPushRoute(String route) { assert(active); WidgetsBinding.instance.addObserver(this); return Future<bool>.value(true); } @override Future<bool> didPushRouteInformation(RouteInformation routeInformation) { assert(active); WidgetsBinding.instance.addObserver(this); return Future<bool>.value(true); } @override Future<AppExitResponse> didRequestAppExit() { assert(active); WidgetsBinding.instance.addObserver(this); return Future<AppExitResponse>.value(AppExitResponse.exit); } } void main() { Future<void> setAppLifeCycleState(AppLifecycleState state) async { final ByteData? message = const StringCodec().encodeMessage(state.toString()); await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage('flutter/lifecycle', message, (_) { }); } testWidgets('Rentrant observer callbacks do not result in exceptions', (WidgetTester tester) async { final RentrantObserver observer = RentrantObserver(); WidgetsBinding.instance.handleAccessibilityFeaturesChanged(); WidgetsBinding.instance.handleAppLifecycleStateChanged(AppLifecycleState.resumed); WidgetsBinding.instance.handleLocaleChanged(); WidgetsBinding.instance.handleMetricsChanged(); WidgetsBinding.instance.handlePlatformBrightnessChanged(); WidgetsBinding.instance.handleTextScaleFactorChanged(); WidgetsBinding.instance.handleMemoryPressure(); WidgetsBinding.instance.handlePopRoute(); WidgetsBinding.instance.handlePushRoute('/'); WidgetsBinding.instance.handleRequestAppExit(); await tester.idle(); expect(observer.removeSelf(), greaterThan(1)); expect(observer.removeSelf(), 0); }); testWidgets('didHaveMemoryPressure callback', (WidgetTester tester) async { final MemoryPressureObserver observer = MemoryPressureObserver(); WidgetsBinding.instance.addObserver(observer); final ByteData message = const JSONMessageCodec().encodeMessage(<String, dynamic>{'type': 'memoryPressure'})!; await tester.binding.defaultBinaryMessenger.handlePlatformMessage('flutter/system', message, (_) { }); expect(observer.sawMemoryPressure, true); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('handleLifecycleStateChanged callback', (WidgetTester tester) async { final AppLifecycleStateObserver observer = AppLifecycleStateObserver(); WidgetsBinding.instance.addObserver(observer); await setAppLifeCycleState(AppLifecycleState.paused); expect(observer.accumulatedStates, <AppLifecycleState>[AppLifecycleState.paused]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.resumed); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.hidden, AppLifecycleState.inactive, AppLifecycleState.resumed, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.paused); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.inactive, AppLifecycleState.hidden, AppLifecycleState.paused, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.inactive); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.hidden, AppLifecycleState.inactive, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.hidden); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.hidden, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.paused); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.paused, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.detached); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.detached, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.resumed); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.resumed, ]); observer.accumulatedStates.clear(); await setAppLifeCycleState(AppLifecycleState.detached); expect(observer.accumulatedStates, <AppLifecycleState>[ AppLifecycleState.inactive, AppLifecycleState.hidden, AppLifecycleState.paused, AppLifecycleState.detached, ]); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('didPushRoute callback', (WidgetTester tester) async { final PushRouteObserver observer = PushRouteObserver(); WidgetsBinding.instance.addObserver(observer); const String testRouteName = 'testRouteName'; final ByteData message = const JSONMethodCodec().encodeMethodCall(const MethodCall('pushRoute', testRouteName)); await tester.binding.defaultBinaryMessenger.handlePlatformMessage('flutter/navigation', message, (_) {}); expect(observer.pushedRoute, testRouteName); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('didPushRouteInformation calls didPushRoute by default', (WidgetTester tester) async { final PushRouteObserver observer = PushRouteObserver(); WidgetsBinding.instance.addObserver(observer); const Map<String, dynamic> testRouteInformation = <String, dynamic>{ 'location': 'testRouteName', 'state': 'state', 'restorationData': <dynamic, dynamic>{'test': 'config'}, }; final ByteData message = const JSONMethodCodec().encodeMethodCall( const MethodCall('pushRouteInformation', testRouteInformation), ); await tester.binding.defaultBinaryMessenger .handlePlatformMessage('flutter/navigation', message, (_) {}); expect(observer.pushedRoute, 'testRouteName'); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('didPushRouteInformation calls didPushRoute correctly when handling url', (WidgetTester tester) async { final PushRouteObserver observer = PushRouteObserver(); WidgetsBinding.instance.addObserver(observer); // A url without any path. Map<String, dynamic> testRouteInformation = const <String, dynamic>{ 'location': 'http://hostname', 'state': 'state', 'restorationData': <dynamic, dynamic>{'test': 'config'}, }; ByteData message = const JSONMethodCodec().encodeMethodCall( MethodCall('pushRouteInformation', testRouteInformation), ); await ServicesBinding.instance.defaultBinaryMessenger .handlePlatformMessage('flutter/navigation', message, (_) {}); expect(observer.pushedRoute, '/'); // A complex url. testRouteInformation = const <String, dynamic>{ 'location': 'http://hostname/abc?def=123&def=456#789', 'state': 'state', 'restorationData': <dynamic, dynamic>{'test': 'config'}, }; message = const JSONMethodCodec().encodeMethodCall( MethodCall('pushRouteInformation', testRouteInformation), ); await ServicesBinding.instance.defaultBinaryMessenger .handlePlatformMessage('flutter/navigation', message, (_) {}); expect(observer.pushedRoute, '/abc?def=123&def=456#789'); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('didPushRouteInformation callback', (WidgetTester tester) async { final PushRouteInformationObserver observer = PushRouteInformationObserver(); WidgetsBinding.instance.addObserver(observer); const Map<String, dynamic> testRouteInformation = <String, dynamic>{ 'location': 'testRouteName', 'state': 'state', }; final ByteData message = const JSONMethodCodec().encodeMethodCall( const MethodCall('pushRouteInformation', testRouteInformation), ); await tester.binding.defaultBinaryMessenger.handlePlatformMessage('flutter/navigation', message, (_) { }); expect(observer.pushedRouteInformation.uri.toString(), 'testRouteName'); expect(observer.pushedRouteInformation.state, 'state'); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('didPushRouteInformation callback can handle url', (WidgetTester tester) async { final PushRouteInformationObserver observer = PushRouteInformationObserver(); WidgetsBinding.instance.addObserver(observer); const Map<String, dynamic> testRouteInformation = <String, dynamic>{ 'location': 'http://hostname/abc?def=123&def=456#789', 'state': 'state', }; final ByteData message = const JSONMethodCodec().encodeMethodCall( const MethodCall('pushRouteInformation', testRouteInformation), ); await ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage('flutter/navigation', message, (_) { }); expect(observer.pushedRouteInformation.location, '/abc?def=123&def=456#789'); expect(observer.pushedRouteInformation.uri.toString(), 'http://hostname/abc?def=123&def=456#789'); expect(observer.pushedRouteInformation.state, 'state'); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('didPushRouteInformation callback with null state', (WidgetTester tester) async { final PushRouteInformationObserver observer = PushRouteInformationObserver(); WidgetsBinding.instance.addObserver(observer); const Map<String, dynamic> testRouteInformation = <String, dynamic>{ 'location': 'testRouteName', 'state': null, }; final ByteData message = const JSONMethodCodec().encodeMethodCall( const MethodCall('pushRouteInformation', testRouteInformation), ); await tester.binding.defaultBinaryMessenger.handlePlatformMessage('flutter/navigation', message, (_) { }); expect(observer.pushedRouteInformation.uri.toString(), 'testRouteName'); expect(observer.pushedRouteInformation.state, null); WidgetsBinding.instance.removeObserver(observer); }); testWidgets('Application lifecycle affects frame scheduling', (WidgetTester tester) async { expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.paused); expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.resumed); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.inactive); expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.paused); expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.detached); expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.inactive); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); expect(tester.binding.hasScheduledFrame, isFalse); await setAppLifeCycleState(AppLifecycleState.paused); expect(tester.binding.hasScheduledFrame, isFalse); tester.binding.scheduleFrame(); expect(tester.binding.hasScheduledFrame, isFalse); tester.binding.scheduleForcedFrame(); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); int frameCount = 0; tester.binding.addPostFrameCallback((Duration duration) { frameCount += 1; }); expect(tester.binding.hasScheduledFrame, isFalse); await tester.pump(const Duration(milliseconds: 1)); expect(tester.binding.hasScheduledFrame, isFalse); expect(frameCount, 0); tester.binding.scheduleWarmUpFrame(); // this actually tests flutter_test's implementation expect(tester.binding.hasScheduledFrame, isFalse); expect(frameCount, 1); // Get the tester back to a resumed state for subsequent tests. await setAppLifeCycleState(AppLifecycleState.resumed); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); }); testWidgets('resetInternalState resets lifecycleState and framesEnabled to initial state', (WidgetTester tester) async { // Initial state expect(tester.binding.lifecycleState, isNull); expect(tester.binding.framesEnabled, isTrue); tester.binding.handleAppLifecycleStateChanged(AppLifecycleState.paused); expect(tester.binding.lifecycleState, AppLifecycleState.paused); expect(tester.binding.framesEnabled, isFalse); tester.binding.resetInternalState(); expect(tester.binding.lifecycleState, isNull); expect(tester.binding.framesEnabled, isTrue); }); testWidgets('scheduleFrameCallback error control test', (WidgetTester tester) async { late FlutterError error; try { tester.binding.scheduleFrameCallback((Duration _) { }, rescheduling: true); } on FlutterError catch (e) { error = e; } expect(error, isNotNull); expect(error.diagnostics.length, 3); expect(error.diagnostics.last.level, DiagnosticLevel.hint); expect( error.diagnostics.last.toStringDeep(), equalsIgnoringHashCodes( 'If this is the initial registration of the callback, or if the\n' 'callback is asynchronous, then do not use the "rescheduling"\n' 'argument.\n', ), ); expect( error.toStringDeep(), 'FlutterError\n' ' scheduleFrameCallback called with rescheduling true, but no\n' ' callback is in scope.\n' ' The "rescheduling" argument should only be set to true if the\n' ' callback is being reregistered from within the callback itself,\n' ' and only then if the callback itself is entirely synchronous.\n' ' If this is the initial registration of the callback, or if the\n' ' callback is asynchronous, then do not use the "rescheduling"\n' ' argument.\n', ); }); testWidgets('defaultStackFilter elides framework Element mounting stacks', (WidgetTester tester) async { final FlutterExceptionHandler? oldHandler = FlutterError.onError; late FlutterErrorDetails errorDetails; FlutterError.onError = (FlutterErrorDetails details) { errorDetails = details; }; await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: TestStatefulWidget( child: Builder( builder: (BuildContext context) { return Opacity( opacity: .5, child: Builder( builder: (BuildContext context) { assert(false); return const Text(''); }, ), ); }, ), ), )); FlutterError.onError = oldHandler; expect(errorDetails.exception, isAssertionError); const String toMatch = '... Normal element mounting ('; expect(toMatch.allMatches(errorDetails.toString()).length, 1); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87875 } class TestStatefulWidget extends StatefulWidget { const TestStatefulWidget({required this.child, super.key}); final Widget child; @override State<StatefulWidget> createState() => TestStatefulWidgetState(); } class TestStatefulWidgetState extends State<TestStatefulWidget> { @override Widget build(BuildContext context) { return widget.child; } }
flutter/packages/flutter/test/widgets/binding_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/binding_test.dart", "repo_id": "flutter", "token_count": 6145 }
757
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Comparing coordinates', (WidgetTester tester) async { final Key keyA = GlobalKey(); final Key keyB = GlobalKey(); await tester.pumpWidget( Stack( textDirection: TextDirection.ltr, children: <Widget>[ Positioned( top: 100.0, left: 100.0, child: SizedBox( key: keyA, width: 10.0, height: 10.0, ), ), Positioned( left: 100.0, top: 200.0, child: SizedBox( key: keyB, width: 20.0, height: 10.0, ), ), ], ), ); final RenderBox boxA = tester.renderObject(find.byKey(keyA)); expect(boxA.localToGlobal(Offset.zero), equals(const Offset(100.0, 100.0))); final RenderBox boxB = tester.renderObject(find.byKey(keyB)); expect(boxB.localToGlobal(Offset.zero), equals(const Offset(100.0, 200.0))); expect(boxB.globalToLocal(const Offset(110.0, 205.0)), equals(const Offset(10.0, 5.0))); }); }
flutter/packages/flutter/test/widgets/coordinates_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/coordinates_test.dart", "repo_id": "flutter", "token_count": 654 }
758
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { testWidgets('DisposableBuildContext asserts on disposed state', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); await tester.pumpWidget(TestWidget(key)); final TestWidgetState state = key.currentState!; expect(state.mounted, true); final DisposableBuildContext context = DisposableBuildContext(state); expect(context.context, state.context); await tester.pumpWidget(const TestWidget(null)); expect(state.mounted, false); expect(() => context.context, throwsAssertionError); context.dispose(); expect(context.context, null); expect(() => state.context, throwsFlutterError); expect(() => DisposableBuildContext(state), throwsAssertionError); }); testWidgets('DisposableBuildContext dispatches memory events', (WidgetTester tester) async { final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>(); await tester.pumpWidget(TestWidget(key)); final TestWidgetState state = key.currentState!; await expectLater( await memoryEvents( () => DisposableBuildContext<TestWidgetState>(state).dispose(), DisposableBuildContext<TestWidgetState>, ), areCreateAndDispose, ); }); } class TestWidget extends StatefulWidget { const TestWidget(Key? key) : super(key: key); @override State<TestWidget> createState() => TestWidgetState(); } class TestWidgetState extends State<TestWidget> { @override Widget build(BuildContext context) => const SizedBox(height: 50); }
flutter/packages/flutter/test/widgets/disposable_build_context_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/disposable_build_context_test.dart", "repo_id": "flutter", "token_count": 608 }
759
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Can size according to aspect ratio', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, child: FittedBox( key: outside, child: SizedBox( key: inside, width: 100.0, height: 50.0, ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 200.0); expect(outsideBox.size.height, 100.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 100.0); expect(insideBox.size.height, 50.0); final Offset insidePoint = insideBox.localToGlobal(const Offset(100.0, 50.0)); final Offset outsidePoint = outsideBox.localToGlobal(const Offset(200.0, 100.0)); expect(outsidePoint, equals(const Offset(500.0, 350.0))); expect(insidePoint, equals(outsidePoint)); }); testWidgets('Can contain child', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 200.0, child: FittedBox( key: outside, child: SizedBox( key: inside, width: 100.0, height: 50.0, ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 200.0); expect(outsideBox.size.height, 200.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 100.0); expect(insideBox.size.height, 50.0); final Offset insidePoint = insideBox.localToGlobal(const Offset(100.0, 0.0)); final Offset outsidePoint = outsideBox.localToGlobal(const Offset(200.0, 50.0)); expect(insidePoint, equals(outsidePoint)); }); testWidgets('Child can cover', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 200.0, child: FittedBox( key: outside, fit: BoxFit.cover, child: SizedBox( key: inside, width: 100.0, height: 50.0, ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 200.0); expect(outsideBox.size.height, 200.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 100.0); expect(insideBox.size.height, 50.0); final Offset insidePoint = insideBox.localToGlobal(const Offset(50.0, 25.0)); final Offset outsidePoint = outsideBox.localToGlobal(const Offset(100.0, 100.0)); expect(insidePoint, equals(outsidePoint)); }); testWidgets('FittedBox with no child', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget( Center( child: FittedBox( key: key, fit: BoxFit.cover, ), ), ); final RenderBox box = tester.firstRenderObject(find.byKey(key)); expect(box.size.width, 0.0); expect(box.size.height, 0.0); }); testWidgets('Child can be aligned multiple ways in a row', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); { // align RTL await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, child: Center( child: SizedBox( width: 100.0, height: 100.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, alignment: AlignmentDirectional.bottomEnd, child: SizedBox( key: inside, width: 10.0, height: 10.0, ), ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 100.0); expect(outsideBox.size.height, 100.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 10.0); expect(insideBox.size.height, 10.0); final Offset insideTopLeft = insideBox.localToGlobal(Offset.zero); final Offset outsideTopLeft = outsideBox.localToGlobal(const Offset(0.0, 90.0)); final Offset insideBottomRight = insideBox.localToGlobal(const Offset(10.0, 10.0)); final Offset outsideBottomRight = outsideBox.localToGlobal(const Offset(10.0, 100.0)); expect(insideTopLeft, equals(outsideTopLeft)); expect(insideBottomRight, equals(outsideBottomRight)); } { // change direction await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 100.0, height: 100.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, alignment: AlignmentDirectional.bottomEnd, child: SizedBox( key: inside, width: 10.0, height: 10.0, ), ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 100.0); expect(outsideBox.size.height, 100.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 10.0); expect(insideBox.size.height, 10.0); final Offset insideTopLeft = insideBox.localToGlobal(Offset.zero); final Offset outsideTopLeft = outsideBox.localToGlobal(const Offset(90.0, 90.0)); final Offset insideBottomRight = insideBox.localToGlobal(const Offset(10.0, 10.0)); final Offset outsideBottomRight = outsideBox.localToGlobal(const Offset(100.0, 100.0)); expect(insideTopLeft, equals(outsideTopLeft)); expect(insideBottomRight, equals(outsideBottomRight)); } { // change alignment await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 100.0, height: 100.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, alignment: AlignmentDirectional.center, child: SizedBox( key: inside, width: 10.0, height: 10.0, ), ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 100.0); expect(outsideBox.size.height, 100.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 10.0); expect(insideBox.size.height, 10.0); final Offset insideTopLeft = insideBox.localToGlobal(Offset.zero); final Offset outsideTopLeft = outsideBox.localToGlobal(const Offset(45.0, 45.0)); final Offset insideBottomRight = insideBox.localToGlobal(const Offset(10.0, 10.0)); final Offset outsideBottomRight = outsideBox.localToGlobal(const Offset(55.0, 55.0)); expect(insideTopLeft, equals(outsideTopLeft)); expect(insideBottomRight, equals(outsideBottomRight)); } { // change size await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 100.0, height: 100.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, alignment: AlignmentDirectional.center, child: SizedBox( key: inside, width: 30.0, height: 10.0, ), ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 100.0); expect(outsideBox.size.height, 100.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 30.0); expect(insideBox.size.height, 10.0); final Offset insideTopLeft = insideBox.localToGlobal(Offset.zero); final Offset outsideTopLeft = outsideBox.localToGlobal(const Offset(35.0, 45.0)); final Offset insideBottomRight = insideBox.localToGlobal(const Offset(30.0, 10.0)); final Offset outsideBottomRight = outsideBox.localToGlobal(const Offset(65.0, 55.0)); expect(insideTopLeft, equals(outsideTopLeft)); expect(insideBottomRight, equals(outsideBottomRight)); } { // change fit await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 100.0, height: 100.0, child: FittedBox( key: outside, fit: BoxFit.fill, alignment: AlignmentDirectional.center, child: SizedBox( key: inside, width: 30.0, height: 10.0, ), ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.width, 100.0); expect(outsideBox.size.height, 100.0); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(insideBox.size.width, 30.0); expect(insideBox.size.height, 10.0); final Offset insideTopLeft = insideBox.localToGlobal(Offset.zero); final Offset outsideTopLeft = outsideBox.localToGlobal(Offset.zero); final Offset insideBottomRight = insideBox.localToGlobal(const Offset(30.0, 10.0)); final Offset outsideBottomRight = outsideBox.localToGlobal(const Offset(100.0, 100.0)); expect(insideTopLeft, equals(outsideTopLeft)); expect(insideBottomRight, equals(outsideBottomRight)); } }); testWidgets('FittedBox layers - contain', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( width: 100.0, height: 10.0, child: FittedBox( child: SizedBox( width: 50.0, height: 50.0, child: RepaintBoundary( child: Placeholder(), ), ), ), ), ), ); expect(getLayers(), <Type>[TransformLayer, TransformLayer, OffsetLayer]); }); testWidgets('FittedBox layers - cover - horizontal', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( width: 100.0, height: 10.0, child: FittedBox( fit: BoxFit.cover, clipBehavior: Clip.hardEdge, child: SizedBox( width: 10.0, height: 50.0, child: RepaintBoundary( child: Placeholder(), ), ), ), ), ), ); expect(getLayers(), <Type>[TransformLayer, ClipRectLayer, TransformLayer, OffsetLayer]); }); testWidgets('FittedBox layers - cover - vertical', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( width: 10.0, height: 100.0, child: FittedBox( fit: BoxFit.cover, clipBehavior: Clip.hardEdge, child: SizedBox( width: 50.0, height: 10.0, child: RepaintBoundary( child: Placeholder(), ), ), ), ), ), ); expect(getLayers(), <Type>[TransformLayer, ClipRectLayer, TransformLayer, OffsetLayer]); }); testWidgets('FittedBox layers - none - clip', (WidgetTester tester) async { final List<double> values = <double>[10.0, 50.0, 100.0]; for (final double a in values) { for (final double b in values) { for (final double c in values) { for (final double d in values) { await tester.pumpWidget( Center( child: SizedBox( width: a, height: b, child: FittedBox( fit: BoxFit.none, clipBehavior: Clip.hardEdge, child: SizedBox( width: c, height: d, child: const RepaintBoundary( child: Placeholder(), ), ), ), ), ), ); if (a < c || b < d) { expect(getLayers(), <Type>[TransformLayer, ClipRectLayer, OffsetLayer]); } else { expect(getLayers(), <Type>[TransformLayer, OffsetLayer]); } } } } } }); testWidgets('Big child into small fitted box - hit testing', (WidgetTester tester) async { final GlobalKey key1 = GlobalKey(); bool pointerDown = false; await tester.pumpWidget( Center( child: SizedBox( width: 100.0, height: 100.0, child: FittedBox( alignment: FractionalOffset.center, child: SizedBox( width: 1000.0, height: 1000.0, child: Listener( onPointerDown: (PointerDownEvent event) { pointerDown = true; }, child: Container( key: key1, color: const Color(0xFF000000), ), ), ), ), ), ), ); expect(pointerDown, isFalse); await tester.tap(find.byKey(key1)); expect(pointerDown, isTrue); }); testWidgets('Can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(FittedBox(fit: BoxFit.none, child: Container())); final RenderFittedBox renderObject = tester.allRenderObjects.whereType<RenderFittedBox>().first; expect(renderObject.clipBehavior, equals(Clip.none)); await tester.pumpWidget(FittedBox(fit: BoxFit.none, clipBehavior: Clip.antiAlias, child: Container())); expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); testWidgets('BoxFit.scaleDown matches size of child', (WidgetTester tester) async { final Key outside = UniqueKey(); final Key inside = UniqueKey(); // Does not scale up when child is smaller than constraints await tester.pumpWidget( Center( child: SizedBox( width: 200.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, child: SizedBox( key: inside, width: 100.0, height: 50.0, ), ), ), ), ); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); final RenderBox insideBox = tester.firstRenderObject(find.byKey(inside)); expect(outsideBox.size.width, 200.0); expect(outsideBox.size.height, 50.0); Offset outsidePoint = outsideBox.localToGlobal(Offset.zero); Offset insidePoint = insideBox.localToGlobal(Offset.zero); expect(insidePoint - outsidePoint, equals(const Offset(50.0, 0.0))); // Scales down when child is bigger than constraints await tester.pumpWidget( Center( child: SizedBox( width: 200.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, child: SizedBox( key: inside, width: 400.0, height: 200.0, ), ), ), ), ); expect(outsideBox.size.width, 200.0); expect(outsideBox.size.height, 100.0); outsidePoint = outsideBox.localToGlobal(Offset.zero); insidePoint = insideBox.localToGlobal(Offset.zero); expect(insidePoint - outsidePoint, equals(Offset.zero)); }); testWidgets('Switching to and from BoxFit.scaleDown causes relayout', (WidgetTester tester) async { final Key outside = UniqueKey(); final Widget scaleDownWidget = Center( child: SizedBox( width: 200.0, child: FittedBox( key: outside, fit: BoxFit.scaleDown, child: const SizedBox( width: 100.0, height: 50.0, ), ), ), ); final Widget coverWidget = Center( child: SizedBox( width: 200.0, child: FittedBox( key: outside, child: const SizedBox( width: 100.0, height: 50.0, ), ), ), ); await tester.pumpWidget(scaleDownWidget); final RenderBox outsideBox = tester.firstRenderObject(find.byKey(outside)); expect(outsideBox.size.height, 50.0); await tester.pumpWidget(coverWidget); expect(outsideBox.size.height, 100.0); await tester.pumpWidget(scaleDownWidget); expect(outsideBox.size.height, 50.0); }); testWidgets('FittedBox without child does not throw', (WidgetTester tester) async { await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 200.0, child: FittedBox(), ), ), ); expect(find.byType(FittedBox), findsOneWidget); // Tapping it also should not throw. await tester.tap(find.byType(FittedBox), warnIfMissed: false); expect(tester.takeException(), isNull); }); } List<Type> getLayers() { final List<Type> layers = <Type>[]; Layer? container = RendererBinding.instance.renderView.debugLayer; while (container is ContainerLayer) { layers.add(container.runtimeType); expect(container.firstChild, same(container.lastChild)); container = container.firstChild; } return layers; }
flutter/packages/flutter/test/widgets/fitted_box_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/fitted_box_test.dart", "repo_id": "flutter", "token_count": 8925 }
760
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Empty GridView', (WidgetTester tester) async { final List<Widget> children = <Widget>[ const DecoratedBox(decoration: BoxDecoration()), const DecoratedBox(decoration: BoxDecoration()), const DecoratedBox(decoration: BoxDecoration()), const DecoratedBox(decoration: BoxDecoration()), ]; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 200.0, child: GridView.extent( maxCrossAxisExtent: 100.0, shrinkWrap: true, children: children, ), ), ), ), ); expect(tester.renderObjectList<RenderBox>(find.byType(DecoratedBox)), hasLength(4)); for (final RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) { expect(box.size.width, equals(100.0), reason: 'child width'); expect(box.size.height, equals(100.0), reason: 'child height'); } final RenderBox grid = tester.renderObject(find.byType(GridView)); expect(grid.size.width, equals(200.0), reason: 'grid width'); expect(grid.size.height, equals(200.0), reason: 'grid height'); expect(grid.debugNeedsLayout, false); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 200.0, child: GridView.extent( maxCrossAxisExtent: 60.0, shrinkWrap: true, children: children, ), ), ), ), ); for (final RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) { expect(box.size.width, equals(50.0), reason: 'child width'); expect(box.size.height, equals(50.0), reason: 'child height'); } expect(grid.size.width, equals(200.0), reason: 'grid width'); expect(grid.size.height, equals(50.0), reason: 'grid height'); }); }
flutter/packages/flutter/test/widgets/grid_view_layout_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/grid_view_layout_test.dart", "repo_id": "flutter", "token_count": 975 }
761
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is run as part of a reduced test set in CI on Mac and Windows // machines. @Tags(<String>['reduced-test-set']) library; import 'dart:async'; import 'dart:io'; import 'dart:math' as math; import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; import '../image_data.dart'; import 'semantics_tester.dart'; void main() { late int originalCacheSize; late ui.Image image10x10; setUp(() async { originalCacheSize = imageCache.maximumSize; imageCache.clear(); imageCache.clearLiveImages(); image10x10 = await createTestImage(width: 10, height: 10); }); tearDown(() { imageCache.maximumSize = originalCacheSize; }); testWidgets('Verify Image does not use disposed handles', (WidgetTester tester) async { final ui.Image image100x100 = (await tester.runAsync(() async => createTestImage(width: 100, height: 100)))!; final _TestImageProvider imageProvider1 = _TestImageProvider(); final _TestImageProvider imageProvider2 = _TestImageProvider(); final ValueNotifier<_TestImageProvider> imageListenable = ValueNotifier<_TestImageProvider>(imageProvider1); addTearDown(imageListenable.dispose); final ValueNotifier<int> innerListenable = ValueNotifier<int>(0); addTearDown(innerListenable.dispose); bool imageLoaded = false; await tester.pumpWidget(ValueListenableBuilder<_TestImageProvider>( valueListenable: imageListenable, builder: (BuildContext context, _TestImageProvider image, Widget? child) => Image( image: image, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { if (frame == 0) { imageLoaded = true; } return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) => ValueListenableBuilder<int>( valueListenable: innerListenable, builder: (BuildContext context, int value, Widget? valueListenableChild) => KeyedSubtree( key: UniqueKey(), child: child, ), ), ); }, ), )); imageLoaded = false; imageProvider1.complete(image10x10); await tester.idle(); await tester.pump(); expect(imageLoaded, true); imageLoaded = false; imageListenable.value = imageProvider2; innerListenable.value += 1; imageProvider2.complete(image100x100); await tester.idle(); await tester.pump(); expect(imageLoaded, true); }); testWidgets('Verify Image resets its RenderImage when changing providers', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageProvider imageProvider1 = _TestImageProvider(); await tester.pumpWidget( Container( key: key, child: Image( image: imageProvider1, excludeFromSemantics: true, ), ), phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); imageProvider1.complete(image10x10); await tester.idle(); // resolve the future from the image provider await tester.pump(null, EnginePhase.layout); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); final _TestImageProvider imageProvider2 = _TestImageProvider(); await tester.pumpWidget( Container( key: key, child: Image( image: imageProvider2, excludeFromSemantics: true, ), ), phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); }); testWidgets("Verify Image doesn't reset its RenderImage when changing providers if it has gaplessPlayback set", (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageProvider imageProvider1 = _TestImageProvider(); await tester.pumpWidget( Container( key: key, child: Image( gaplessPlayback: true, image: imageProvider1, excludeFromSemantics: true, ), ), phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); imageProvider1.complete(image10x10); await tester.idle(); // resolve the future from the image provider await tester.pump(null, EnginePhase.layout); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); final _TestImageProvider imageProvider2 = _TestImageProvider(); await tester.pumpWidget( Container( key: key, child: Image( gaplessPlayback: true, image: imageProvider2, excludeFromSemantics: true, ), ), phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); }); testWidgets('Verify Image resets its RenderImage when changing providers if it has a key', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageProvider imageProvider1 = _TestImageProvider(); await tester.pumpWidget( Image( key: key, image: imageProvider1, excludeFromSemantics: true, ), phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); imageProvider1.complete(image10x10); await tester.idle(); // resolve the future from the image provider await tester.pump(null, EnginePhase.layout); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); final _TestImageProvider imageProvider2 = _TestImageProvider(); await tester.pumpWidget( Image( key: key, image: imageProvider2, excludeFromSemantics: true, ), phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); }); testWidgets("Verify Image doesn't reset its RenderImage when changing providers if it has gaplessPlayback set", (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageProvider imageProvider1 = _TestImageProvider(); await tester.pumpWidget( Image( key: key, gaplessPlayback: true, image: imageProvider1, excludeFromSemantics: true, ), phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); imageProvider1.complete(image10x10); await tester.idle(); // resolve the future from the image provider await tester.pump(null, EnginePhase.layout); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); final _TestImageProvider imageProvider2 = _TestImageProvider(); await tester.pumpWidget( Image( key: key, gaplessPlayback: true, excludeFromSemantics: true, image: imageProvider2, ), phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); }); testWidgets('Verify ImageProvider configuration inheritance', (WidgetTester tester) async { final GlobalKey mediaQueryKey1 = GlobalKey(debugLabel: 'mediaQueryKey1'); final GlobalKey mediaQueryKey2 = GlobalKey(debugLabel: 'mediaQueryKey2'); final GlobalKey imageKey = GlobalKey(debugLabel: 'image'); final _ConfigurationKeyedTestImageProvider imageProvider = _ConfigurationKeyedTestImageProvider(); final Set<Object> seenKeys = <Object>{}; final _DebouncingImageProvider debouncingProvider = _DebouncingImageProvider(imageProvider, seenKeys); // Of the two nested MediaQuery objects, the innermost one, // mediaQuery2, should define the configuration of the imageProvider. await tester.pumpWidget( MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 5.0); // This is the same widget hierarchy as before except that the // two MediaQuery objects have exchanged places. The imageProvider // should be resolved again, with the new innermost MediaQuery. await tester.pumpWidget( MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 10.0); }); testWidgets('Verify ImageProvider configuration inheritance again', (WidgetTester tester) async { final GlobalKey mediaQueryKey1 = GlobalKey(debugLabel: 'mediaQueryKey1'); final GlobalKey mediaQueryKey2 = GlobalKey(debugLabel: 'mediaQueryKey2'); final GlobalKey imageKey = GlobalKey(debugLabel: 'image'); final _ConfigurationKeyedTestImageProvider imageProvider = _ConfigurationKeyedTestImageProvider(); final Set<Object> seenKeys = <Object>{}; final _DebouncingImageProvider debouncingProvider = _DebouncingImageProvider(imageProvider, seenKeys); // This is just a variation on the previous test. In this version the location // of the Image changes and the MediaQuery widgets do not. await tester.pumpWidget( Row( textDirection: TextDirection.ltr, children: <Widget> [ MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: Container(width: 100.0), ), ], ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 5.0); await tester.pumpWidget( Row( textDirection: TextDirection.ltr, children: <Widget> [ MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: Container(width: 100.0), ), MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), ], ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 10.0); }); testWidgets('Verify ImageProvider does not inherit configuration when it does not key to it', (WidgetTester tester) async { final GlobalKey mediaQueryKey1 = GlobalKey(debugLabel: 'mediaQueryKey1'); final GlobalKey mediaQueryKey2 = GlobalKey(debugLabel: 'mediaQueryKey2'); final GlobalKey imageKey = GlobalKey(debugLabel: 'image'); final _TestImageProvider imageProvider = _TestImageProvider(); final Set<Object> seenKeys = <Object>{}; final _DebouncingImageProvider debouncingProvider = _DebouncingImageProvider(imageProvider, seenKeys); // Of the two nested MediaQuery objects, the innermost one, // mediaQuery2, should define the configuration of the imageProvider. await tester.pumpWidget( MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 5.0); // This is the same widget hierarchy as before except that the // two MediaQuery objects have exchanged places. The imageProvider // should not be resolved again, because it does not key to configuration. await tester.pumpWidget( MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 5.0); }); testWidgets('Verify ImageProvider does not inherit configuration when it does not key to it again', (WidgetTester tester) async { final GlobalKey mediaQueryKey1 = GlobalKey(debugLabel: 'mediaQueryKey1'); final GlobalKey mediaQueryKey2 = GlobalKey(debugLabel: 'mediaQueryKey2'); final GlobalKey imageKey = GlobalKey(debugLabel: 'image'); final _TestImageProvider imageProvider = _TestImageProvider(); final Set<Object> seenKeys = <Object>{}; final _DebouncingImageProvider debouncingProvider = _DebouncingImageProvider(imageProvider, seenKeys); // This is just a variation on the previous test. In this version the location // of the Image changes and the MediaQuery widgets do not. await tester.pumpWidget( Row( textDirection: TextDirection.ltr, children: <Widget> [ MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: Container(width: 100.0), ), ], ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 5.0); await tester.pumpWidget( Row( textDirection: TextDirection.ltr, children: <Widget> [ MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, ), child: Container(width: 100.0), ), MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, ), child: Image( excludeFromSemantics: true, key: imageKey, image: debouncingProvider, ), ), ], ), ); expect(imageProvider._lastResolvedConfiguration.devicePixelRatio, 5.0); }); testWidgets('Verify Image stops listening to ImageStream', (WidgetTester tester) async { final ui.Image image100x100 = (await tester.runAsync(() async => createTestImage(width: 100, height: 100)))!; // Web does not override the toString, whereas VM does final String imageString = image100x100.toString(); final _TestImageProvider imageProvider = _TestImageProvider(); await tester.pumpWidget(Image(image: imageProvider, excludeFromSemantics: true)); final State<Image> image = tester.state/*State<Image>*/(find.byType(Image)); expect(image.toString(), equalsIgnoringHashCodes('_ImageState#00000(stream: ImageStream#00000(OneFrameImageStreamCompleter#00000, unresolved, 2 listeners, 0 ephemeralErrorListeners), pixels: null, loadingProgress: null, frameNumber: null, wasSynchronouslyLoaded: false)')); imageProvider.complete(image100x100); await tester.pump(); expect(image.toString(), equalsIgnoringHashCodes('_ImageState#00000(stream: ImageStream#00000(OneFrameImageStreamCompleter#00000, $imageString @ 1.0x, 1 listener, 0 ephemeralErrorListeners), pixels: $imageString @ 1.0x, loadingProgress: null, frameNumber: 0, wasSynchronouslyLoaded: false)')); await tester.pumpWidget(Container()); expect(image.toString(), equalsIgnoringHashCodes('_ImageState#00000(lifecycle state: defunct, not mounted, stream: ImageStream#00000(OneFrameImageStreamCompleter#00000, $imageString @ 1.0x, 0 listeners, 0 ephemeralErrorListeners), pixels: null, loadingProgress: null, frameNumber: 0, wasSynchronouslyLoaded: false)')); }); testWidgets('Stream completer errors can be listened to by attaching before resolving', (WidgetTester tester) async { dynamic capturedException; StackTrace? capturedStackTrace; ImageInfo? capturedImage; void errorListener(dynamic exception, StackTrace? stackTrace) { capturedException = exception; capturedStackTrace = stackTrace; } void listener(ImageInfo info, bool synchronous) { capturedImage = info; } final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); late ImageConfiguration configuration; await tester.pumpWidget( Builder( builder: (BuildContext context) { configuration = createLocalImageConfiguration(context); return Container(); }, ), ); imageProvider.resolve(configuration); imageProvider.fail(testException, testStack); expect(tester.binding.microtaskCount, 1); await tester.idle(); // Let the failed completer's future hit the stream completer. expect(tester.binding.microtaskCount, 0); expect(capturedImage, isNull); // The image stream listeners should never be called. // The image stream error handler should have the original exception. expect(capturedException, testException); expect(capturedStackTrace, testStack); // If there is an error listener, there should be no FlutterError reported. expect(tester.takeException(), isNull); }); testWidgets('Stream completer errors can be listened to by attaching after resolving', (WidgetTester tester) async { dynamic capturedException; StackTrace? capturedStackTrace; dynamic reportedException; StackTrace? reportedStackTrace; ImageInfo? capturedImage; void errorListener(dynamic exception, StackTrace? stackTrace) { capturedException = exception; capturedStackTrace = stackTrace; } void listener(ImageInfo info, bool synchronous) { capturedImage = info; } FlutterError.onError = (FlutterErrorDetails flutterError) { reportedException = flutterError.exception; reportedStackTrace = flutterError.stack; }; final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); late ImageConfiguration configuration; await tester.pumpWidget( Builder( builder: (BuildContext context) { configuration = createLocalImageConfiguration(context); return Container(); }, ), ); final ImageStream streamUnderTest = imageProvider.resolve(configuration); imageProvider.fail(testException, testStack); expect(tester.binding.microtaskCount, 1); await tester.idle(); // Let the failed completer's future hit the stream completer. expect(tester.binding.microtaskCount, 0); // Since there's no listeners attached yet, report error up via // FlutterError. expect(reportedException, testException); expect(reportedStackTrace, testStack); streamUnderTest.addListener(ImageStreamListener(listener, onError: errorListener)); expect(capturedImage, isNull); // The image stream listeners should never be called. // The image stream error handler should have the original exception. expect(capturedException, testException); expect(capturedStackTrace, testStack); }); testWidgets('Duplicate listener registration does not affect error listeners', (WidgetTester tester) async { dynamic capturedException; StackTrace? capturedStackTrace; ImageInfo? capturedImage; void errorListener(dynamic exception, StackTrace? stackTrace) { capturedException = exception; capturedStackTrace = stackTrace; } void listener(ImageInfo info, bool synchronous) { capturedImage = info; } final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); // Add the exact same listener a second time without the errorListener. imageProvider._streamCompleter.addListener(ImageStreamListener(listener)); late ImageConfiguration configuration; await tester.pumpWidget( Builder( builder: (BuildContext context) { configuration = createLocalImageConfiguration(context); return Container(); }, ), ); imageProvider.resolve(configuration); imageProvider.fail(testException, testStack); expect(tester.binding.microtaskCount, 1); await tester.idle(); // Let the failed completer's future hit the stream completer. expect(tester.binding.microtaskCount, 0); expect(capturedImage, isNull); // The image stream listeners should never be called. // The image stream error handler should have the original exception. expect(capturedException, testException); expect(capturedStackTrace, testStack); // If there is an error listener, there should be no FlutterError reported. expect(tester.takeException(), isNull); }); testWidgets('Duplicate error listeners are all called', (WidgetTester tester) async { dynamic capturedException; StackTrace? capturedStackTrace; ImageInfo? capturedImage; int errorListenerCalled = 0; void errorListener(dynamic exception, StackTrace? stackTrace) { capturedException = exception; capturedStackTrace = stackTrace; errorListenerCalled++; } void listener(ImageInfo info, bool synchronous) { capturedImage = info; } final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); // Add the exact same errorListener a second time. imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); late ImageConfiguration configuration; await tester.pumpWidget( Builder( builder: (BuildContext context) { configuration = createLocalImageConfiguration(context); return Container(); }, ), ); imageProvider.resolve(configuration); imageProvider.fail(testException, testStack); expect(tester.binding.microtaskCount, 1); await tester.idle(); // Let the failed completer's future hit the stream completer. expect(tester.binding.microtaskCount, 0); expect(capturedImage, isNull); // The image stream listeners should never be called. // The image stream error handler should have the original exception. expect(capturedException, testException); expect(capturedStackTrace, testStack); expect(errorListenerCalled, 2); // If there is an error listener, there should be no FlutterError reported. expect(tester.takeException(), isNull); }); testWidgets('Listeners are only removed if callback tuple matches', (WidgetTester tester) async { bool errorListenerCalled = false; dynamic reportedException; StackTrace? reportedStackTrace; ImageInfo? capturedImage; void errorListener(dynamic exception, StackTrace? stackTrace) { errorListenerCalled = true; reportedException = exception; reportedStackTrace = stackTrace; } void listener(ImageInfo info, bool synchronous) { capturedImage = info; } final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); // Now remove the listener the error listener is attached to. // Don't explicitly remove the error listener. imageProvider._streamCompleter.removeListener(ImageStreamListener(listener)); late ImageConfiguration configuration; await tester.pumpWidget( Builder( builder: (BuildContext context) { configuration = createLocalImageConfiguration(context); return Container(); }, ), ); imageProvider.resolve(configuration); imageProvider.fail(testException, testStack); expect(tester.binding.microtaskCount, 1); await tester.idle(); // Let the failed completer's future hit the stream completer. expect(tester.binding.microtaskCount, 0); expect(errorListenerCalled, true); expect(reportedException, testException); expect(reportedStackTrace, testStack); expect(capturedImage, isNull); // The image stream listeners should never be called. }); testWidgets('Removing listener removes one listener and error listener', (WidgetTester tester) async { int errorListenerCalled = 0; ImageInfo? capturedImage; void errorListener(dynamic exception, StackTrace? stackTrace) { errorListenerCalled++; } void listener(ImageInfo info, bool synchronous) { capturedImage = info; } final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); // Duplicates the same set of listener and errorListener. imageProvider._streamCompleter.addListener(ImageStreamListener(listener, onError: errorListener)); // Now remove one entry of the specified listener and associated error listener. // Don't explicitly remove the error listener. imageProvider._streamCompleter.removeListener(ImageStreamListener(listener, onError: errorListener)); late ImageConfiguration configuration; await tester.pumpWidget( Builder( builder: (BuildContext context) { configuration = createLocalImageConfiguration(context); return Container(); }, ), ); imageProvider.resolve(configuration); imageProvider.fail(testException, testStack); expect(tester.binding.microtaskCount, 1); await tester.idle(); // Let the failed completer's future hit the stream completer. expect(tester.binding.microtaskCount, 0); expect(errorListenerCalled, 1); expect(capturedImage, isNull); // The image stream listeners should never be called. }); testWidgets('Image.memory control test', (WidgetTester tester) async { await tester.pumpWidget(Image.memory(Uint8List.fromList(kTransparentImage), excludeFromSemantics: true)); }); testWidgets('Image color and colorBlend parameters', (WidgetTester tester) async { await tester.pumpWidget( Image( excludeFromSemantics: true, image: _TestImageProvider(), color: const Color(0xFF00FF00), colorBlendMode: BlendMode.clear, ), ); final RenderImage renderer = tester.renderObject<RenderImage>(find.byType(Image)); expect(renderer.color, const Color(0xFF00FF00)); expect(renderer.colorBlendMode, BlendMode.clear); }); testWidgets('Image opacity parameter', (WidgetTester tester) async { const Animation<double> opacity = AlwaysStoppedAnimation<double>(0.5); await tester.pumpWidget( Image( excludeFromSemantics: true, image: _TestImageProvider(), opacity: opacity, ), ); final RenderImage renderer = tester.renderObject<RenderImage>(find.byType(Image)); expect(renderer.opacity, opacity); }); testWidgets('Precache', (WidgetTester tester) async { final _TestImageProvider provider = _TestImageProvider(); late Future<void> precache; await tester.pumpWidget( Builder( builder: (BuildContext context) { precache = precacheImage(provider, context); return Container(); }, ), ); provider.complete(image10x10); await precache; expect(provider._lastResolvedConfiguration, isNotNull); // Check that a second resolve of the same image is synchronous. final ImageStream stream = provider.resolve(provider._lastResolvedConfiguration); late bool isSync; stream.addListener(ImageStreamListener((ImageInfo image, bool sync) { image.dispose(); isSync = sync; })); expect(isSync, isTrue); }); testWidgets('Precache removes original listener immediately after future completes, does not crash on successive calls #25143', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter(); final _TestImageProvider provider = _TestImageProvider(streamCompleter: imageStreamCompleter); await tester.pumpWidget( Builder( builder: (BuildContext context) { precacheImage(provider, context); return Container(); }, ), ); // Two listeners - one is the listener added by precacheImage, the other by the ImageCache. final List<ImageStreamListener> listeners = imageStreamCompleter.listeners.toList(); expect(listeners.length, 2); // Make sure the first listener can be called re-entrantly final ImageInfo imageInfo = ImageInfo(image: image10x10); listeners[1].onImage(imageInfo.clone(), false); listeners[1].onImage(imageInfo.clone(), false); // Make sure the second listener can be called re-entrantly. listeners[0].onImage(imageInfo.clone(), false); listeners[0].onImage(imageInfo.clone(), false); }); testWidgets('Precache completes with onError on error', (WidgetTester tester) async { dynamic capturedException; StackTrace? capturedStackTrace; void errorListener(dynamic exception, StackTrace? stackTrace) { capturedException = exception; capturedStackTrace = stackTrace; } final Exception testException = Exception('cannot resolve host'); final StackTrace testStack = StackTrace.current; final _TestImageProvider imageProvider = _TestImageProvider(); late Future<void> precache; await tester.pumpWidget( Builder( builder: (BuildContext context) { precache = precacheImage(imageProvider, context, onError: errorListener); return Container(); }, ), ); imageProvider.fail(testException, testStack); await precache; // The image stream error handler should have the original exception. expect(capturedException, testException); expect(capturedStackTrace, testStack); // If there is an error listener, there should be no FlutterError reported. expect(tester.takeException(), isNull); }); testWidgets('TickerMode controls stream registration', (WidgetTester tester) async { final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter(); final Image image = Image( excludeFromSemantics: true, image: _TestImageProvider(streamCompleter: imageStreamCompleter), ); await tester.pumpWidget( TickerMode( enabled: true, child: image, ), ); expect(imageStreamCompleter.listeners.length, 2); await tester.pumpWidget( TickerMode( enabled: false, child: image, ), ); expect(imageStreamCompleter.listeners.length, 1); }); testWidgets('Verify Image shows correct RenderImage when changing to an already completed provider', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageProvider imageProvider1 = _TestImageProvider(); final _TestImageProvider imageProvider2 = _TestImageProvider(); final ui.Image image100x100 = (await tester.runAsync(() async => createTestImage(width: 100, height: 100)))!; await tester.pumpWidget( Container( key: key, child: Image( excludeFromSemantics: true, image: imageProvider1, ), ), phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); imageProvider1.complete(image10x10); imageProvider2.complete(image100x100); await tester.idle(); // resolve the future from the image provider await tester.pump(null, EnginePhase.layout); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); final ui.Image oldImage = renderImage.image!; await tester.pumpWidget( Container( key: key, child: Image( excludeFromSemantics: true, image: imageProvider2, ), ), phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNotNull); expect(renderImage.image, isNot(equals(oldImage))); }); testWidgets('Image State can be reconfigured to use another image', (WidgetTester tester) async { final Image image1 = Image(image: _TestImageProvider()..complete(image10x10.clone()), width: 10.0, excludeFromSemantics: true); final Image image2 = Image(image: _TestImageProvider()..complete(image10x10.clone()), width: 20.0, excludeFromSemantics: true); final Column column = Column(children: <Widget>[image1, image2]); await tester.pumpWidget(column, phase:EnginePhase.layout); final Column columnSwapped = Column(children: <Widget>[image2, image1]); await tester.pumpWidget(columnSwapped, phase: EnginePhase.layout); final List<RenderImage> renderObjects = tester.renderObjectList<RenderImage>(find.byType(Image)).toList(); expect(renderObjects, hasLength(2)); expect(renderObjects[0].image, isNotNull); expect(renderObjects[0].width, 20.0); expect(renderObjects[1].image, isNotNull); expect(renderObjects[1].width, 10.0); }); testWidgets('Image contributes semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Row( children: <Widget>[ Image( image: _TestImageProvider(), width: 100.0, height: 100.0, semanticLabel: 'test', ), ], ), ), ); expect(semantics, hasSemantics(TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( id: 1, label: 'test', rect: const Rect.fromLTWH(0.0, 0.0, 100.0, 100.0), textDirection: TextDirection.ltr, flags: <SemanticsFlag>[SemanticsFlag.isImage], ), ], ), ignoreTransform: true)); semantics.dispose(); }); testWidgets('Image can exclude semantics', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Image( image: _TestImageProvider(), width: 100.0, height: 100.0, excludeFromSemantics: true, ), ), ); expect(semantics, hasSemantics(TestSemantics.root( children: <TestSemantics>[], ))); semantics.dispose(); }); testWidgets('Image invokes frameBuilder with correct frameNumber argument', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final ui.Codec codec = (await tester.runAsync(() { return ui.instantiateImageCodec(Uint8List.fromList(kAnimatedGif)); }))!; Future<ui.Image> nextFrame() async { final ui.FrameInfo frameInfo = (await tester.runAsync(codec.getNextFrame))!; return frameInfo.image; } final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); int? lastFrame; await tester.pumpWidget( Image( image: imageProvider, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { lastFrame = frame; return Center(child: child); }, ), ); expect(lastFrame, isNull); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); await tester.pump(); expect(lastFrame, 0); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); await tester.pump(); expect(lastFrame, 1); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); }); testWidgets('Image invokes frameBuilder with correct wasSynchronouslyLoaded=false', (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); int? lastFrame; late bool lastFrameWasSync; await tester.pumpWidget( Image( image: imageProvider, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { lastFrame = frame; lastFrameWasSync = wasSynchronouslyLoaded; return child; }, ), ); expect(lastFrame, isNull); expect(lastFrameWasSync, isFalse); expect(find.byType(RawImage), findsOneWidget); final ImageInfo info = ImageInfo(image: image10x10); addTearDown(info.dispose); streamCompleter.setData(imageInfo: info); await tester.pump(); expect(lastFrame, 0); expect(lastFrameWasSync, isFalse); }); testWidgets('Image invokes frameBuilder with correct wasSynchronouslyLoaded=true', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(ImageInfo(image: image10x10.clone())); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); int? lastFrame; late bool lastFrameWasSync; await tester.pumpWidget( Image( image: imageProvider, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { lastFrame = frame; lastFrameWasSync = wasSynchronouslyLoaded; return child; }, ), ); expect(lastFrame, 0); expect(lastFrameWasSync, isTrue); expect(find.byType(RawImage), findsOneWidget); streamCompleter.setData(imageInfo: ImageInfo(image: image10x10.clone())); await tester.pump(); expect(lastFrame, 1); expect(lastFrameWasSync, isTrue); }); testWidgets('Image state handles frameBuilder update', (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Image( image: imageProvider, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { return Center(child: child); }, ), ); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); final State<Image> state = tester.state(find.byType(Image)); await tester.pumpWidget( Image( image: imageProvider, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { return Padding(padding: const EdgeInsets.all(1), child: child); }, ), ); expect(find.byType(Center), findsNothing); expect(find.byType(Padding), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); expect(tester.state(find.byType(Image)), same(state)); }); testWidgets('Image state handles enabling and disabling of tickers', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final ui.Codec codec = (await tester.runAsync(() { return ui.instantiateImageCodec(Uint8List.fromList(kAnimatedGif)); }))!; Future<ui.Image> nextFrame() async { final ui.FrameInfo frameInfo = (await tester.runAsync(codec.getNextFrame))!; return frameInfo.image; } final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); int? lastFrame; int buildCount = 0; Widget buildFrame(BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { lastFrame = frame; buildCount++; return child; } await tester.pumpWidget( TickerMode( enabled: true, child: Image( image: imageProvider, frameBuilder: buildFrame, ), ), ); final State<Image> state = tester.state(find.byType(Image)); expect(lastFrame, isNull); expect(buildCount, 1); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); await tester.pump(); expect(lastFrame, 0); expect(buildCount, 2); await tester.pumpWidget( TickerMode( enabled: false, child: Image( image: imageProvider, frameBuilder: buildFrame, ), ), ); expect(tester.state(find.byType(Image)), same(state)); expect(lastFrame, 0); expect(buildCount, 3); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); await tester.pump(); expect(lastFrame, 0); expect(buildCount, 3); await tester.pumpWidget( TickerMode( enabled: true, child: Image( image: imageProvider, frameBuilder: buildFrame, ), ), ); expect(tester.state(find.byType(Image)), same(state)); expect(lastFrame, 1); // missed a frame because we weren't animating at the time expect(buildCount, 4); }); testWidgets('Image invokes loadingBuilder on chunk event notification', (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); final List<ImageChunkEvent?> chunkEvents = <ImageChunkEvent?>[]; await tester.pumpWidget( Image( image: imageProvider, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { chunkEvents.add(loadingProgress); if (loadingProgress == null) { return child; } return Directionality( textDirection: TextDirection.ltr, child: Text('loading ${loadingProgress.cumulativeBytesLoaded} / ${loadingProgress.expectedTotalBytes}'), ); }, ), ); expect(chunkEvents.length, 1); expect(chunkEvents.first, isNull); expect(tester.binding.hasScheduledFrame, isFalse); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); expect(chunkEvents.length, 2); expect(find.text('loading 10 / 100'), findsOneWidget); expect(find.byType(RawImage), findsNothing); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 30, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); expect(chunkEvents.length, 3); expect(find.text('loading 30 / 100'), findsOneWidget); expect(find.byType(RawImage), findsNothing); final ImageInfo info = ImageInfo(image: image10x10); addTearDown(info.dispose); streamCompleter.setData(imageInfo: info); await tester.pump(); expect(chunkEvents.length, 4); expect(find.byType(Text), findsNothing); expect(find.byType(RawImage), findsOneWidget); }); testWidgets("Image doesn't rebuild on chunk events if loadingBuilder is null", (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Image( image: imageProvider, excludeFromSemantics: true, ), ); expect(tester.binding.hasScheduledFrame, isFalse); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isFalse); final ImageInfo info = ImageInfo(image: image10x10); addTearDown(info.dispose); streamCompleter.setData(imageInfo: info); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isFalse); expect(find.byType(RawImage), findsOneWidget); }); testWidgets('Image chains the results of frameBuilder and loadingBuilder', (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Image( image: imageProvider, excludeFromSemantics: true, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { return Padding(padding: const EdgeInsets.all(1), child: child); }, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { return Center(child: child); }, ), ); expect(find.byType(Center), findsOneWidget); expect(find.byType(Padding), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); expect(tester.widget<Padding>(find.byType(Padding)).child, isA<RawImage>()); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); await tester.pump(); expect(find.byType(Center), findsOneWidget); expect(find.byType(Padding), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); expect(tester.widget<Center>(find.byType(Center)).child, isA<Padding>()); expect(tester.widget<Padding>(find.byType(Padding)).child, isA<RawImage>()); }); testWidgets('Image state handles loadingBuilder update from null to non-null', (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Image(image: imageProvider), ); expect(find.byType(RawImage), findsOneWidget); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isFalse); final State<Image> state = tester.state(find.byType(Image)); await tester.pumpWidget( Image( image: imageProvider, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { return Center(child: child); }, ), ); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); expect(tester.state(find.byType(Image)), same(state)); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); }); testWidgets('Image state handles loadingBuilder update from non-null to null', (WidgetTester tester) async { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Image( image: imageProvider, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { return Center(child: child); }, ), ); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isTrue); await tester.pump(); expect(find.byType(Center), findsOneWidget); expect(find.byType(RawImage), findsOneWidget); final State<Image> state = tester.state(find.byType(Image)); await tester.pumpWidget( Image(image: imageProvider), ); expect(find.byType(Center), findsNothing); expect(find.byType(RawImage), findsOneWidget); expect(tester.state(find.byType(Image)), same(state)); streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); expect(tester.binding.hasScheduledFrame, isFalse); }); testWidgets('Verify Image resets its ImageListeners', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider1 = _TestImageProvider(streamCompleter: imageStreamCompleter); await tester.pumpWidget( Container( key: key, child: Image( image: imageProvider1, ), ), ); // listener from resolveStreamForKey is always added. expect(imageStreamCompleter.listeners.length, 2); final _TestImageProvider imageProvider2 = _TestImageProvider(); await tester.pumpWidget( Container( key: key, child: Image( image: imageProvider2, excludeFromSemantics: true, ), ), phase: EnginePhase.layout, ); // only listener from resolveStreamForKey is left. expect(imageStreamCompleter.listeners.length, 1); }); testWidgets('Verify Image resets its ErrorListeners', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final _TestImageStreamCompleter imageStreamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider1 = _TestImageProvider(streamCompleter: imageStreamCompleter); await tester.pumpWidget( Container( key: key, child: Image( image: imageProvider1, errorBuilder: (_,__,___) => Container(), ), ), ); // listener from resolveStreamForKey is always added. expect(imageStreamCompleter.listeners.length, 2); final _TestImageProvider imageProvider2 = _TestImageProvider(); await tester.pumpWidget( Container( key: key, child: Image( image: imageProvider2, excludeFromSemantics: true, ), ), phase: EnginePhase.layout, ); // only listener from resolveStreamForKey is left. expect(imageStreamCompleter.listeners.length, 1); }); testWidgets('Image defers loading while fast scrolling', (WidgetTester tester) async { const int gridCells = 1000; final List<_TestImageProvider> imageProviders = <_TestImageProvider>[]; final ScrollController controller = ScrollController(); addTearDown(controller.dispose); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GridView.builder( controller: controller, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), itemCount: gridCells, itemBuilder: (_, int index) { final _TestImageProvider provider = _TestImageProvider(); imageProviders.add(provider); return SizedBox( height: 250, width: 250, child: Image( image: provider, semanticLabel: index.toString(), ), ); }, ), )); bool loadCalled(_TestImageProvider provider) => provider.loadCalled; bool loadNotCalled(_TestImageProvider provider) => !provider.loadCalled; expect(find.bySemanticsLabel('5'), findsOneWidget); expect(imageProviders.length, 12); expect(imageProviders.every(loadCalled), true); imageProviders.clear(); // Simulate a very fast fling. controller.animateTo( 30000, duration: const Duration(seconds: 2), curve: Curves.linear, ); await tester.pumpAndSettle(); // The last 15 images on screen have loaded because the scrolling settled there. // The rest have not loaded. expect(imageProviders.length, 309); expect(imageProviders.skip(309 - 15).every(loadCalled), true); expect(imageProviders.take(309 - 15).every(loadNotCalled), true); }); testWidgets('Same image provider in multiple parts of the tree, no cache room left', (WidgetTester tester) async { imageCache.maximumSize = 0; final _TestImageProvider provider1 = _TestImageProvider(); final _TestImageProvider provider2 = _TestImageProvider(); expect(provider1.loadCallCount, 0); expect(provider2.loadCallCount, 0); expect(imageCache.liveImageCount, 0); await tester.pumpWidget(Column( children: <Widget>[ Image(image: provider1), Image(image: provider2), Image(image: provider1), Image(image: provider1), Image(image: provider2), ], )); expect(imageCache.liveImageCount, 2); expect(imageCache.statusForKey(provider1).live, true); expect(imageCache.statusForKey(provider1).pending, false); expect(imageCache.statusForKey(provider1).keepAlive, false); expect(imageCache.statusForKey(provider2).live, true); expect(imageCache.statusForKey(provider2).pending, false); expect(imageCache.statusForKey(provider2).keepAlive, false); expect(provider1.loadCallCount, 1); expect(provider2.loadCallCount, 1); provider1.complete(image10x10.clone()); await tester.idle(); provider2.complete(image10x10.clone()); await tester.idle(); expect(imageCache.liveImageCount, 2); expect(imageCache.currentSize, 0); await tester.pumpWidget(Image(image: provider2)); await tester.idle(); expect(imageCache.statusForKey(provider1).untracked, true); expect(imageCache.statusForKey(provider2).live, true); expect(imageCache.statusForKey(provider2).pending, false); expect(imageCache.statusForKey(provider2).keepAlive, false); expect(imageCache.liveImageCount, 1); await tester.pumpWidget(const SizedBox()); await tester.idle(); expect(provider1.loadCallCount, 1); expect(provider2.loadCallCount, 1); expect(imageCache.liveImageCount, 0); }); testWidgets('precacheImage does not hold weak ref for more than a frame', (WidgetTester tester) async { imageCache.maximumSize = 0; final _TestImageProvider provider = _TestImageProvider(); late Future<void> precache; await tester.pumpWidget( Builder( builder: (BuildContext context) { precache = precacheImage(provider, context); return Container(); }, ), ); provider.complete(image10x10); await precache; // Should have ended up with only a weak ref, not in cache because cache size is 0 expect(imageCache.liveImageCount, 1); expect(imageCache.containsKey(provider), false); final ImageCacheStatus providerLocation = (await provider.obtainCacheStatus(configuration: ImageConfiguration.empty))!; expect(providerLocation, isNotNull); expect(providerLocation.live, true); expect(providerLocation.keepAlive, false); expect(providerLocation.pending, false); // Check that a second resolve of the same image is synchronous. expect(provider._lastResolvedConfiguration, isNotNull); final ImageStream stream = provider.resolve(provider._lastResolvedConfiguration); late bool isSync; final ImageStreamListener listener = ImageStreamListener((ImageInfo image, bool syncCall) { image.dispose(); isSync = syncCall; }); // Still have live ref because frame has not pumped yet. await tester.pump(); expect(imageCache.liveImageCount, 1); SchedulerBinding.instance.scheduleFrame(); await tester.pump(); // Live ref should be gone - we didn't listen to the stream. expect(imageCache.liveImageCount, 0); expect(imageCache.currentSize, 0); stream.addListener(listener); expect(isSync, true); // because the stream still has the image. expect(imageCache.liveImageCount, 0); expect(imageCache.currentSize, 0); expect(provider.loadCallCount, 1); }); testWidgets('precacheImage allows time to take over weak reference', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final _TestImageProvider provider = _TestImageProvider(); late Future<void> precache; await tester.pumpWidget( Builder( builder: (BuildContext context) { precache = precacheImage(provider, context); return Container(); }, ), ); provider.complete(image10x10); await precache; // Should have ended up in the cache and have a weak reference. expect(imageCache.liveImageCount, 1); expect(imageCache.currentSize, 1); expect(imageCache.containsKey(provider), true); // Check that a second resolve of the same image is synchronous. expect(provider._lastResolvedConfiguration, isNotNull); final ImageStream stream = provider.resolve(provider._lastResolvedConfiguration); late bool isSync; final ImageStreamListener listener = ImageStreamListener((ImageInfo image, bool syncCall) { isSync = syncCall; }); // Should have ended up in the cache and still have a weak reference. expect(imageCache.liveImageCount, 1); expect(imageCache.currentSize, 1); expect(imageCache.containsKey(provider), true); stream.addListener(listener); expect(isSync, true); expect(imageCache.liveImageCount, 1); expect(imageCache.currentSize, 1); expect(imageCache.containsKey(provider), true); SchedulerBinding.instance.scheduleFrame(); await tester.pump(); expect(imageCache.liveImageCount, 1); expect(imageCache.currentSize, 1); expect(imageCache.containsKey(provider), true); stream.removeListener(listener); expect(imageCache.liveImageCount, 0); expect(imageCache.currentSize, 1); expect(imageCache.containsKey(provider), true); expect(provider.loadCallCount, 1); }); testWidgets('evict an image during precache', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { // This test checks that the live image tracking does not hold on to a // pending image that will never complete because it has been evicted from // the cache. // The scenario may arise in a test harness that is trying to load real // images using `tester.runAsync()`, and wants to make sure that widgets // under test have not also tried to resolve the image in a FakeAsync zone. // The image loaded in the FakeAsync zone will never complete, and the // runAsync call wants to make sure it gets a load attempt from the correct // zone. final Uint8List bytes = Uint8List.fromList(kTransparentImage); final MemoryImage provider = MemoryImage(bytes); await tester.runAsync(() async { final List<Future<void>> futures = <Future<void>>[]; await tester.pumpWidget(Builder(builder: (BuildContext context) { futures.add(precacheImage(provider, context)); imageCache.evict(provider); futures.add(precacheImage(provider, context)); return const SizedBox.expand(); })); await Future.wait<void>(futures); expect(imageCache.statusForKey(provider).keepAlive, true); expect(imageCache.statusForKey(provider).live, true); // Schedule a frame to get precacheImage to stop listening. SchedulerBinding.instance.scheduleFrame(); await tester.pump(); expect(imageCache.statusForKey(provider).keepAlive, true); expect(imageCache.statusForKey(provider).live, false); }); }); testWidgets('errorBuilder - fails on key', (WidgetTester tester) async { final UniqueKey errorKey = UniqueKey(); late Object caughtException; await tester.pumpWidget( Image( image: _FailingImageProvider(failOnObtainKey: true, throws: 'threw', image: image10x10), errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { caughtException = error; return SizedBox.expand(key: errorKey); }, ), ); await tester.pump(); expect(find.byKey(errorKey), findsOneWidget); expect(caughtException.toString(), 'threw'); expect(tester.takeException(), isNull); }); testWidgets('errorBuilder - fails on load', (WidgetTester tester) async { final UniqueKey errorKey = UniqueKey(); late Object caughtException; await tester.pumpWidget( Image( image: _FailingImageProvider(failOnLoad: true, throws: 'threw', image: image10x10), errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { caughtException = error; return SizedBox.expand(key: errorKey); }, ), ); await tester.pump(); expect(find.byKey(errorKey), findsOneWidget); expect(caughtException.toString(), 'threw'); expect(tester.takeException(), isNull); }); testWidgets('no errorBuilder - failure reported to FlutterError', (WidgetTester tester) async { await tester.pumpWidget( Image( image: _FailingImageProvider(failOnLoad: true, throws: 'threw', image: image10x10), ), ); await tester.pump(); expect(tester.takeException(), 'threw'); }); Future<void> testRotatedImage(WidgetTester tester, bool isAntiAlias) async { final Key key = UniqueKey(); await tester.pumpWidget(RepaintBoundary( key: key, child: Transform.rotate( angle: math.pi / 180, child: Image.memory(Uint8List.fromList(kBlueRectPng), isAntiAlias: isAntiAlias), ), )); // precacheImage is needed, or the image in the golden file will be empty. if (!kIsWeb) { final Finder allImages = find.byType(Image); for (final Element e in allImages.evaluate()) { await tester.runAsync(() async { final Image image = e.widget as Image; await precacheImage(image.image, e); }); } await tester.pumpAndSettle(); } await expectLater( find.byKey(key), matchesGoldenFile('rotated_image_${isAntiAlias ? 'aa' : 'noaa'}.png'), ); } testWidgets( 'Rotated images', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { await testRotatedImage(tester, true); await testRotatedImage(tester, false); }, skip: kIsWeb, // https://github.com/flutter/flutter/issues/87933. ); testWidgets( 'Image opacity', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget(RepaintBoundary( key: key, child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, textDirection: TextDirection.ltr, children: <Widget>[ Image.memory( Uint8List.fromList(kBlueRectPng), opacity: const AlwaysStoppedAnimation<double>(0.25), ), Image.memory( Uint8List.fromList(kBlueRectPng), opacity: const AlwaysStoppedAnimation<double>(0.5), ), Image.memory( Uint8List.fromList(kBlueRectPng), opacity: const AlwaysStoppedAnimation<double>(0.75), ), Image.memory( Uint8List.fromList(kBlueRectPng), opacity: const AlwaysStoppedAnimation<double>(1.0), ), ], ), )); // precacheImage is needed, or the image in the golden file will be empty. if (!kIsWeb) { final Finder allImages = find.byType(Image); for (final Element e in allImages.evaluate()) { await tester.runAsync(() async { final Image image = e.widget as Image; await precacheImage(image.image, e); }); } await tester.pumpAndSettle(); } await expectLater( find.byKey(key), matchesGoldenFile('transparent_image.png'), ); }, skip: kIsWeb, // https://github.com/flutter/flutter/issues/87933. ); testWidgets('Reports image size when painted', // TODO(polina-c): make sure images are disposed, https://github.com/flutter/flutter/issues/141388 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { late ImageSizeInfo imageSizeInfo; int count = 0; debugOnPaintImage = (ImageSizeInfo info) { count += 1; imageSizeInfo = info; }; final ui.Image image = (await tester.runAsync(() => createTestImage(width: 100, height: 100)))!; final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter( ImageInfo( image: image, debugLabel: 'test.png', ), ); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Center( child: SizedBox( height: 50, width: 50, child: Image(image: imageProvider), ), ), ); expect(count, 1); expect( imageSizeInfo, const ImageSizeInfo( source: 'test.png', imageSize: Size(100, 100), displaySize: Size(150, 150), ), ); debugOnPaintImage = null; }); testWidgets('Disposes image handle when disposed', (WidgetTester tester) async { final ui.Image image = (await tester.runAsync(() => createTestImage(cache: false)))!; expect(image.debugGetOpenHandleStackTraces()!.length, 1); final ImageProvider provider = _TestImageProvider( streamCompleter: OneFrameImageStreamCompleter( Future<ImageInfo>.value( ImageInfo( image: image, debugLabel: '_TestImage', ), ), ), ); // creating the provider should not have changed anything, and the provider // now owns the handle. expect(image.debugGetOpenHandleStackTraces()!.length, 1); await tester.pumpWidget(Image(image: provider)); // Image widget + 1, render object + 1 expect(image.debugGetOpenHandleStackTraces()!.length, 3); await tester.pumpWidget(const SizedBox()); // Image widget and render object go away expect(image.debugGetOpenHandleStackTraces()!.length, 1); await provider.evict(); tester.binding.scheduleFrame(); await tester.pump(); // Image cache listener go away and Image stream listeners go away. // Image is now at zero. expect(image.debugGetOpenHandleStackTraces()!.length, 0); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442 testWidgets('Keeps stream alive when ticker mode is disabled', (WidgetTester tester) async { imageCache.maximumSize = 0; final ui.Image image = (await tester.runAsync(() => createTestImage(cache: false)))!; final _TestImageProvider provider = _TestImageProvider(); provider.complete(image); await tester.pumpWidget( TickerMode( enabled: true, child: Image(image: provider), ), ); expect(find.byType(Image), findsOneWidget); await tester.pumpWidget(TickerMode( enabled: false, child: Image(image: provider), ), ); expect(find.byType(Image), findsOneWidget); await tester.pumpWidget(TickerMode( enabled: true, child: Image(image: provider), ), ); expect(find.byType(Image), findsOneWidget); }); testWidgets('Load a good image after a bad image was loaded should not call errorBuilder', // TODO(polina-c): clean up leaks, https://github.com/flutter/flutter/issues/134787 [leaks-to-clean] experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), (WidgetTester tester) async { final UniqueKey errorKey = UniqueKey(); final ui.Image image = (await tester.runAsync(() => createTestImage()))!; final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); await tester.pumpWidget( Center( child: SizedBox( height: 50, width: 50, child: Image( image: imageProvider, excludeFromSemantics: true, errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { return Container(key: errorKey); }, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { return Padding(padding: const EdgeInsets.all(1), child: child); }, ), ), ), ); // No error widget before loading a invalid image. expect(find.byKey(errorKey), findsNothing); // Loading good image succeed streamCompleter.setData(chunkEvent: const ImageChunkEvent(cumulativeBytesLoaded: 10, expectedTotalBytes: 100)); await tester.pump(); expect(find.byType(Padding), findsOneWidget); // Loading bad image shows the error widget. streamCompleter.setError(exception: 'thrown'); await tester.pump(); expect(find.byKey(errorKey), findsOneWidget); // Loading good image shows the image widget instead of the error widget. streamCompleter.setData(imageInfo: ImageInfo(image: image)); await tester.pump(); expect(find.byType(Padding), findsOneWidget); expect(tester.widget<Padding>(find.byType(Padding)).child, isA<RawImage>()); expect(find.byKey(errorKey), findsNothing); }); testWidgets('Failed image loads in debug mode', (WidgetTester tester) async { final Key key = UniqueKey(); await tester.pumpWidget(Center( child: RepaintBoundary( key: key, child: Container( width: 150.0, height: 50.0, decoration: BoxDecoration( border: Border.all( width: 2.0, color: const Color(0xFF00FF99), ), ), child: Image.asset('missing-asset'), ), ), )); await expectLater( find.byKey(key), matchesGoldenFile('image_test.missing.1.png'), ); expect( tester.takeException().toString(), equals( 'Unable to load asset: "missing-asset".\n' 'The asset does not exist or has empty data.', ), ); await tester.pump(); await expectLater( find.byKey(key), matchesGoldenFile('image_test.missing.2.png'), ); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/74935 (broken assets not being reported on web) testWidgets('Image.file throws a non-implemented error on web', (WidgetTester tester) async { const String expectedError = 'Image.file is not supported on Flutter Web. ' 'Consider using either Image.asset or Image.network instead.'; final Uri uri = Uri.parse('/home/flutter/dash.png'); final File file = File.fromUri(uri); expect( () => Image.file(file), kIsWeb // Web does not support file access, expect AssertionError ? throwsA(predicate((AssertionError e) => e.message == expectedError)) // AOT supports file access, expect constructor to succeed : isNot(throwsA(anything)), ); }); testWidgets('Animated GIFs do not require layout for subsequent frames', (WidgetTester tester) async { final ui.Codec codec = (await tester.runAsync(() { return ui.instantiateImageCodec(Uint8List.fromList(kAnimatedGif)); }))!; Future<ui.Image> nextFrame() async { final ui.FrameInfo frameInfo = (await tester.runAsync(codec.getNextFrame))!; return frameInfo.image; } final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter(); final _TestImageProvider imageProvider = _TestImageProvider(streamCompleter: streamCompleter); int? lastFrame; await tester.pumpWidget( Center( child: Image( image: imageProvider, frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) { lastFrame = frame; return child; }, ), ), ); expect(tester.getSize(find.byType(Image)), Size.zero); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); await tester.pump(); expect(lastFrame, 0); expect(tester.allRenderObjects.whereType<RenderImage>().single.debugNeedsLayout, isFalse); expect(tester.allRenderObjects.whereType<RenderImage>().single.debugNeedsPaint, isFalse); expect(tester.getSize(find.byType(Image)), const Size(1, 1)); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); // We only complete the build phase and expect that it does not mark the // RenderImage for layout because the new frame has the same dimensions as // the old one. We only need to repaint. await tester.pump(null, EnginePhase.build); expect(lastFrame, 1); expect(tester.allRenderObjects.whereType<RenderImage>().single.debugNeedsLayout, isFalse); expect(tester.allRenderObjects.whereType<RenderImage>().single.debugNeedsPaint, isTrue); expect(tester.getSize(find.byType(Image)), const Size(1, 1)); streamCompleter.setData(imageInfo: ImageInfo(image: await nextFrame())); await tester.pump(); expect(lastFrame, 2); expect(tester.allRenderObjects.whereType<RenderImage>().single.debugNeedsLayout, isFalse); expect(tester.allRenderObjects.whereType<RenderImage>().single.debugNeedsPaint, isFalse); expect(tester.getSize(find.byType(Image)), const Size(1, 1)); codec.dispose(); }); } @immutable class _ConfigurationAwareKey { const _ConfigurationAwareKey(this.provider, this.configuration); final ImageProvider provider; final ImageConfiguration configuration; @override bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } return other is _ConfigurationAwareKey && other.provider == provider && other.configuration == configuration; } @override int get hashCode => Object.hash(provider, configuration); } class _ConfigurationKeyedTestImageProvider extends _TestImageProvider { @override Future<_ConfigurationAwareKey> obtainKey(ImageConfiguration configuration) { return SynchronousFuture<_ConfigurationAwareKey>(_ConfigurationAwareKey(this, configuration)); } } class _TestImageProvider extends ImageProvider<Object> { _TestImageProvider({ImageStreamCompleter? streamCompleter}) { _streamCompleter = streamCompleter ?? OneFrameImageStreamCompleter(_completer.future); } final Completer<ImageInfo> _completer = Completer<ImageInfo>(); late ImageStreamCompleter _streamCompleter; late ImageConfiguration _lastResolvedConfiguration; bool get loadCalled => _loadCallCount > 0; int get loadCallCount => _loadCallCount; int _loadCallCount = 0; @override Future<Object> obtainKey(ImageConfiguration configuration) { return SynchronousFuture<_TestImageProvider>(this); } @override void resolveStreamForKey(ImageConfiguration configuration, ImageStream stream, Object key, ImageErrorListener handleError) { _lastResolvedConfiguration = configuration; super.resolveStreamForKey(configuration, stream, key, handleError); } @override ImageStreamCompleter loadImage(Object key, ImageDecoderCallback decode) { _loadCallCount += 1; return _streamCompleter; } void complete(ui.Image image) { _completer.complete(ImageInfo(image: image)); } void fail(Object exception, StackTrace? stackTrace) { _completer.completeError(exception, stackTrace); } @override String toString() => '${describeIdentity(this)}()'; } class _TestImageStreamCompleter extends ImageStreamCompleter { _TestImageStreamCompleter([this._currentImage]); ImageInfo? _currentImage; final Set<ImageStreamListener> listeners = <ImageStreamListener>{}; @override void addListener(ImageStreamListener listener) { listeners.add(listener); if (_currentImage != null) { listener.onImage(_currentImage!.clone(), true); } } @override void removeListener(ImageStreamListener listener) { listeners.remove(listener); } void setData({ ImageInfo? imageInfo, ImageChunkEvent? chunkEvent, }) { if (imageInfo != null) { _currentImage?.dispose(); _currentImage = imageInfo; } final List<ImageStreamListener> localListeners = listeners.toList(); for (final ImageStreamListener listener in localListeners) { if (imageInfo != null) { listener.onImage(imageInfo.clone(), false); } if (chunkEvent != null && listener.onChunk != null) { listener.onChunk!(chunkEvent); } } } void setError({ required Object exception, StackTrace? stackTrace, }) { final List<ImageStreamListener> localListeners = listeners.toList(); for (final ImageStreamListener listener in localListeners) { listener.onError?.call(exception, stackTrace); } } } class _DebouncingImageProvider extends ImageProvider<Object> { _DebouncingImageProvider(this.imageProvider, this.seenKeys); /// A set of keys that will only get resolved the _first_ time they are seen. /// /// If an ImageProvider produces the same key for two different image /// configurations, it should only actually resolve once using this provider. /// However, if it does care about image configuration, it should make the /// property or properties it cares about part of the key material it /// produces. final Set<Object> seenKeys; final ImageProvider<Object> imageProvider; @override void resolveStreamForKey(ImageConfiguration configuration, ImageStream stream, Object key, ImageErrorListener handleError) { if (seenKeys.add(key)) { imageProvider.resolveStreamForKey(configuration, stream, key, handleError); } } @override Future<Object> obtainKey(ImageConfiguration configuration) => imageProvider.obtainKey(configuration); @override ImageStreamCompleter loadImage(Object key, ImageDecoderCallback decode) => imageProvider.loadImage(key, decode); } class _FailingImageProvider extends ImageProvider<int> { const _FailingImageProvider({ this.failOnObtainKey = false, this.failOnLoad = false, required this.throws, required this.image, }) : assert(failOnLoad || failOnObtainKey); final bool failOnObtainKey; final bool failOnLoad; final Object throws; final ui.Image image; @override Future<int> obtainKey(ImageConfiguration configuration) { if (failOnObtainKey) { throw throws; } return SynchronousFuture<int>(hashCode); } @override ImageStreamCompleter loadImage(int key, ImageDecoderCallback decode) { if (failOnLoad) { throw throws; } return OneFrameImageStreamCompleter( Future<ImageInfo>.value( ImageInfo( image: image, scale: 0, ), ), ); } }
flutter/packages/flutter/test/widgets/image_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/image_test.dart", "repo_id": "flutter", "token_count": 30497 }
762
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/src/rendering/sliver.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; class Wrapper extends StatelessWidget { const Wrapper({ super.key, required this.child, }); final Widget child; @override Widget build(BuildContext context) => child; } class StatefulWrapper extends StatefulWidget { const StatefulWrapper({ super.key, required this.child, }); final Widget child; @override StatefulWrapperState createState() => StatefulWrapperState(); } class StatefulWrapperState extends State<StatefulWrapper> { void trigger() { setState(() { /* for test purposes */ }); } @override Widget build(BuildContext context) => widget.child; } void main() { testWidgets('Moving global key inside a LayoutBuilder', (WidgetTester tester) async { final GlobalKey<StatefulWrapperState> key = GlobalKey<StatefulWrapperState>(); await tester.pumpWidget( LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { return Wrapper( child: StatefulWrapper(key: key, child: Container(height: 100.0)), ); }), ); await tester.pumpWidget( LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { key.currentState!.trigger(); return StatefulWrapper(key: key, child: Container(height: 100.0)); }), ); expect(tester.takeException(), null); }); testWidgets('Moving global key inside a SliverLayoutBuilder', (WidgetTester tester) async { final GlobalKey<StatefulWrapperState> key = GlobalKey<StatefulWrapperState>(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( slivers: <Widget>[ SliverLayoutBuilder( builder: (BuildContext context, SliverConstraints constraint) { return SliverToBoxAdapter( child: Wrapper(child: StatefulWrapper(key: key, child: Container(height: 100.0))), ); }, ), ], ), ), ); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( slivers: <Widget>[ SliverLayoutBuilder( builder: (BuildContext context, SliverConstraints constraint) { key.currentState!.trigger(); return SliverToBoxAdapter( child: StatefulWrapper(key: key, child: Container(height: 100.0)), ); }, ), ], ), ), ); expect(tester.takeException(), null); }); }
flutter/packages/flutter/test/widgets/layout_builder_and_global_keys_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/layout_builder_and_global_keys_test.dart", "repo_id": "flutter", "token_count": 1164 }
763
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; import 'test_widgets.dart'; void main() { testWidgets('ListView mount/dismount smoke test', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment // so if our widget is 100 pixels tall, it should fit exactly 6 times. Widget builder() { return Directionality( textDirection: TextDirection.ltr, child: FlipWidget( left: ListView.builder( itemBuilder: (BuildContext context, int index) { callbackTracker.add(index); return SizedBox( key: ValueKey<int>(index), height: 100.0, child: Text('$index'), ); }, ), right: const Text('Not Today'), ), ); } await tester.pumpWidget(builder()); final FlipWidgetState testWidget = tester.state(find.byType(FlipWidget)); expect(callbackTracker, equals(<int>[ 0, 1, 2, 3, 4, 5, // visible 6, 7, 8, // in cached area ])); callbackTracker.clear(); testWidget.flip(); await tester.pump(); expect(callbackTracker, equals(<int>[])); callbackTracker.clear(); testWidget.flip(); await tester.pump(); expect(callbackTracker, equals(<int>[ 0, 1, 2, 3, 4, 5, // visible 6, 7, 8, // in cached area ])); }); testWidgets('ListView vertical', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment // so if our widget is 200 pixels tall, it should fit exactly 3 times. // but if we are offset by 300 pixels, there will be 4, numbered 1-4. Widget itemBuilder(BuildContext context, int index) { callbackTracker.add(index); return SizedBox( key: ValueKey<int>(index), width: 500.0, // this should be ignored height: 200.0, child: Text('$index', textDirection: TextDirection.ltr), ); } Widget builder() { final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); return Directionality( textDirection: TextDirection.ltr, child: FlipWidget( left: ListView.builder( controller: controller, itemBuilder: itemBuilder, ), right: const Text('Not Today'), ), ); } await tester.pumpWidget(builder()); // 0 is built to find its height expect(callbackTracker, equals(<int>[ 0, 1, 2, 3, 4, 5, // in cached area ])); callbackTracker.clear(); final ScrollableState scrollable = tester.state(find.byType(Scrollable)); scrollable.position.jumpTo(600.0); // now only 3 should fit, numbered 3-5. await tester.pumpWidget(builder()); // We build the visible children to find their new size. expect(callbackTracker, equals(<int>[ 0, 1, 2, 3, 4, 5, //visible 6, 7, ])); callbackTracker.clear(); await tester.pumpWidget(builder()); // 0 isn't built because they're not visible. expect(callbackTracker, equals(<int>[ 1, 2, 3, 4, 5, // visible 6, 7, ])); callbackTracker.clear(); }); testWidgets('ListView horizontal', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; // the root view is 800x600 in the test environment // so if our widget is 200 pixels wide, it should fit exactly 4 times. // but if we are offset by 300 pixels, there will be 5, numbered 1-5. Widget itemBuilder(BuildContext context, int index) { callbackTracker.add(index); return SizedBox( key: ValueKey<int>(index), height: 500.0, // this should be ignored width: 200.0, child: Text('$index', textDirection: TextDirection.ltr), ); } Widget builder() { final ScrollController controller = ScrollController(initialScrollOffset: 500.0); addTearDown(controller.dispose); return Directionality( textDirection: TextDirection.ltr, child: FlipWidget( left: ListView.builder( scrollDirection: Axis.horizontal, controller: controller, itemBuilder: itemBuilder, ), right: const Text('Not Today'), ), ); } await tester.pumpWidget(builder()); // 0 is built to find its width expect(callbackTracker, equals(<int>[0, 1, 2, 3, 4, 5, 6, 7])); callbackTracker.clear(); final ScrollableState scrollable = tester.state(find.byType(Scrollable)); scrollable.position.jumpTo(600.0); // now only 4 should fit, numbered 2-5. await tester.pumpWidget(builder()); // We build the visible children to find their new size. expect(callbackTracker, equals(<int>[1, 2, 3, 4, 5, 6, 7, 8])); callbackTracker.clear(); await tester.pumpWidget(builder()); // 0 isn't built because they're not visible. expect(callbackTracker, equals(<int>[1, 2, 3, 4, 5, 6, 7, 8])); callbackTracker.clear(); }); testWidgets('ListView reinvoke builders', (WidgetTester tester) async { final List<int> callbackTracker = <int>[]; final List<String?> text = <String?>[]; Widget itemBuilder(BuildContext context, int index) { callbackTracker.add(index); return SizedBox( key: ValueKey<int>(index), width: 500.0, // this should be ignored height: 220.0, child: Text('$index', textDirection: TextDirection.ltr), ); } void collectText(Widget widget) { if (widget is Text) { text.add(widget.data); } } Widget builder() { return Directionality( textDirection: TextDirection.ltr, child: ListView.builder( itemBuilder: itemBuilder, ), ); } await tester.pumpWidget(builder()); expect(callbackTracker, equals(<int>[ 0, 1, 2, 3, // in cached area ])); callbackTracker.clear(); tester.allWidgets.forEach(collectText); expect(text, equals(<String>['0', '1', '2', '3'])); text.clear(); await tester.pumpWidget(builder()); expect(callbackTracker, equals(<int>[ 0, 1, 2, 3, // in cached area ])); callbackTracker.clear(); tester.allWidgets.forEach(collectText); expect(text, equals(<String>['0', '1', '2', '3'])); text.clear(); }); testWidgets('ListView reinvoke builders', (WidgetTester tester) async { late StateSetter setState; ThemeData themeData = ThemeData.light(useMaterial3: false); Widget itemBuilder(BuildContext context, int index) { return Container( key: ValueKey<int>(index), width: 500.0, // this should be ignored height: 220.0, color: Theme.of(context).primaryColor, child: Text('$index', textDirection: TextDirection.ltr), ); } final Widget viewport = ListView.builder( itemBuilder: itemBuilder, ); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: StatefulBuilder( builder: (BuildContext context, StateSetter setter) { setState = setter; return Theme(data: themeData, child: viewport); }, ), ), ); Container widget = tester.firstWidget(find.byType(Container)); expect(widget.color, equals(Colors.blue)); setState(() { themeData = ThemeData(primarySwatch: Colors.green, useMaterial3: false); }); await tester.pump(); widget = tester.firstWidget(find.byType(Container)); expect(widget.color, equals(Colors.green)); }); testWidgets('ListView padding', (WidgetTester tester) async { Widget itemBuilder(BuildContext context, int index) { return Container( key: ValueKey<int>(index), width: 500.0, // this should be ignored height: 220.0, color: Colors.green[500], child: Text('$index', textDirection: TextDirection.ltr), ); } await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: ListView.builder( padding: const EdgeInsets.fromLTRB(7.0, 3.0, 5.0, 11.0), itemBuilder: itemBuilder, ), ), ); final RenderBox firstBox = tester.renderObject(find.text('0')); final Offset upperLeft = firstBox.localToGlobal(Offset.zero); expect(upperLeft, equals(const Offset(7.0, 3.0))); expect(firstBox.size.width, equals(800.0 - 12.0)); }); testWidgets('ListView underflow extents', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: ListView( addAutomaticKeepAlives: false, addSemanticIndexes: false, children: <Widget>[ Container(height: 100.0), Container(height: 100.0), Container(height: 100.0), ], ), ), ); final RenderSliverList list = tester.renderObject(find.byType(SliverList)); expect(list.indexOf(list.firstChild!), equals(0)); expect(list.indexOf(list.lastChild!), equals(2)); expect(list.childScrollOffset(list.firstChild!), equals(0.0)); expect(list.geometry!.scrollExtent, equals(300.0)); expect(list, hasAGoodToStringDeep); expect( list.toStringDeep(minLevel: DiagnosticLevel.info), equalsIgnoringHashCodes( 'RenderSliverList#00000 relayoutBoundary=up2\n' ' │ needs compositing\n' ' │ parentData: paintOffset=Offset(0.0, 0.0) (can use size)\n' ' │ constraints: SliverConstraints(AxisDirection.down,\n' ' │ GrowthDirection.forward, ScrollDirection.idle, scrollOffset:\n' ' │ 0.0, precedingScrollExtent: 0.0, remainingPaintExtent: 600.0,\n' ' │ crossAxisExtent: 800.0, crossAxisDirection:\n' ' │ AxisDirection.right, viewportMainAxisExtent: 600.0,\n' ' │ remainingCacheExtent: 850.0, cacheOrigin: 0.0)\n' ' │ geometry: SliverGeometry(scrollExtent: 300.0, paintExtent: 300.0,\n' ' │ maxPaintExtent: 300.0, cacheExtent: 300.0)\n' ' │ currently live children: 0 to 2\n' ' │\n' ' ├─child with index 0: RenderRepaintBoundary#00000 relayoutBoundary=up3\n' ' │ │ needs compositing\n' ' │ │ parentData: index=0; layoutOffset=0.0 (can use size)\n' ' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n' ' │ │ layer: OffsetLayer#00000\n' ' │ │ size: Size(800.0, 100.0)\n' ' │ │ metrics: 0.0% useful (1 bad vs 0 good)\n' ' │ │ diagnosis: insufficient data to draw conclusion (less than five\n' ' │ │ repaints)\n' ' │ │\n' ' │ └─child: RenderConstrainedBox#00000 relayoutBoundary=up4\n' ' │ │ parentData: <none> (can use size)\n' ' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n' ' │ │ size: Size(800.0, 100.0)\n' ' │ │ additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)\n' ' │ │\n' ' │ └─child: RenderLimitedBox#00000\n' ' │ │ parentData: <none> (can use size)\n' ' │ │ constraints: BoxConstraints(w=800.0, h=100.0)\n' ' │ │ size: Size(800.0, 100.0)\n' ' │ │ maxWidth: 0.0\n' ' │ │ maxHeight: 0.0\n' ' │ │\n' ' │ └─child: RenderConstrainedBox#00000\n' ' │ parentData: <none> (can use size)\n' ' │ constraints: BoxConstraints(w=800.0, h=100.0)\n' ' │ size: Size(800.0, 100.0)\n' ' │ additionalConstraints: BoxConstraints(biggest)\n' ' │\n' ' ├─child with index 1: RenderRepaintBoundary#00000 relayoutBoundary=up3\n' ' │ │ needs compositing\n' ' │ │ parentData: index=1; layoutOffset=100.0 (can use size)\n' ' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n' ' │ │ layer: OffsetLayer#00000\n' ' │ │ size: Size(800.0, 100.0)\n' ' │ │ metrics: 0.0% useful (1 bad vs 0 good)\n' ' │ │ diagnosis: insufficient data to draw conclusion (less than five\n' ' │ │ repaints)\n' ' │ │\n' ' │ └─child: RenderConstrainedBox#00000 relayoutBoundary=up4\n' ' │ │ parentData: <none> (can use size)\n' ' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n' ' │ │ size: Size(800.0, 100.0)\n' ' │ │ additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)\n' ' │ │\n' ' │ └─child: RenderLimitedBox#00000\n' ' │ │ parentData: <none> (can use size)\n' ' │ │ constraints: BoxConstraints(w=800.0, h=100.0)\n' ' │ │ size: Size(800.0, 100.0)\n' ' │ │ maxWidth: 0.0\n' ' │ │ maxHeight: 0.0\n' ' │ │\n' ' │ └─child: RenderConstrainedBox#00000\n' ' │ parentData: <none> (can use size)\n' ' │ constraints: BoxConstraints(w=800.0, h=100.0)\n' ' │ size: Size(800.0, 100.0)\n' ' │ additionalConstraints: BoxConstraints(biggest)\n' ' │\n' ' └─child with index 2: RenderRepaintBoundary#00000 relayoutBoundary=up3\n' ' │ needs compositing\n' ' │ parentData: index=2; layoutOffset=200.0 (can use size)\n' ' │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n' ' │ layer: OffsetLayer#00000\n' ' │ size: Size(800.0, 100.0)\n' ' │ metrics: 0.0% useful (1 bad vs 0 good)\n' ' │ diagnosis: insufficient data to draw conclusion (less than five\n' ' │ repaints)\n' ' │\n' ' └─child: RenderConstrainedBox#00000 relayoutBoundary=up4\n' ' │ parentData: <none> (can use size)\n' ' │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n' ' │ size: Size(800.0, 100.0)\n' ' │ additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)\n' ' │\n' ' └─child: RenderLimitedBox#00000\n' ' │ parentData: <none> (can use size)\n' ' │ constraints: BoxConstraints(w=800.0, h=100.0)\n' ' │ size: Size(800.0, 100.0)\n' ' │ maxWidth: 0.0\n' ' │ maxHeight: 0.0\n' ' │\n' ' └─child: RenderConstrainedBox#00000\n' ' parentData: <none> (can use size)\n' ' constraints: BoxConstraints(w=800.0, h=100.0)\n' ' size: Size(800.0, 100.0)\n' ' additionalConstraints: BoxConstraints(biggest)\n', ), ); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; expect(position.viewportDimension, equals(600.0)); expect(position.minScrollExtent, equals(0.0)); }); testWidgets('ListView should not paint hidden children', (WidgetTester tester) async { const Text text = Text('test'); final ScrollController controller = ScrollController(initialScrollOffset: 300.0); addTearDown(controller.dispose); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( height: 200.0, child: ListView( cacheExtent: 500.0, controller: controller, children: const <Widget>[ SizedBox(height: 140.0, child: text), SizedBox(height: 160.0, child: text), SizedBox(height: 90.0, child: text), SizedBox(height: 110.0, child: text), SizedBox(height: 80.0, child: text), SizedBox(height: 70.0, child: text), ], ), ), ), ), ); final RenderSliverList list = tester.renderObject(find.byType(SliverList)); expect(list, paintsExactlyCountTimes(#drawParagraph, 2)); }); testWidgets('ListView should paint with offset', (WidgetTester tester) async { final ScrollController controller = ScrollController(initialScrollOffset: 120.0); addTearDown(controller.dispose); await tester.pumpWidget( MaterialApp( home: Scaffold( body: SizedBox( height: 500.0, child: CustomScrollView( controller: controller, slivers: <Widget>[ const SliverAppBar( expandedHeight: 250.0, ), SliverList( delegate: ListView.builder( itemExtent: 100.0, itemCount: 100, itemBuilder: (_, __) => const SizedBox( height: 40.0, child: Text('hey'), ), ).childrenDelegate, ), ], ), ), ), ), ); final RenderObject renderObject = tester.renderObject(find.byType(Scrollable)); expect(renderObject, paintsExactlyCountTimes(#drawParagraph, 10)); }); testWidgets('ListView should paint with rtl', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.rtl, child: SizedBox( height: 200.0, child: ListView.builder( padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, itemExtent: 200.0, itemCount: 10, itemBuilder: (_, int i) => Container( height: 200.0, width: 200.0, color: i.isEven ? Colors.black : Colors.red, ), ), ), ), ); final RenderObject renderObject = tester.renderObject(find.byType(Scrollable)); expect(renderObject, paintsExactlyCountTimes(#drawRect, 4)); }); }
flutter/packages/flutter/test/widgets/list_view_viewporting_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/list_view_viewporting_test.dart", "repo_id": "flutter", "token_count": 8395 }
764
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:ui'; import 'package:flutter_test/flutter_test.dart'; class FakeView extends TestFlutterView { FakeView(FlutterView view, { this.viewId = 100 }) : super( view: view, platformDispatcher: view.platformDispatcher as TestPlatformDispatcher, display: view.display as TestDisplay, ); @override final int viewId; @override void render(Scene scene, {Size? size}) { // Do not render the scene in the engine. The engine only observes one // instance of FlutterView (the _view), and it is generally expected that // the framework will render no more than one `Scene` per frame. } @override void updateSemantics(SemanticsUpdate update) { // Do not send the update to the engine. The engine only observes one // instance of FlutterView (the _view). Sending semantic updates meant for // different views to the same engine view does not work as the updates do // not produce consistent semantics trees. } }
flutter/packages/flutter/test/widgets/multi_view_testing.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/multi_view_testing.dart", "repo_id": "flutter", "token_count": 332 }
765
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('OverflowBox control test', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Align( alignment: Alignment.bottomRight, child: SizedBox( width: 10.0, height: 20.0, child: OverflowBox( minWidth: 0.0, maxWidth: 100.0, minHeight: 0.0, maxHeight: 50.0, child: Container( key: inner, ), ), ), )); final RenderBox box = inner.currentContext!.findRenderObject()! as RenderBox; expect(box.localToGlobal(Offset.zero), equals(const Offset(745.0, 565.0))); expect(box.size, equals(const Size(100.0, 50.0))); }); // Adapted from https://github.com/flutter/flutter/issues/129094 group('when fit is OverflowBoxFit.deferToChild', () { group('OverflowBox behavior with long and short content', () { for (final bool contentSuperLong in <bool>[false, true]) { testWidgets('contentSuperLong=$contentSuperLong', (WidgetTester tester) async { final GlobalKey<State<StatefulWidget>> key = GlobalKey(); final Column child = Column( mainAxisSize: MainAxisSize.min, children: <Widget>[ SizedBox(width: 100, height: contentSuperLong ? 10000 : 100), ], ); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Container( key: key, child: OverflowBox( maxHeight: 1000000, fit: OverflowBoxFit.deferToChild, child: child, ), ), ], ), )); expect(tester.getBottomLeft(find.byKey(key)).dy, contentSuperLong ? 600 : 100); }); } }); testWidgets('no child', (WidgetTester tester) async { final GlobalKey<State<StatefulWidget>> key = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Container( key: key, child: const OverflowBox( maxHeight: 1000000, fit: OverflowBoxFit.deferToChild, // no child ), ), ], ), )); expect(tester.getBottomLeft(find.byKey(key)).dy, 0); }); }); testWidgets('OverflowBox implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const OverflowBox( minWidth: 1.0, maxWidth: 2.0, minHeight: 3.0, maxHeight: 4.0, ).debugFillProperties(builder); final List<String> description = builder.properties .where((DiagnosticsNode n) => !n.isFiltered(DiagnosticLevel.info)) .map((DiagnosticsNode n) => n.toString()).toList(); expect(description, <String>[ 'alignment: Alignment.center', 'minWidth: 1.0', 'maxWidth: 2.0', 'minHeight: 3.0', 'maxHeight: 4.0', 'fit: max', ]); }); testWidgets('SizedOverflowBox alignment', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, child: Center( child: SizedOverflowBox( size: const Size(100.0, 100.0), alignment: Alignment.topRight, child: SizedBox(height: 50.0, width: 50.0, key: inner), ), ), )); final RenderBox box = inner.currentContext!.findRenderObject()! as RenderBox; expect(box.size, equals(const Size(50.0, 50.0))); expect( box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset( (800.0 - 100.0) / 2.0 + 100.0 - 50.0 / 2.0, (600.0 - 100.0) / 2.0 + 0.0 + 50.0 / 2.0, )), ); }); testWidgets('SizedOverflowBox alignment (direction-sensitive)', (WidgetTester tester) async { final GlobalKey inner = GlobalKey(); await tester.pumpWidget(Directionality( textDirection: TextDirection.rtl, child: Center( child: SizedOverflowBox( size: const Size(100.0, 100.0), alignment: AlignmentDirectional.bottomStart, child: SizedBox(height: 50.0, width: 50.0, key: inner), ), ), )); final RenderBox box = inner.currentContext!.findRenderObject()! as RenderBox; expect(box.size, equals(const Size(50.0, 50.0))); expect( box.localToGlobal(box.size.center(Offset.zero)), equals(const Offset( (800.0 - 100.0) / 2.0 + 100.0 - 50.0 / 2.0, (600.0 - 100.0) / 2.0 + 100.0 - 50.0 / 2.0, )), ); }); }
flutter/packages/flutter/test/widgets/overflow_box_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/overflow_box_test.dart", "repo_id": "flutter", "token_count": 2367 }
766
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @TestOn('!chrome') library; import 'dart:async'; import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import '../services/fake_platform_views.dart'; void main() { group('AndroidView', () { testWidgets('Create Android view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'webview', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); }); testWidgets('Create Android view with params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, creationParams: 'creation parameters', creationParamsCodec: StringCodec(), ), ), ), ); final FakeAndroidPlatformView fakeView = viewsController.views.first; final Uint8List rawCreationParams = fakeView.creationParams!; final ByteData byteData = ByteData.view( rawCreationParams.buffer, rawCreationParams.offsetInBytes, rawCreationParams.lengthInBytes, ); final dynamic actualParams = const StringCodec().decodeMessage(byteData); expect(actualParams, 'creation parameters'); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'webview', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, creationParams: fakeView.creationParams, ), ]), ); }); testWidgets('Zero sized Android view is not created', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox.shrink( child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, isEmpty, ); }); testWidgets('Resize Android view', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); viewsController.resizeCompleter = Completer<void>(); await tester.pumpWidget( const Center( child: SizedBox( width: 100.0, height: 50.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); final Layer textureParentLayer = tester.layers[tester.layers.length - 2]; expect(textureParentLayer, isA<ClipRectLayer>()); final ClipRectLayer clipRect = textureParentLayer as ClipRectLayer; expect(clipRect.clipRect, const Rect.fromLTWH(0.0, 0.0, 100.0, 50.0)); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'webview', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); viewsController.resizeCompleter!.complete(); await tester.pump(); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'webview', const Size(100.0, 50.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); }); testWidgets('Change Android view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.registerViewType('maps'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'maps', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 2, 'maps', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); }); testWidgets('Dispose Android view', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); expect( viewsController.views, isEmpty, ); }); testWidgets('Android view survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); final GlobalKey key = GlobalKey(); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr, key: key), ), ), ); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr, key: key), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'webview', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); }); testWidgets('Android view gets touch events', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); }); testWidgets('Android view transparent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.transparent, layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); expect( viewsController.motionEvents[currentViewId + 1], isNull, ); expect( numPointerDownsOnParent, 1, ); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets('Android view translucent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.translucent, layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); expect( numPointerDownsOnParent, 1, ); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets('Android view opaque hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); expect( numPointerDownsOnParent, 0, ); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets("Android view touch events are in virtual display's coordinate system", (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: Container( margin: const EdgeInsets.all(10.0), child: const SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(40.0, 40.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(40.0, 40.0)]), ]), ); }); testWidgets('Android view directionality', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('maps'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'maps', layoutDirection: TextDirection.rtl), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'maps', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionRtl, ), ]), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'maps', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'maps', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); }); testWidgets('Android view ambient directionality', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('maps'); await tester.pumpWidget( const Directionality( textDirection: TextDirection.rtl, child: Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'maps'), ), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'maps', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionRtl, ), ]), ); await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'maps'), ), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAndroidPlatformView>[ FakeAndroidPlatformView( currentViewId + 1, 'maps', const Size(200.0, 100.0), AndroidViewController.kAndroidLayoutDirectionLtr, ), ]), ); }); testWidgets('Android view can lose gesture arenas', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: Container( margin: const EdgeInsets.all(10.0), child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: const SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(verticalDragAcceptedByParent, true); expect( viewsController.motionEvents[currentViewId + 1], isNull, ); }); testWidgets('Android view drag gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<VerticalDragGestureRecognizer>( () { final VerticalDragGestureRecognizer recognizer = VerticalDragGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(verticalDragAcceptedByParent, false); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionMove, <int>[0], <Offset>[Offset(50.0, 150.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(50.0, 150.0)]), ]), ); }); testWidgets('Android view long press gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); bool longPressAccessedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onLongPress: () { longPressAccessedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<LongPressGestureRecognizer>( () { final LongPressGestureRecognizer recognizer = LongPressGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); await tester.longPressAt(const Offset(50.0, 50.0)); expect(longPressAccessedByParent, false); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); }); testWidgets('Android view tap gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); bool tapAccessedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onTap: () { tapAccessedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<TapGestureRecognizer>( () { final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); await tester.tapAt(const Offset(50.0, 50.0)); expect(tapAccessedByParent, false); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); }); testWidgets('Android view can claim gesture after all pointers are up', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; // The long press recognizer rejects the gesture after the AndroidView gets the pointer up event. // This test makes sure that the Android view can win the gesture after it got the pointer up event. await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, onLongPress: () { }, child: const SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(verticalDragAcceptedByParent, false); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); }); testWidgets('Android view rebuilt during gesture', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); await gesture.up(); expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionMove, <int>[0], <Offset>[Offset(50.0, 150.0)]), const FakeAndroidMotionEvent(AndroidViewController.kActionUp, <int>[0], <Offset>[Offset(50.0, 150.0)]), ]), ); }); testWidgets('Android view with eager gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { }, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( () { final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); // Normally (without the eager gesture recognizer) after just the pointer down event // no gesture arena member will claim the arena (so no motion events will be dispatched to // the Android view). Here we assert that with the eager recognizer in the gesture team the // pointer down event is immediately dispatched. expect( viewsController.motionEvents[currentViewId + 1], orderedEquals(<FakeAndroidMotionEvent>[ const FakeAndroidMotionEvent(AndroidViewController.kActionDown, <int>[0], <Offset>[Offset(50.0, 50.0)]), ]), ); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); // This test makes sure it doesn't crash. // https://github.com/flutter/flutter/issues/21514 testWidgets( 'RenderAndroidView reconstructed with same gestureRecognizers does not crash', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); final AndroidView androidView = AndroidView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>( () { final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ); await tester.pumpWidget(androidView); await tester.pumpWidget(const SizedBox.shrink()); await tester.pumpWidget(androidView); }, ); testWidgets('AndroidView rebuilt with same gestureRecognizers', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { factoryInvocationCount += 1; final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; } await tester.pumpWidget( AndroidView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>(constructRecognizer), }, layoutDirection: TextDirection.ltr, ), ); await tester.pumpWidget( AndroidView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.translucent, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>(constructRecognizer), }, layoutDirection: TextDirection.ltr, ), ); expect(factoryInvocationCount, 1); }); testWidgets('AndroidView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.createCompleter = Completer<void>(); await tester.pumpWidget( Semantics( container: true, child: const Align( alignment: Alignment.bottomRight, child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ), ); // Find the first _AndroidPlatformView widget inside of the AndroidView so // that it finds the right RenderObject when looking for semantics. final Finder semanticsFinder = find.byWidgetPredicate( (Widget widget) { return widget.runtimeType.toString() == '_AndroidPlatformView'; }, description: '_AndroidPlatformView widget inside AndroidView', ); final SemanticsNode semantics = tester.getSemantics(semanticsFinder.first); // Platform view has not been created yet, no platformViewId. expect(semantics.platformViewId, null); expect(semantics.rect, const Rect.fromLTWH(0, 0, 200, 100)); // A 200x100 rect positioned at bottom right of a 800x600 box. expect(semantics.transform, Matrix4.translationValues(600, 500, 0)); expect(semantics.childrenCount, 0); viewsController.createCompleter!.complete(); await tester.pumpAndSettle(); expect(semantics.platformViewId, currentViewId + 1); expect(semantics.rect, const Rect.fromLTWH(0, 0, 200, 100)); // A 200x100 rect positioned at bottom right of a 800x600 box. expect(semantics.transform, Matrix4.translationValues(600, 500, 0)); expect(semantics.childrenCount, 0); handle.dispose(); }); testWidgets('AndroidView can take input focus', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.createCompleter = Completer<void>(); final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget( Center( child: Column( children: <Widget>[ const SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), Focus( debugLabel: 'container', child: Container(key: containerKey), ), ], ), ), ); final Focus androidViewFocusWidget = tester.widget( find.descendant( of: find.byType(AndroidView), matching: find.byType(Focus), ), ); final Element containerElement = tester.element(find.byKey(containerKey)); final FocusNode androidViewFocusNode = androidViewFocusWidget.focusNode!; final FocusNode containerFocusNode = Focus.of(containerElement); containerFocusNode.requestFocus(); viewsController.createCompleter!.complete(); await tester.pump(); expect(containerFocusNode.hasFocus, isTrue); expect(androidViewFocusNode.hasFocus, isFalse); viewsController.invokeViewFocused(currentViewId + 1); await tester.pump(); expect(containerFocusNode.hasFocus, isFalse); expect(androidViewFocusNode.hasFocus, isTrue); }); testWidgets('AndroidView sets a platform view text input client when focused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.createCompleter = Completer<void>(); final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget( Center( child: Column( children: <Widget>[ const SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), Focus( debugLabel: 'container', child: Container(key: containerKey), ), ], ), ), ); viewsController.createCompleter!.complete(); final Element containerElement = tester.element(find.byKey(containerKey)); final FocusNode containerFocusNode = Focus.of(containerElement); containerFocusNode.requestFocus(); await tester.pump(); late Map<String, dynamic> lastPlatformViewTextClient; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall call) { if (call.method == 'TextInput.setPlatformViewClient') { lastPlatformViewTextClient = call.arguments as Map<String, dynamic>; } return null; }); viewsController.invokeViewFocused(currentViewId + 1); await tester.pump(); expect(lastPlatformViewTextClient.containsKey('platformViewId'), true); expect(lastPlatformViewTextClient['platformViewId'], currentViewId + 1); }); testWidgets('AndroidView clears platform focus when unfocused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.createCompleter = Completer<void>(); final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget( Center( child: Column( children: <Widget>[ const SizedBox( width: 200.0, height: 100.0, child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), Focus( debugLabel: 'container', child: Container(key: containerKey), ), ], ), ), ); viewsController.createCompleter!.complete(); final Element containerElement = tester.element(find.byKey(containerKey)); final FocusNode containerFocusNode = Focus.of(containerElement); containerFocusNode.requestFocus(); await tester.pump(); viewsController.invokeViewFocused(currentViewId + 1); await tester.pump(); viewsController.lastClearedFocusViewId = null; containerFocusNode.requestFocus(); await tester.pump(); expect(viewsController.lastClearedFocusViewId, currentViewId + 1); }); testWidgets('can set and update clipBehavior', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); // By default, clipBehavior should be Clip.hardEdge final RenderAndroidView renderObject = tester.renderObject( find.descendant( of: find.byType(AndroidView), matching: find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_AndroidPlatformView', ), ), ); expect(renderObject.clipBehavior, equals(Clip.hardEdge)); for (final Clip clip in Clip.values) { await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, clipBehavior: clip, ), ), ), ); expect(renderObject.clipBehavior, clip); } }); testWidgets('clip is handled correctly during resizing', (WidgetTester tester) async { // Regressing test for https://github.com/flutter/flutter/issues/67343 final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); Widget buildView(double width, double height, Clip clipBehavior) { return Center( child: SizedBox( width: width, height: height, child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, clipBehavior: clipBehavior, ), ), ); } await tester.pumpWidget(buildView(200.0, 200.0, Clip.none)); // Resize the view. await tester.pumpWidget(buildView(100.0, 100.0, Clip.none)); // No clip happen when the clip behavior is `Clip.none` . expect(tester.layers.whereType<ClipRectLayer>(), hasLength(0)); // No clip when only the clip behavior changes while the size remains the same. await tester.pumpWidget(buildView(100.0, 100.0, Clip.hardEdge)); expect(tester.layers.whereType<ClipRectLayer>(), hasLength(0)); // Resize trigger clip when the clip behavior is not `Clip.none` . await tester.pumpWidget(buildView(50.0, 100.0, Clip.hardEdge)); expect(tester.layers.whereType<ClipRectLayer>(), hasLength(1)); ClipRectLayer clipRectLayer = tester.layers.whereType<ClipRectLayer>().first; expect(clipRectLayer.clipRect, const Rect.fromLTWH(0.0, 0.0, 50.0, 100.0)); await tester.pumpWidget(buildView(50.0, 50.0, Clip.hardEdge)); expect(tester.layers.whereType<ClipRectLayer>(), hasLength(1)); clipRectLayer = tester.layers.whereType<ClipRectLayer>().first; expect(clipRectLayer.clipRect, const Rect.fromLTWH(0.0, 0.0, 50.0, 50.0)); }); testWidgets('offset is sent to the platform', (WidgetTester tester) async { final FakeAndroidPlatformViewsController viewsController = FakeAndroidPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Padding( padding: EdgeInsets.fromLTRB(10, 20, 0, 0), child: AndroidView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ); await tester.pump(); expect(viewsController.offsets.values, equals(<Offset>[const Offset(10, 20)])); }); }); group('AndroidViewSurface', () { late FakeAndroidViewController controller; setUp(() { controller = FakeAndroidViewController(0); }); testWidgets('AndroidViewSurface sets pointTransformer of view controller', (WidgetTester tester) async { final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ); await tester.pumpWidget(surface); expect(controller.pointTransformer, isNotNull); }); testWidgets('AndroidViewSurface defaults to texture-based rendering', (WidgetTester tester) async { final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ); await tester.pumpWidget(surface); expect(find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_TextureBasedAndroidViewSurface', ), findsOneWidget); }); testWidgets('AndroidViewSurface uses view-based rendering when initially required', (WidgetTester tester) async { controller.requiresViewComposition = true; final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ); await tester.pumpWidget(surface); expect(find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_PlatformLayerBasedAndroidViewSurface', ), findsOneWidget); }); testWidgets('AndroidViewSurface can switch to view-based rendering after creation', (WidgetTester tester) async { final AndroidViewSurface surface = AndroidViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ); await tester.pumpWidget(surface); expect(find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_TextureBasedAndroidViewSurface', ), findsOneWidget); expect(find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_PlatformLayerBasedAndroidViewSurface', ), findsNothing); // Simulate a creation-time switch to view composition. controller.requiresViewComposition = true; for (final PlatformViewCreatedCallback callback in controller.createdCallbacks) { callback(controller.viewId); } await tester.pumpWidget(surface); expect(find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_TextureBasedAndroidViewSurface', ), findsNothing); expect(find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_PlatformLayerBasedAndroidViewSurface', ), findsOneWidget); }); }); group('UiKitView', () { testWidgets('Create UIView', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeUiKitView>[ FakeUiKitView(currentViewId + 1, 'webview'), ]), ); }); testWidgets('Change UIView view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.registerViewType('maps'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'maps', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeUiKitView>[ FakeUiKitView(currentViewId + 2, 'maps'), ]), ); }); testWidgets('Dispose UIView ', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); expect( viewsController.views, isEmpty, ); }); testWidgets('Dispose UIView before creation completed ', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.creationDelay = Completer<void>(); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); viewsController.creationDelay!.complete(); expect( viewsController.views, isEmpty, ); }); testWidgets('UIView survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); final GlobalKey key = GlobalKey(); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr, key: key), ), ), ); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr, key: key), ), ), ); expect( viewsController.views, unorderedEquals(<FakeUiKitView>[ FakeUiKitView(currentViewId + 1, 'webview'), ]), ); }); testWidgets('Create UIView with params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, creationParams: 'creation parameters', creationParamsCodec: StringCodec(), ), ), ), ); final FakeUiKitView fakeView = viewsController.views.first; final Uint8List rawCreationParams = fakeView.creationParams!; final ByteData byteData = ByteData.view( rawCreationParams.buffer, rawCreationParams.offsetInBytes, rawCreationParams.lengthInBytes, ); final dynamic actualParams = const StringCodec().decodeMessage(byteData); expect(actualParams, 'creation parameters'); expect( viewsController.views, unorderedEquals(<FakeUiKitView>[ FakeUiKitView(currentViewId + 1, 'webview', fakeView.creationParams), ]), ); }); testWidgets('UiKitView accepts gestures', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); }); testWidgets('UiKitView transparent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.transparent, layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); expect(numPointerDownsOnParent, 1); }); testWidgets('UiKitView translucent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.translucent, layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(numPointerDownsOnParent, 1); }); testWidgets('UiKitView opaque hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(numPointerDownsOnParent, 0); }); testWidgets('UiKitView can lose gesture arenas', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: Container( margin: const EdgeInsets.all(10.0), child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: const SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(verticalDragAcceptedByParent, true); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); expect(viewsController.gesturesRejected[currentViewId + 1], 1); }); testWidgets('UiKitView tap gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool gestureAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { gestureAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<VerticalDragGestureRecognizer>( () { final VerticalDragGestureRecognizer recognizer = VerticalDragGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(gestureAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView long press gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool gestureAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onLongPress: () { gestureAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<LongPressGestureRecognizer>( () { final LongPressGestureRecognizer recognizer = LongPressGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); await tester.longPressAt(const Offset(50.0, 50.0)); expect(gestureAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView drag gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<TapGestureRecognizer>( () { final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); await tester.tapAt(const Offset(50.0, 50.0)); expect(verticalDragAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView can claim gesture after all pointers are up', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; // The long press recognizer rejects the gesture after the AndroidView gets the pointer up event. // This test makes sure that the Android view can win the gesture after it got the pointer up event. await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, onLongPress: () { }, child: const SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(verticalDragAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView rebuilt during gesture', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView with eager gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( () { final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); // Normally (without the eager gesture recognizer) after just the pointer down event // no gesture arena member will claim the arena (so no motion events will be dispatched to // the Android view). Here we assert that with the eager recognizer in the gesture team the // pointer down event is immediately dispatched. expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets('UiKitView rejects gestures absorbed by siblings', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Stack( alignment: Alignment.topLeft, children: <Widget>[ const UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), Container( color: const Color.fromARGB(255, 255, 255, 255), width: 100, height: 100, ), ], ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesRejected[currentViewId + 1], 1); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); }); testWidgets( 'UiKitView rejects gestures absorbed by siblings if the touch is outside of the platform view bounds but inside platform view frame', (WidgetTester tester) async { // UiKitView is positioned at (left=0, top=100, right=300, bottom=600). // Opaque container is on top of the UiKitView positioned at (left=0, top=500, right=300, bottom=600). // Touch on (550, 150) is expected to be absorbed by the container. final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( SizedBox( width: 300, height: 600, child: Stack( alignment: Alignment.topLeft, children: <Widget>[ Transform.translate( offset: const Offset(0, 100), child: const SizedBox( width: 300, height: 500, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), Transform.translate( offset: const Offset(0, 500), child: Container( color: const Color.fromARGB(255, 255, 255, 255), width: 300, height: 100, ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(150, 550)); await gesture.up(); expect(viewsController.gesturesRejected[currentViewId + 1], 1); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); }, ); testWidgets('UiKitView rebuilt with same gestureRecognizers', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { factoryInvocationCount += 1; final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; } await tester.pumpWidget( UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>(constructRecognizer), }, layoutDirection: TextDirection.ltr, ), ); await tester.pumpWidget( UiKitView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.translucent, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>(constructRecognizer), }, layoutDirection: TextDirection.ltr, ), ); expect(factoryInvocationCount, 1); }); testWidgets('UiKitView can take input focus', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget( Center( child: Column( children: <Widget>[ const SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), Focus( debugLabel: 'container', child: Container(key: containerKey), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final Focus uiKitViewFocusWidget = tester.widget( find.descendant( of: find.byType(UiKitView), matching: find.byType(Focus), ), ); final FocusNode uiKitViewFocusNode = uiKitViewFocusWidget.focusNode!; final Element containerElement = tester.element(find.byKey(containerKey)); final FocusNode containerFocusNode = Focus.of(containerElement); containerFocusNode.requestFocus(); await tester.pump(); expect(containerFocusNode.hasFocus, isTrue); expect(uiKitViewFocusNode.hasFocus, isFalse); viewsController.invokeViewFocused(currentViewId + 1); await tester.pump(); expect(containerFocusNode.hasFocus, isFalse); expect(uiKitViewFocusNode.hasFocus, isTrue); }); testWidgets('UiKitView sends TextInput.setPlatformViewClient when focused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr) ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final Focus uiKitViewFocusWidget = tester.widget( find.descendant( of: find.byType(UiKitView), matching: find.byType(Focus), ), ); final FocusNode uiKitViewFocusNode = uiKitViewFocusWidget.focusNode!; late Map<String, dynamic> channelArguments; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall call) { if (call.method == 'TextInput.setPlatformViewClient') { channelArguments = call.arguments as Map<String, dynamic>; } return null; }); expect(uiKitViewFocusNode.hasFocus, false); uiKitViewFocusNode.requestFocus(); await tester.pump(); expect(uiKitViewFocusNode.hasFocus, true); expect(channelArguments['platformViewId'], currentViewId + 1); }); testWidgets('FocusNode is disposed on UIView dispose', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); // casting to dynamic is required since the state class is private. // ignore: invalid_assignment final FocusNode node = (tester.state(find.byType(UiKitView)) as dynamic).focusNode; expect(() => ChangeNotifier.debugAssertNotDisposed(node), isNot(throwsAssertionError)); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); expect(() => ChangeNotifier.debugAssertNotDisposed(node), throwsAssertionError); }); testWidgets('UiKitView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Semantics( container: true, child: const Align( alignment: Alignment.bottomRight, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final SemanticsNode semantics = tester.getSemantics( find.descendant( of: find.byType(UiKitView), matching: find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_UiKitPlatformView', ), ), ); expect(semantics.platformViewId, currentViewId + 1); expect(semantics.rect, const Rect.fromLTWH(0, 0, 200, 100)); // A 200x100 rect positioned at bottom right of a 800x600 box. expect(semantics.transform, Matrix4.translationValues(600, 500, 0)); expect(semantics.childrenCount, 0); handle.dispose(); }); }); group('AppKitView', () { testWidgets('Create AppView', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAppKitView>[ FakeAppKitView(currentViewId + 1, 'webview'), ]), ); }); testWidgets('Change AppKitView view type', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.registerViewType('maps'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'maps', layoutDirection: TextDirection.ltr), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAppKitView>[ FakeAppKitView(currentViewId + 2, 'maps'), ]), ); }); testWidgets('Dispose AppKitView ', (WidgetTester tester) async { final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); expect( viewsController.views, isEmpty, ); }); testWidgets('Dispose AppKitView before creation completed ', (WidgetTester tester) async { final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); viewsController.creationDelay = Completer<void>(); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); viewsController.creationDelay!.complete(); expect( viewsController.views, isEmpty, ); }); testWidgets('AppKitView survives widget tree change', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); final GlobalKey key = GlobalKey(); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr, key: key), ), ), ); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr, key: key), ), ), ); expect( viewsController.views, unorderedEquals(<FakeAppKitView>[ FakeAppKitView(currentViewId + 1, 'webview'), ]), ); }); testWidgets('Create AppKitView with params', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, creationParams: 'creation parameters', creationParamsCodec: StringCodec(), ), ), ), ); final FakeAppKitView fakeView = viewsController.views.first; final Uint8List rawCreationParams = fakeView.creationParams!; final ByteData byteData = ByteData.view( rawCreationParams.buffer, rawCreationParams.offsetInBytes, rawCreationParams.lengthInBytes, ); final dynamic actualParams = const StringCodec().decodeMessage(byteData); expect(actualParams, 'creation parameters'); expect( viewsController.views, unorderedEquals(<FakeAppKitView>[ FakeAppKitView(currentViewId + 1, 'webview', fakeView.creationParams), ]), ); }); // TODO(schectman): De-skip the following tests once macOS gesture recognizers are present. // https://github.com/flutter/flutter/issues/128519 testWidgets('AppKitView accepts gestures', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); }, skip: true); // https://github.com/flutter/flutter/issues/128519 testWidgets('AppKitView transparent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.transparent, layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); expect(numPointerDownsOnParent, 1); }, skip: true); // https://github.com/flutter/flutter/issues/128519 testWidgets('AppKitView translucent hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.translucent, layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(numPointerDownsOnParent, 1); }, skip: true); // https://github.com/flutter/flutter/issues/128519 testWidgets('AppKitView opaque hit test behavior', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); int numPointerDownsOnParent = 0; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Stack( children: <Widget>[ Listener( behavior: HitTestBehavior.opaque, onPointerDown: (PointerDownEvent e) { numPointerDownsOnParent++; }, ), const Positioned( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(numPointerDownsOnParent, 0); }, skip: true); // https://github.com/flutter/flutter/issues/128519 testWidgets('UiKitView can lose gesture arenas', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: Container( margin: const EdgeInsets.all(10.0), child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: const SizedBox( width: 200.0, height: 100.0, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(verticalDragAcceptedByParent, true); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); expect(viewsController.gesturesRejected[currentViewId + 1], 1); }); testWidgets('UiKitView tap gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool gestureAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { gestureAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<VerticalDragGestureRecognizer>( () { final VerticalDragGestureRecognizer recognizer = VerticalDragGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(gestureAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView long press gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool gestureAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onLongPress: () { gestureAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<LongPressGestureRecognizer>( () { final LongPressGestureRecognizer recognizer = LongPressGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); await tester.longPressAt(const Offset(50.0, 50.0)); expect(gestureAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView drag gesture recognizers', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<TapGestureRecognizer>( () { final TapGestureRecognizer recognizer = TapGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); await tester.tapAt(const Offset(50.0, 50.0)); expect(verticalDragAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView can claim gesture after all pointers are up', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); bool verticalDragAcceptedByParent = false; // The long press recognizer rejects the gesture after the AndroidView gets the pointer up event. // This test makes sure that the Android view can win the gesture after it got the pointer up event. await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, onLongPress: () { }, child: const SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(verticalDragAcceptedByParent, false); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView rebuilt during gesture', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await tester.pumpWidget( const Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ); await gesture.up(); expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); }); testWidgets('UiKitView with eager gesture recognizer', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { }, child: SizedBox( width: 200.0, height: 100.0, child: UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( () { final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); // Normally (without the eager gesture recognizer) after just the pointer down event // no gesture arena member will claim the arena (so no motion events will be dispatched to // the Android view). Here we assert that with the eager recognizer in the gesture team the // pointer down event is immediately dispatched. expect(viewsController.gesturesAccepted[currentViewId + 1], 1); expect(viewsController.gesturesRejected[currentViewId + 1], 0); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets('UiKitView rejects gestures absorbed by siblings', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Stack( alignment: Alignment.topLeft, children: <Widget>[ const UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), Container( color: const Color.fromARGB(255, 255, 255, 255), width: 100, height: 100, ), ], ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(viewsController.gesturesRejected[currentViewId + 1], 1); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); }); testWidgets( 'UiKitView rejects gestures absorbed by siblings if the touch is outside of the platform view bounds but inside platform view frame', (WidgetTester tester) async { // UiKitView is positioned at (left=0, top=100, right=300, bottom=600). // Opaque container is on top of the UiKitView positioned at (left=0, top=500, right=300, bottom=600). // Touch on (550, 150) is expected to be absorbed by the container. final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( SizedBox( width: 300, height: 600, child: Stack( alignment: Alignment.topLeft, children: <Widget>[ Transform.translate( offset: const Offset(0, 100), child: const SizedBox( width: 300, height: 500, child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), Transform.translate( offset: const Offset(0, 500), child: Container( color: const Color.fromARGB(255, 255, 255, 255), width: 300, height: 100, ), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final TestGesture gesture = await tester.startGesture(const Offset(150, 550)); await gesture.up(); expect(viewsController.gesturesRejected[currentViewId + 1], 1); expect(viewsController.gesturesAccepted[currentViewId + 1], 0); }, ); testWidgets('UiKitView rebuilt with same gestureRecognizers', (WidgetTester tester) async { final FakeIosPlatformViewsController viewsController = FakeIosPlatformViewsController(); viewsController.registerViewType('webview'); int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { factoryInvocationCount += 1; final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; } await tester.pumpWidget( UiKitView( viewType: 'webview', gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>(constructRecognizer), }, layoutDirection: TextDirection.ltr, ), ); await tester.pumpWidget( UiKitView( viewType: 'webview', hitTestBehavior: PlatformViewHitTestBehavior.translucent, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<EagerGestureRecognizer>(constructRecognizer), }, layoutDirection: TextDirection.ltr, ), ); expect(factoryInvocationCount, 1); }); testWidgets('AppKitView can take input focus', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); final GlobalKey containerKey = GlobalKey(); await tester.pumpWidget( Center( child: Column( children: <Widget>[ const SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), Focus( debugLabel: 'container', child: Container(key: containerKey), ), ], ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final Focus uiKitViewFocusWidget = tester.widget( find.descendant( of: find.byType(AppKitView), matching: find.byType(Focus), ), ); final FocusNode uiKitViewFocusNode = uiKitViewFocusWidget.focusNode!; final Element containerElement = tester.element(find.byKey(containerKey)); final FocusNode containerFocusNode = Focus.of(containerElement); containerFocusNode.requestFocus(); await tester.pump(); expect(containerFocusNode.hasFocus, isTrue); expect(uiKitViewFocusNode.hasFocus, isFalse); viewsController.invokeViewFocused(currentViewId + 1); await tester.pump(); expect(containerFocusNode.hasFocus, isFalse); expect(uiKitViewFocusNode.hasFocus, isTrue); }); testWidgets('AppKitView sends TextInput.setPlatformViewClient when focused', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr) ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final Focus uiKitViewFocusWidget = tester.widget( find.descendant( of: find.byType(AppKitView), matching: find.byType(Focus), ), ); final FocusNode uiKitViewFocusNode = uiKitViewFocusWidget.focusNode!; late Map<String, dynamic> channelArguments; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall call) { if (call.method == 'TextInput.setPlatformViewClient') { channelArguments = call.arguments as Map<String, dynamic>; } return null; }); expect(uiKitViewFocusNode.hasFocus, false); uiKitViewFocusNode.requestFocus(); await tester.pump(); expect(uiKitViewFocusNode.hasFocus, true); expect(channelArguments['platformViewId'], currentViewId + 1); }); testWidgets('FocusNode is disposed on UIView dispose', (WidgetTester tester) async { final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, child: AppKitView(viewType: 'webview', layoutDirection: TextDirection.ltr), ), ), ); // casting to dynamic is required since the state class is private. // ignore: invalid_assignment final FocusNode node = (tester.state(find.byType(AppKitView)) as dynamic).focusNode; expect(() => ChangeNotifier.debugAssertNotDisposed(node), isNot(throwsAssertionError)); await tester.pumpWidget( const Center( child: SizedBox( width: 200.0, height: 100.0, ), ), ); expect(() => ChangeNotifier.debugAssertNotDisposed(node), throwsAssertionError); }); testWidgets('AppKitView has correct semantics', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); expect(currentViewId, greaterThanOrEqualTo(0)); final FakeMacosPlatformViewsController viewsController = FakeMacosPlatformViewsController(); viewsController.registerViewType('webview'); await tester.pumpWidget( Semantics( container: true, child: const Align( alignment: Alignment.bottomRight, child: SizedBox( width: 200.0, height: 100.0, child: AppKitView( viewType: 'webview', layoutDirection: TextDirection.ltr, ), ), ), ), ); // First frame is before the platform view was created so the render object // is not yet in the tree. await tester.pump(); final SemanticsNode semantics = tester.getSemantics( find.descendant( of: find.byType(AppKitView), matching: find.byWidgetPredicate( (Widget widget) => widget.runtimeType.toString() == '_AppKitPlatformView', ), ), ); expect(semantics.platformViewId, currentViewId + 1); expect(semantics.rect, const Rect.fromLTWH(0, 0, 200, 100)); // A 200x100 rect positioned at bottom right of a 800x600 box. expect(semantics.transform, Matrix4.translationValues(600, 500, 0)); expect(semantics.childrenCount, 0); handle.dispose(); }); }); group('Common PlatformView', () { late FakePlatformViewController controller; setUp(() { controller = FakePlatformViewController(0); }); testWidgets('PlatformViewSurface should create platform view layer', (WidgetTester tester) async { final PlatformViewSurface surface = PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ); await tester.pumpWidget(surface); expect(() => tester.layers.whereType<PlatformViewLayer>().first, returnsNormally); }); testWidgets('PlatformViewSurface can lose gesture arenas', (WidgetTester tester) async { bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: Container( margin: const EdgeInsets.all(10.0), child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: PlatformViewSurface( controller: controller, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ), ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(verticalDragAcceptedByParent, true); expect( controller.dispatchedPointerEvents, isEmpty, ); }); testWidgets('PlatformViewSurface gesture recognizers dispatch events', (WidgetTester tester) async { bool verticalDragAcceptedByParent = false; await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, child: SizedBox( width: 200.0, height: 100.0, child: PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<VerticalDragGestureRecognizer>( () { final VerticalDragGestureRecognizer recognizer = VerticalDragGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await gesture.up(); expect(verticalDragAcceptedByParent, false); expect( controller.dispatchedPointerEvents.length, 3, ); }); testWidgets('PlatformViewSurface can claim gesture after all pointers are up', (WidgetTester tester) async { bool verticalDragAcceptedByParent = false; // The long press recognizer rejects the gesture after the PlatformViewSurface gets the pointer up event. // This test makes sure that the PlatformViewSurface can win the gesture after it got the pointer up event. await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { verticalDragAcceptedByParent = true; }, onLongPress: () { }, child: SizedBox( width: 200.0, height: 100.0, child: PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.up(); expect(verticalDragAcceptedByParent, false); expect( controller.dispatchedPointerEvents.length, 2, ); }); testWidgets('PlatformViewSurface rebuilt during gesture', (WidgetTester tester) async { await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); await gesture.moveBy(const Offset(0.0, 100.0)); await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: SizedBox( width: 200.0, height: 100.0, child: PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, ), ), ), ); await gesture.up(); expect( controller.dispatchedPointerEvents.length, 3, ); }); testWidgets('PlatformViewSurface with eager gesture recognizer', (WidgetTester tester) async { await tester.pumpWidget( Align( alignment: Alignment.topLeft, child: GestureDetector( onVerticalDragStart: (DragStartDetails d) { }, child: SizedBox( width: 200.0, height: 100.0, child: PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( () { final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; }, ), }, ), ), ), ), ); final TestGesture gesture = await tester.startGesture(const Offset(50.0, 50.0)); // Normally (without the eager gesture recognizer) after just the pointer down event // no gesture arena member will claim the arena (so no motion events will be dispatched to // the PlatformViewSurface). Here we assert that with the eager recognizer in the gesture team the // pointer down event is immediately dispatched. expect( controller.dispatchedPointerEvents.length, 1, ); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets('PlatformViewRenderBox reconstructed with same gestureRecognizers', (WidgetTester tester) async { int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { ++factoryInvocationCount; final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; } final PlatformViewSurface platformViewSurface = PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( constructRecognizer, ), }, ); await tester.pumpWidget(platformViewSurface); await tester.pumpWidget(const SizedBox.shrink()); await tester.pumpWidget(platformViewSurface); expect(factoryInvocationCount, 2); }); testWidgets('PlatformViewSurface rebuilt with same gestureRecognizers', (WidgetTester tester) async { int factoryInvocationCount = 0; EagerGestureRecognizer constructRecognizer() { ++factoryInvocationCount; final EagerGestureRecognizer recognizer = EagerGestureRecognizer(); addTearDown(recognizer.dispose); return recognizer; } await tester.pumpWidget( PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( constructRecognizer, ), }, ), ); await tester.pumpWidget( PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>( constructRecognizer, ), }, ), ); expect(factoryInvocationCount, 1); }); testWidgets( 'PlatformViewLink Widget init, should create a placeholder widget before onPlatformViewCreated and a PlatformViewSurface after', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); late int createdPlatformViewId; late PlatformViewCreatedCallback onPlatformViewCreatedCallBack; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { onPlatformViewCreatedCallBack = params.onPlatformViewCreated; createdPlatformViewId = params.id; return FakePlatformViewController(params.id)..create(); }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget(platformViewLink); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['PlatformViewLink', '_PlatformViewPlaceHolder']), ); onPlatformViewCreatedCallBack(createdPlatformViewId); await tester.pump(); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['PlatformViewLink', 'Focus', '_FocusInheritedScope', 'Semantics', 'PlatformViewSurface']), ); expect(createdPlatformViewId, currentViewId + 1); }, ); testWidgets( 'PlatformViewLink widget should not trigger creation with an empty size', (WidgetTester tester) async { late PlatformViewController controller; final Widget widget = Center(child: SizedBox( height: 0, child: PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { controller = FakeAndroidViewController(params.id, requiresSize: true); controller.create(); // This test should be simulating one of the texture-based display // modes, where `create` is a no-op when not provided a size, and // creation is triggered via a later call to setSize, or to `create` // with a size. expect(controller.awaitingCreation, true); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ) )); await tester.pumpWidget(widget); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['Center', 'SizedBox', 'PlatformViewLink', '_PlatformViewPlaceHolder']), ); // 'create' should not have been called by PlatformViewLink, since its // size is empty. expect(controller.awaitingCreation, true); }, ); testWidgets( 'PlatformViewLink calls create when needed for Android texture display modes', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); late int createdPlatformViewId; late PlatformViewCreatedCallback onPlatformViewCreatedCallBack; late PlatformViewController controller; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { onPlatformViewCreatedCallBack = params.onPlatformViewCreated; createdPlatformViewId = params.id; controller = FakeAndroidViewController(params.id, requiresSize: true); controller.create(); // This test should be simulating one of the texture-based display // modes, where `create` is a no-op when not provided a size, and // creation is triggered via a later call to setSize, or to `create` // with a size. expect(controller.awaitingCreation, true); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget(platformViewLink); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['PlatformViewLink', '_PlatformViewPlaceHolder']), ); // Layout should have triggered a create call. Simulate the callback // that the real controller would make after creation. expect(controller.awaitingCreation, false); onPlatformViewCreatedCallBack(createdPlatformViewId); await tester.pump(); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['PlatformViewLink', 'Focus', '_FocusInheritedScope', 'Semantics', 'PlatformViewSurface']), ); expect(createdPlatformViewId, currentViewId + 1); }, ); testWidgets('PlatformViewLink includes offset in create call when using texture layer', (WidgetTester tester) async { addTearDown(tester.view.reset); late FakeAndroidViewController controller; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { controller = FakeAndroidViewController(params.id, requiresSize: true); controller.create(); // This test should be simulating one of the texture-based display // modes, where `create` is a no-op when not provided a size, and // creation is triggered via a later call to setSize, or to `create` // with a size. expect(controller.awaitingCreation, true); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); tester.view.physicalSize= const Size(400, 200); tester.view.devicePixelRatio = 1.0; await tester.pumpWidget( Container( constraints: const BoxConstraints.expand(), alignment: Alignment.center, child: SizedBox( width: 100, height: 50, child: platformViewLink, ), ) ); expect(controller.createPosition, const Offset(150, 75)); }); testWidgets( 'PlatformViewLink does not double-call create for Android Hybrid Composition', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); late int createdPlatformViewId; late PlatformViewCreatedCallback onPlatformViewCreatedCallBack; late PlatformViewController controller; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { onPlatformViewCreatedCallBack = params.onPlatformViewCreated; createdPlatformViewId = params.id; controller = FakeAndroidViewController(params.id); controller.create(); // This test should be simulating Hybrid Composition mode, where // `create` takes effect immediately. expect(controller.awaitingCreation, false); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget(platformViewLink); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['PlatformViewLink', '_PlatformViewPlaceHolder']), ); onPlatformViewCreatedCallBack(createdPlatformViewId); await tester.pump(); expect( tester.allWidgets.map((Widget widget) => widget.runtimeType.toString()).toList(), containsAllInOrder(<String>['PlatformViewLink', 'Focus', '_FocusInheritedScope', 'Semantics', 'PlatformViewSurface']), ); expect(createdPlatformViewId, currentViewId + 1); }, ); testWidgets('PlatformViewLink Widget dispose', (WidgetTester tester) async { late FakePlatformViewController disposedController; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { disposedController = FakePlatformViewController(params.id); params.onPlatformViewCreated(params.id); return disposedController; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget(platformViewLink); await tester.pumpWidget(Container()); expect(disposedController.disposed, true); }); testWidgets('PlatformViewLink handles onPlatformViewCreated when disposed', (WidgetTester tester) async { late PlatformViewCreationParams creationParams; late FakePlatformViewController controller; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { creationParams = params; return controller = FakePlatformViewController(params.id); }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget(platformViewLink); await tester.pumpWidget(Container()); expect(controller.disposed, true); expect(() => creationParams.onPlatformViewCreated(creationParams.id), returnsNormally); }); testWidgets('PlatformViewLink widget survives widget tree change', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final List<int> ids = <int>[]; FakePlatformViewController controller; PlatformViewLink createPlatformViewLink() { return PlatformViewLink( key: key, viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { ids.add(params.id); controller = FakePlatformViewController(params.id); params.onPlatformViewCreated(params.id); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); } await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: createPlatformViewLink(), ), ), ); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: createPlatformViewLink(), ), ), ); expect( ids, unorderedEquals(<int>[ currentViewId + 1, ]), ); }); testWidgets('PlatformViewLink re-initializes when view type changes', (WidgetTester tester) async { final int currentViewId = platformViewsRegistry.getNextPlatformViewId(); final List<int> ids = <int>[]; final List<int> surfaceViewIds = <int>[]; final List<String> viewTypes = <String>[]; PlatformViewLink createPlatformViewLink(String viewType) { return PlatformViewLink( viewType: viewType, onCreatePlatformView: (PlatformViewCreationParams params) { ids.add(params.id); viewTypes.add(params.viewType); controller = FakePlatformViewController(params.id); params.onPlatformViewCreated(params.id); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { surfaceViewIds.add(controller.viewId); return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); } await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: createPlatformViewLink('webview'), ), ), ); await tester.pumpWidget( Center( child: SizedBox( width: 200.0, height: 100.0, child: createPlatformViewLink('maps'), ), ), ); expect( ids, unorderedEquals(<int>[ currentViewId + 1, currentViewId + 2, ]), ); expect( surfaceViewIds, unorderedEquals(<int>[ currentViewId + 1, currentViewId + 2, ]), ); expect( viewTypes, unorderedEquals(<String>[ 'webview', 'maps', ]), ); }); testWidgets('PlatformViewLink can take any widget to return in the SurfaceFactory', (WidgetTester tester) async { final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { params.onPlatformViewCreated(params.id); return FakePlatformViewController(params.id); }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return Container(); }, ); await tester.pumpWidget(platformViewLink); expect(() => tester.allWidgets.whereType<Container>().first, returnsNormally); }); testWidgets('PlatformViewLink manages the focus properly', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); late FakePlatformViewController controller; late ValueChanged<bool> focusChanged; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'webview', onCreatePlatformView: (PlatformViewCreationParams params) { params.onPlatformViewCreated(params.id); focusChanged = params.onFocusChanged; controller = FakePlatformViewController(params.id); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget( Center( child: Column( children: <Widget>[ SizedBox(width: 300, height: 300, child: platformViewLink), Focus( debugLabel: 'container', child: Container(key: containerKey), ), ], ), ), ); final Focus platformViewFocusWidget = tester.widget( find.descendant( of: find.byType(PlatformViewLink), matching: find.byType(Focus), ), ); final FocusNode platformViewFocusNode = platformViewFocusWidget.focusNode!; final Element containerElement = tester.element(find.byKey(containerKey)); final FocusNode containerFocusNode = Focus.of(containerElement); containerFocusNode.requestFocus(); await tester.pump(); expect(containerFocusNode.hasFocus, true); expect(platformViewFocusNode.hasFocus, false); // ask the platform view to gain focus focusChanged(true); await tester.pump(); expect(containerFocusNode.hasFocus, false); expect(platformViewFocusNode.hasFocus, true); expect(controller.focusCleared, false); // ask the container to gain focus, and the platform view should clear focus. containerFocusNode.requestFocus(); await tester.pump(); expect(containerFocusNode.hasFocus, true); expect(platformViewFocusNode.hasFocus, false); expect(controller.focusCleared, true); }); testWidgets('PlatformViewLink sets a platform view text input client when focused', (WidgetTester tester) async { late FakePlatformViewController controller; late int viewId; final PlatformViewLink platformViewLink = PlatformViewLink( viewType: 'test', onCreatePlatformView: (PlatformViewCreationParams params) { viewId = params.id; params.onPlatformViewCreated(params.id); controller = FakePlatformViewController(params.id); return controller; }, surfaceFactory: (BuildContext context, PlatformViewController controller) { return PlatformViewSurface( gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ); }, ); await tester.pumpWidget(SizedBox(width: 300, height: 300, child: platformViewLink)); final Focus platformViewFocusWidget = tester.widget( find.descendant( of: find.byType(PlatformViewLink), matching: find.byType(Focus), ), ); final FocusNode? focusNode = platformViewFocusWidget.focusNode; expect(focusNode, isNotNull); expect(focusNode!.hasFocus, false); late Map<String, dynamic> lastPlatformViewTextClient; tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, (MethodCall call) { if (call.method == 'TextInput.setPlatformViewClient') { lastPlatformViewTextClient = call.arguments as Map<String, dynamic>; } return null; }); platformViewFocusWidget.focusNode!.requestFocus(); await tester.pump(); expect(focusNode.hasFocus, true); expect(lastPlatformViewTextClient.containsKey('platformViewId'), true); expect(lastPlatformViewTextClient['platformViewId'], viewId); }); }); testWidgets('Platform views respect hitTestBehavior', (WidgetTester tester) async { final FakePlatformViewController controller = FakePlatformViewController(0); final List<String> logs = <String>[]; // ------------------------- // | MouseRegion1 | MouseRegion1 // | |-----------------| | | // | | MouseRegion2 | | |- Stack // | | |---------| | | | // | | |Platform | | | |- MouseRegion2 // | | |View | | | |- PlatformView // | | |---------| | | // | | | | // | |-----------------| | // | | // ------------------------- Widget scaffold(Widget target) { return Directionality( textDirection: TextDirection.ltr, child: Center( child: SizedBox( width: 600, height: 600, child: MouseRegion( onEnter: (_) { logs.add('enter1'); }, onExit: (_) { logs.add('exit1'); }, cursor: SystemMouseCursors.forbidden, child: Stack( children: <Widget>[ Center( child: SizedBox( width: 400, height: 400, child: MouseRegion( onEnter: (_) { logs.add('enter2'); }, onExit: (_) { logs.add('exit2'); }, cursor: SystemMouseCursors.text, ), ), ), Center( child: SizedBox( width: 200, height: 200, child: target, ), ), ], ), ), ), ), ); } final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse, pointer: 0); // Test: Opaque await tester.pumpWidget( scaffold(PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, )), ); logs.clear(); await gesture.moveTo(const Offset(400, 300)); expect(logs, <String>['enter1']); expect(controller.dispatchedPointerEvents, hasLength(1)); expect(controller.dispatchedPointerEvents[0], isA<PointerHoverEvent>()); logs.clear(); controller.dispatchedPointerEvents.clear(); // Test: changing no option does not trigger events await tester.pumpWidget( scaffold(PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, )), ); expect(logs, isEmpty); expect(controller.dispatchedPointerEvents, isEmpty); // Test: Translucent await tester.pumpWidget( scaffold(PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.translucent, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, )), ); expect(logs, <String>['enter2']); expect(controller.dispatchedPointerEvents, isEmpty); logs.clear(); await gesture.moveBy(const Offset(1, 1)); expect(logs, isEmpty); expect(controller.dispatchedPointerEvents, hasLength(1)); expect(controller.dispatchedPointerEvents[0], isA<PointerHoverEvent>()); expect(controller.dispatchedPointerEvents[0].position, const Offset(401, 301)); expect(controller.dispatchedPointerEvents[0].localPosition, const Offset(101, 101)); controller.dispatchedPointerEvents.clear(); // Test: Transparent await tester.pumpWidget( scaffold(PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.transparent, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, )), ); expect(logs, isEmpty); expect(controller.dispatchedPointerEvents, isEmpty); await gesture.moveBy(const Offset(1, 1)); expect(logs, isEmpty); expect(controller.dispatchedPointerEvents, isEmpty); // Test: Back to opaque await tester.pumpWidget( scaffold(PlatformViewSurface( controller: controller, hitTestBehavior: PlatformViewHitTestBehavior.opaque, gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{}, )), ); expect(logs, <String>['exit2']); expect(controller.dispatchedPointerEvents, isEmpty); logs.clear(); await gesture.moveBy(const Offset(1, 1)); expect(logs, isEmpty); expect(controller.dispatchedPointerEvents, hasLength(1)); expect(controller.dispatchedPointerEvents[0], isA<PointerHoverEvent>()); }); testWidgets('HtmlElementView can be instantiated', (WidgetTester tester) async { late final Widget htmlElementView; expect(() { htmlElementView = const HtmlElementView(viewType: 'webview'); }, returnsNormally); await tester.pumpWidget( Center( child: SizedBox( width: 100, height: 100, child: htmlElementView, ), ) ); await tester.pumpAndSettle(); // This file runs on non-web platforms, so we expect `HtmlElementView` to // fail. final dynamic exception = tester.takeException(); expect(exception, isUnimplementedError); expect(exception.toString(), contains('HtmlElementView is only available on Flutter Web')); }); }
flutter/packages/flutter/test/widgets/platform_view_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/platform_view_test.dart", "repo_id": "flutter", "token_count": 65720 }
767
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'restoration.dart'; void main() { group('UnmanagedRestorationScope', () { testWidgets('makes bucket available to descendants', (WidgetTester tester) async { final RestorationBucket bucket1 = RestorationBucket.empty( restorationId: 'foo', debugOwner: 'owner', ); addTearDown(bucket1.dispose); await tester.pumpWidget( UnmanagedRestorationScope( bucket: bucket1, child: const BucketSpy(), ), ); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket, bucket1); // Notifies when bucket changes. final RestorationBucket bucket2 = RestorationBucket.empty( restorationId: 'foo2', debugOwner: 'owner', ); addTearDown(bucket2.dispose); await tester.pumpWidget( UnmanagedRestorationScope( bucket: bucket2, child: const BucketSpy(), ), ); expect(state.bucket, bucket2); }); testWidgets('null bucket disables restoration', (WidgetTester tester) async { await tester.pumpWidget( const UnmanagedRestorationScope( child: BucketSpy(), ), ); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket, isNull); }); }); group('RestorationScope', () { testWidgets('asserts when none is found', (WidgetTester tester) async { late BuildContext capturedContext; await tester.pumpWidget(WidgetsApp( color: const Color(0xD0FF0000), builder: (_, __) { return RestorationScope( restorationId: 'test', child: Builder( builder: (BuildContext context) { capturedContext = context; return Container(); } ) ); }, )); expect( () { RestorationScope.of(capturedContext); }, throwsA(isA<FlutterError>().having( (FlutterError error) => error.message, 'message', contains('State restoration must be enabled for a RestorationScope'), )), ); await tester.pumpWidget(WidgetsApp( restorationScopeId: 'test scope', color: const Color(0xD0FF0000), builder: (_, __) { return RestorationScope( restorationId: 'test', child: Builder( builder: (BuildContext context) { capturedContext = context; return Container(); } ) ); }, )); final UnmanagedRestorationScope scope = tester.widget(find.byType(UnmanagedRestorationScope).last); expect(RestorationScope.of(capturedContext), scope.bucket); }); testWidgets('makes bucket available to descendants', (WidgetTester tester) async { const String id = 'hello world 1234'; final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = <String, dynamic>{}; final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: rawData); addTearDown(root.dispose); expect(rawData, isEmpty); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: id, child: BucketSpy(), ), ), ); manager.doSerialization(); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket!.restorationId, id); expect((rawData[childrenMapKey] as Map<Object?, Object?>).containsKey(id), isTrue); }); testWidgets('bucket for descendants contains data claimed from parent', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); addTearDown(root.dispose); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: 'child1', child: BucketSpy(), ), ), ); manager.doSerialization(); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket!.restorationId, 'child1'); expect(state.bucket!.read<int>('foo'), 22); }); testWidgets('renames existing bucket when new ID is provided', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: _createRawDataSet()); addTearDown(root.dispose); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: 'child1', child: BucketSpy(), ), ), ); manager.doSerialization(); // Claimed existing bucket with data. final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket!.restorationId, 'child1'); expect(state.bucket!.read<int>('foo'), 22); final RestorationBucket bucket = state.bucket!; // Rename the existing bucket. await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: 'something else', child: BucketSpy(), ), ), ); manager.doSerialization(); expect(state.bucket!.restorationId, 'something else'); expect(state.bucket!.read<int>('foo'), 22); expect(state.bucket, same(bucket)); }); testWidgets('Disposing a scope removes its data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = _createRawDataSet(); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: rawData); addTearDown(root.dispose); expect((rawData[childrenMapKey] as Map<String, dynamic>).containsKey('child1'), isTrue); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: 'child1', child: BucketSpy(), ), ), ); manager.doSerialization(); expect((rawData[childrenMapKey] as Map<String, dynamic>).containsKey('child1'), isTrue); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: Container(), ), ); manager.doSerialization(); expect((rawData[childrenMapKey] as Map<String, dynamic>).containsKey('child1'), isFalse); }); testWidgets('no bucket for descendants when id is null', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: <String, dynamic>{}); addTearDown(root.dispose); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: null, child: BucketSpy(), ), ), ); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket, isNull); // Change id to non-null. await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: 'foo', child: BucketSpy(), ), ), ); manager.doSerialization(); expect(state.bucket, isNotNull); expect(state.bucket!.restorationId, 'foo'); // Change id back to null. await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: const RestorationScope( restorationId: null, child: BucketSpy(), ), ), ); manager.doSerialization(); expect(state.bucket, isNull); }); testWidgets('no bucket for descendants when scope is null', (WidgetTester tester) async { final Key scopeKey = GlobalKey(); await tester.pumpWidget( RestorationScope( key: scopeKey, restorationId: 'foo', child: const BucketSpy(), ), ); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket, isNull); // Move it under a valid scope. final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: <String, dynamic>{}); addTearDown(root.dispose); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: RestorationScope( key: scopeKey, restorationId: 'foo', child: const BucketSpy(), ), ), ); manager.doSerialization(); expect(state.bucket, isNotNull); expect(state.bucket!.restorationId, 'foo'); // Move out of scope again. await tester.pumpWidget( RestorationScope( key: scopeKey, restorationId: 'foo', child: const BucketSpy(), ), ); manager.doSerialization(); expect(state.bucket, isNull); }); testWidgets('no bucket for descendants when scope and id are null', (WidgetTester tester) async { await tester.pumpWidget( const RestorationScope( restorationId: null, child: BucketSpy(), ), ); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket, isNull); }); testWidgets('moving scope moves its data', (WidgetTester tester) async { final MockRestorationManager manager = MockRestorationManager(); addTearDown(manager.dispose); final Map<String, dynamic> rawData = <String, dynamic>{}; final RestorationBucket root = RestorationBucket.root(manager: manager, rawData: rawData); addTearDown(root.dispose); final Key scopeKey = GlobalKey(); await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: Row( textDirection: TextDirection.ltr, children: <Widget>[ RestorationScope( restorationId: 'fixed', child: RestorationScope( key: scopeKey, restorationId: 'moving-child', child: const BucketSpy(), ), ), ], ), ), ); manager.doSerialization(); final BucketSpyState state = tester.state(find.byType(BucketSpy)); expect(state.bucket!.restorationId, 'moving-child'); expect((((rawData[childrenMapKey] as Map<Object?, Object?>)['fixed']! as Map<String, dynamic>)[childrenMapKey] as Map<Object?, Object?>).containsKey('moving-child'), isTrue); final RestorationBucket bucket = state.bucket!; state.bucket!.write('value', 11); manager.doSerialization(); // Move scope. await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, child: Row( textDirection: TextDirection.ltr, children: <Widget>[ RestorationScope( restorationId: 'fixed', child: Container(), ), RestorationScope( key: scopeKey, restorationId: 'moving-child', child: const BucketSpy(), ), ], ), ), ); manager.doSerialization(); expect(state.bucket!.restorationId, 'moving-child'); expect(state.bucket, same(bucket)); expect(state.bucket!.read<int>('value'), 11); expect((rawData[childrenMapKey] as Map<Object?, Object?>)['fixed'], isEmpty); expect((rawData[childrenMapKey] as Map<Object?, Object?>).containsKey('moving-child'), isTrue); }); }); } Map<String, dynamic> _createRawDataSet() { return <String, dynamic>{ valuesMapKey: <String, dynamic>{ 'value1' : 10, 'value2' : 'Hello', }, childrenMapKey: <String, dynamic>{ 'child1' : <String, dynamic>{ valuesMapKey : <String, dynamic>{ 'foo': 22, }, }, 'child2' : <String, dynamic>{ valuesMapKey : <String, dynamic>{ 'bar': 33, }, }, }, }; }
flutter/packages/flutter/test/widgets/restoration_scope_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/restoration_scope_test.dart", "repo_id": "flutter", "token_count": 5708 }
768
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; late GestureVelocityTrackerBuilder lastCreatedBuilder; class TestScrollBehavior extends ScrollBehavior { const TestScrollBehavior(this.flag); final bool flag; @override ScrollPhysics getScrollPhysics(BuildContext context) { return flag ? const ClampingScrollPhysics() : const BouncingScrollPhysics(); } @override bool shouldNotify(TestScrollBehavior old) => flag != old.flag; @override GestureVelocityTrackerBuilder velocityTrackerBuilder(BuildContext context) { lastCreatedBuilder = flag ? (PointerEvent ev) => VelocityTracker.withKind(ev.kind) : (PointerEvent ev) => IOSScrollViewFlingVelocityTracker(ev.kind); return lastCreatedBuilder; } } void main() { testWidgets('Assert in buildScrollbar that controller != null when using it', (WidgetTester tester) async { const ScrollBehavior defaultBehavior = ScrollBehavior(); late BuildContext capturedContext; await tester.pumpWidget(ScrollConfiguration( // Avoid the default ones here. behavior: const ScrollBehavior().copyWith(scrollbars: false), child: SingleChildScrollView( child: Builder( builder: (BuildContext context) { capturedContext = context; return Container(height: 1000.0); }, ), ), )); const ScrollableDetails details = ScrollableDetails(direction: AxisDirection.down); final Widget child = Container(); switch (defaultTargetPlatform) { case TargetPlatform.android: case TargetPlatform.fuchsia: case TargetPlatform.iOS: // Does not throw if we aren't using it. defaultBehavior.buildScrollbar(capturedContext, child, details); case TargetPlatform.linux: case TargetPlatform.macOS: case TargetPlatform.windows: expect( () { defaultBehavior.buildScrollbar(capturedContext, child, details); }, throwsA( isA<AssertionError>().having((AssertionError error) => error.toString(), 'description', contains('details.controller != null')), ), ); } }, variant: TargetPlatformVariant.all()); // Regression test for https://github.com/flutter/flutter/issues/89681 testWidgets('_WrappedScrollBehavior shouldNotify test', (WidgetTester tester) async { final ScrollBehavior behavior1 = const ScrollBehavior().copyWith(); final ScrollBehavior behavior2 = const ScrollBehavior().copyWith(); expect(behavior1.shouldNotify(behavior2), false); }); testWidgets('Inherited ScrollConfiguration changed', (WidgetTester tester) async { final GlobalKey key = GlobalKey(debugLabel: 'scrollable'); TestScrollBehavior? behavior; late ScrollPositionWithSingleContext position; final Widget scrollView = SingleChildScrollView( key: key, child: Builder( builder: (BuildContext context) { behavior = ScrollConfiguration.of(context) as TestScrollBehavior; position = Scrollable.of(context).position as ScrollPositionWithSingleContext; return Container(height: 1000.0); }, ), ); await tester.pumpWidget( ScrollConfiguration( behavior: const TestScrollBehavior(true), child: scrollView, ), ); expect(behavior, isNotNull); expect(behavior!.flag, isTrue); expect(position.physics, isA<ClampingScrollPhysics>()); expect(lastCreatedBuilder(const PointerDownEvent()), isA<VelocityTracker>()); ScrollMetrics metrics = position.copyWith(); expect(metrics.extentAfter, equals(400.0)); expect(metrics.viewportDimension, equals(600.0)); // Same Scrollable, different ScrollConfiguration await tester.pumpWidget( ScrollConfiguration( behavior: const TestScrollBehavior(false), child: scrollView, ), ); expect(behavior, isNotNull); expect(behavior!.flag, isFalse); expect(position.physics, isA<BouncingScrollPhysics>()); expect(lastCreatedBuilder(const PointerDownEvent()), isA<IOSScrollViewFlingVelocityTracker>()); // Regression test for https://github.com/flutter/flutter/issues/5856 metrics = position.copyWith(); expect(metrics.extentAfter, equals(400.0)); expect(metrics.viewportDimension, equals(600.0)); }); testWidgets('ScrollBehavior default android overscroll indicator', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: ScrollConfiguration( behavior: const ScrollBehavior(), child: ListView( children: const <Widget>[ SizedBox( height: 1000.0, width: 1000.0, child: Text('Test'), ), ], ), ), ), ); expect(find.byType(StretchingOverscrollIndicator), findsNothing); expect(find.byType(GlowingOverscrollIndicator), findsOneWidget); }, variant: TargetPlatformVariant.only(TargetPlatform.android)); testWidgets('ScrollBehavior multitouchDragStrategy test - 1', (WidgetTester tester) async { const ScrollBehavior behavior1 = ScrollBehavior(); final ScrollBehavior behavior2 = const ScrollBehavior().copyWith( multitouchDragStrategy: MultitouchDragStrategy.sumAllPointers ); final ScrollController controller = ScrollController(); addTearDown(() => controller.dispose()); Widget buildFrame(ScrollBehavior behavior) { return Directionality( textDirection: TextDirection.ltr, child: ScrollConfiguration( behavior: behavior, child: ListView( controller: controller, children: const <Widget>[ SizedBox( height: 1000.0, width: 1000.0, child: Text('I Love Flutter!'), ), ], ), ), ); } await tester.pumpWidget(buildFrame(behavior1)); expect(controller.position.pixels, 0.0); final Offset listLocation = tester.getCenter(find.byType(ListView)); final TestGesture gesture1 = await tester.createGesture(pointer: 1); await gesture1.down(listLocation); await tester.pump(); final TestGesture gesture2 = await tester.createGesture(pointer: 2); await gesture2.down(listLocation); await tester.pump(); await gesture1.moveBy(const Offset(0, -50)); await tester.pump(); await gesture2.moveBy(const Offset(0, -50)); await tester.pump(); // The default multitouchDragStrategy is 'latestPointer' or 'averageBoundaryPointers, // the received delta should be 50.0. expect(controller.position.pixels, 50.0); // Change to sumAllPointers. await tester.pumpWidget(buildFrame(behavior2)); await gesture1.moveBy(const Offset(0, -50)); await tester.pump(); await gesture2.moveBy(const Offset(0, -50)); await tester.pump(); // All active pointers be tracked. expect(controller.position.pixels, 50.0 + 50.0 + 50.0); }, variant: TargetPlatformVariant.all()); testWidgets('ScrollBehavior multitouchDragStrategy test (non-Apple platforms) - 2', (WidgetTester tester) async { const ScrollBehavior behavior1 = ScrollBehavior(); final ScrollBehavior behavior2 = const ScrollBehavior().copyWith( multitouchDragStrategy: MultitouchDragStrategy.averageBoundaryPointers ); final ScrollController controller = ScrollController(); late BuildContext capturedContext; addTearDown(() => controller.dispose()); Widget buildFrame(ScrollBehavior behavior) { return Directionality( textDirection: TextDirection.ltr, child: ScrollConfiguration( behavior: behavior, child: Builder( builder: (BuildContext context) { capturedContext = context; return ListView( controller: controller, children: const <Widget>[ SizedBox( height: 1000.0, width: 1000.0, child: Text('I Love Flutter!'), ), ], ); }, ), ), ); } await tester.pumpWidget(buildFrame(behavior1)); expect(controller.position.pixels, 0.0); final Offset listLocation = tester.getCenter(find.byType(ListView)); final TestGesture gesture1 = await tester.createGesture(pointer: 1); await gesture1.down(listLocation); await tester.pump(); final TestGesture gesture2 = await tester.createGesture(pointer: 2); await gesture2.down(listLocation); await tester.pump(); await gesture1.moveBy(const Offset(0, -50)); await tester.pump(); await gesture2.moveBy(const Offset(0, -40)); await tester.pump(); // The default multitouchDragStrategy is latestPointer. // Only the latest active pointer be tracked. final ScrollBehavior scrollBehavior = ScrollConfiguration.of(capturedContext); expect(scrollBehavior.getMultitouchDragStrategy(capturedContext), MultitouchDragStrategy.latestPointer); expect(controller.position.pixels, 40.0); // Change to averageBoundaryPointers. await tester.pumpWidget(buildFrame(behavior2)); await gesture1.moveBy(const Offset(0, -70)); await tester.pump(); await gesture2.moveBy(const Offset(0, -60)); await tester.pump(); expect(controller.position.pixels, 40.0 + 70.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.linux, TargetPlatform.fuchsia, TargetPlatform.windows })); testWidgets('ScrollBehavior multitouchDragStrategy test (Apple platforms) - 3', (WidgetTester tester) async { const ScrollBehavior behavior1 = ScrollBehavior(); final ScrollBehavior behavior2 = const ScrollBehavior().copyWith( multitouchDragStrategy: MultitouchDragStrategy.latestPointer ); final ScrollController controller = ScrollController(); late BuildContext capturedContext; addTearDown(() => controller.dispose()); Widget buildFrame(ScrollBehavior behavior) { return Directionality( textDirection: TextDirection.ltr, child: ScrollConfiguration( behavior: behavior, child: Builder( builder: (BuildContext context) { capturedContext = context; return ListView( controller: controller, children: const <Widget>[ SizedBox( height: 1000.0, width: 1000.0, child: Text('I Love Flutter!'), ), ], ); }, ), ), ); } await tester.pumpWidget(buildFrame(behavior1)); expect(controller.position.pixels, 0.0); final Offset listLocation = tester.getCenter(find.byType(ListView)); final TestGesture gesture1 = await tester.createGesture(pointer: 1); await gesture1.down(listLocation); await tester.pump(); final TestGesture gesture2 = await tester.createGesture(pointer: 2); await gesture2.down(listLocation); await tester.pump(); await gesture1.moveBy(const Offset(0, -40)); await tester.pump(); await gesture2.moveBy(const Offset(0, -50)); await tester.pump(); // The default multitouchDragStrategy is averageBoundaryPointers. final ScrollBehavior scrollBehavior = ScrollConfiguration.of(capturedContext); expect(scrollBehavior.getMultitouchDragStrategy(capturedContext), MultitouchDragStrategy.averageBoundaryPointers); expect(controller.position.pixels, 50.0); // Change to latestPointer. await tester.pumpWidget(buildFrame(behavior2)); await gesture1.moveBy(const Offset(0, -50)); await tester.pump(); await gesture2.moveBy(const Offset(0, -40)); await tester.pump(); expect(controller.position.pixels, 50.0 + 40.0); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS })); group('ScrollBehavior configuration is maintained over multiple copies', () { testWidgets('dragDevices', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 const ScrollBehavior defaultBehavior = ScrollBehavior(); expect(defaultBehavior.dragDevices, <PointerDeviceKind>{ PointerDeviceKind.touch, PointerDeviceKind.stylus, PointerDeviceKind.invertedStylus, PointerDeviceKind.trackpad, PointerDeviceKind.unknown, }); // Use copyWith to modify drag devices final ScrollBehavior onceCopiedBehavior = defaultBehavior.copyWith( dragDevices: PointerDeviceKind.values.toSet(), ); expect(onceCopiedBehavior.dragDevices, PointerDeviceKind.values.toSet()); // Copy again. The previously modified drag devices should carry over. final ScrollBehavior twiceCopiedBehavior = onceCopiedBehavior.copyWith(); expect(twiceCopiedBehavior.dragDevices, PointerDeviceKind.values.toSet()); }); testWidgets('physics', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 late ScrollPhysics defaultPhysics; late ScrollPhysics onceCopiedPhysics; late ScrollPhysics twiceCopiedPhysics; await tester.pumpWidget(ScrollConfiguration( // Default ScrollBehavior behavior: const ScrollBehavior(), child: Builder( builder: (BuildContext context) { final ScrollBehavior defaultBehavior = ScrollConfiguration.of(context); // Copy once to change physics defaultPhysics = defaultBehavior.getScrollPhysics(context); return ScrollConfiguration( behavior: defaultBehavior.copyWith(physics: const BouncingScrollPhysics()), child: Builder( builder: (BuildContext context) { final ScrollBehavior onceCopiedBehavior = ScrollConfiguration.of(context); onceCopiedPhysics = onceCopiedBehavior.getScrollPhysics(context); return ScrollConfiguration( // Copy again, physics should follow behavior: onceCopiedBehavior.copyWith(), child: Builder( builder: (BuildContext context) { twiceCopiedPhysics = ScrollConfiguration.of(context).getScrollPhysics(context); return SingleChildScrollView(child: Container(height: 1000)); } ) ); } ) ); } ), )); expect(defaultPhysics, const ClampingScrollPhysics(parent: RangeMaintainingScrollPhysics())); expect(onceCopiedPhysics, const BouncingScrollPhysics()); expect(twiceCopiedPhysics, const BouncingScrollPhysics()); }); testWidgets('platform', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 late TargetPlatform defaultPlatform; late TargetPlatform onceCopiedPlatform; late TargetPlatform twiceCopiedPlatform; await tester.pumpWidget(ScrollConfiguration( // Default ScrollBehavior behavior: const ScrollBehavior(), child: Builder( builder: (BuildContext context) { final ScrollBehavior defaultBehavior = ScrollConfiguration.of(context); // Copy once to change physics defaultPlatform = defaultBehavior.getPlatform(context); return ScrollConfiguration( behavior: defaultBehavior.copyWith(platform: TargetPlatform.fuchsia), child: Builder( builder: (BuildContext context) { final ScrollBehavior onceCopiedBehavior = ScrollConfiguration.of(context); onceCopiedPlatform = onceCopiedBehavior.getPlatform(context); return ScrollConfiguration( // Copy again, physics should follow behavior: onceCopiedBehavior.copyWith(), child: Builder( builder: (BuildContext context) { twiceCopiedPlatform = ScrollConfiguration.of(context).getPlatform(context); return SingleChildScrollView(child: Container(height: 1000)); } ) ); } ) ); } ), )); expect(defaultPlatform, TargetPlatform.android); expect(onceCopiedPlatform, TargetPlatform.fuchsia); expect(twiceCopiedPlatform, TargetPlatform.fuchsia); }); Widget wrap(ScrollBehavior behavior) { return Directionality( textDirection: TextDirection.ltr, child: MediaQuery( data: const MediaQueryData(size: Size(500, 500)), child: ScrollConfiguration( behavior: behavior, child: Builder( builder: (BuildContext context) => SingleChildScrollView(child: Container(height: 1000)) ) ), ) ); } testWidgets('scrollbar', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 const ScrollBehavior defaultBehavior = ScrollBehavior(); await tester.pumpWidget(wrap(defaultBehavior)); // Default adds a scrollbar expect(find.byType(RawScrollbar), findsOneWidget); final ScrollBehavior onceCopiedBehavior = defaultBehavior.copyWith(scrollbars: false); await tester.pumpWidget(wrap(onceCopiedBehavior)); // Copy does not add scrollbar expect(find.byType(RawScrollbar), findsNothing); final ScrollBehavior twiceCopiedBehavior = onceCopiedBehavior.copyWith(); await tester.pumpWidget(wrap(twiceCopiedBehavior)); // Second copy maintains scrollbar setting expect(find.byType(RawScrollbar), findsNothing); // For default scrollbars }, variant: TargetPlatformVariant.desktop()); testWidgets('overscroll', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/91673 const ScrollBehavior defaultBehavior = ScrollBehavior(); await tester.pumpWidget(wrap(defaultBehavior)); // Default adds a glowing overscroll indicator expect(find.byType(GlowingOverscrollIndicator), findsOneWidget); final ScrollBehavior onceCopiedBehavior = defaultBehavior.copyWith(overscroll: false); await tester.pumpWidget(wrap(onceCopiedBehavior)); // Copy does not add indicator expect(find.byType(GlowingOverscrollIndicator), findsNothing); final ScrollBehavior twiceCopiedBehavior = onceCopiedBehavior.copyWith(); await tester.pumpWidget(wrap(twiceCopiedBehavior)); // Second copy maintains overscroll setting expect(find.byType(GlowingOverscrollIndicator), findsNothing); // For default glowing indicator }, variant: TargetPlatformVariant.only(TargetPlatform.android)); }); }
flutter/packages/flutter/test/widgets/scroll_behavior_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/scroll_behavior_test.dart", "repo_id": "flutter", "token_count": 7731 }
769
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; class ScrollPositionListener extends StatefulWidget { const ScrollPositionListener({ super.key, required this.child, required this.log}); final Widget child; final ValueChanged<String> log; @override State<ScrollPositionListener> createState() => _ScrollPositionListenerState(); } class _ScrollPositionListenerState extends State<ScrollPositionListener> { ScrollPosition? _position; @override void didChangeDependencies() { super.didChangeDependencies(); _position?.removeListener(listener); _position = Scrollable.maybeOf(context)?.position; _position?.addListener(listener); widget.log('didChangeDependencies ${_position?.pixels.toStringAsFixed(1)}'); } @override void dispose() { _position?.removeListener(listener); super.dispose(); } @override Widget build(BuildContext context) => widget.child; void listener() { widget.log('listener ${_position?.pixels.toStringAsFixed(1)}'); } } class TestScrollController extends ScrollController { TestScrollController({ required this.deferLoading }); final bool deferLoading; @override ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition? oldPosition) { return TestScrollPosition( physics: physics, context: context, oldPosition: oldPosition, deferLoading: deferLoading, ); } } class TestScrollPosition extends ScrollPositionWithSingleContext { TestScrollPosition({ required super.physics, required super.context, super.oldPosition, required this.deferLoading, }); final bool deferLoading; @override bool recommendDeferredLoading(BuildContext context) => deferLoading; } class TestScrollable extends StatefulWidget { const TestScrollable({ super.key, required this.child }); final Widget child; @override State<StatefulWidget> createState() => TestScrollableState(); } class TestScrollableState extends State<TestScrollable> { int dependenciesChanged = 0; @override void didChangeDependencies() { dependenciesChanged += 1; super.didChangeDependencies(); } @override Widget build(BuildContext context) { return widget.child; } } class TestChild extends StatefulWidget { const TestChild({ super.key }); @override State<TestChild> createState() => TestChildState(); } class TestChildState extends State<TestChild> { int dependenciesChanged = 0; late ScrollableState scrollable; @override void didChangeDependencies() { dependenciesChanged += 1; scrollable = Scrollable.of(context, axis: Axis.horizontal); super.didChangeDependencies(); } @override Widget build(BuildContext context) { return SizedBox.square( dimension: 1000, child: Text(scrollable.axisDirection.toString()), ); } } void main() { testWidgets('Scrollable.of() dependent rebuilds when Scrollable position changes', (WidgetTester tester) async { late String logValue; final ScrollController controller = ScrollController(); addTearDown(controller.dispose); // Changing the SingleChildScrollView's physics causes the // ScrollController's ScrollPosition to be rebuilt. Widget buildFrame(ScrollPhysics? physics) { return SingleChildScrollView( controller: controller, physics: physics, child: ScrollPositionListener( log: (String s) { logValue = s; }, child: const SizedBox(height: 400.0), ), ); } await tester.pumpWidget(buildFrame(null)); expect(logValue, 'didChangeDependencies 0.0'); controller.jumpTo(100.0); expect(logValue, 'listener 100.0'); await tester.pumpWidget(buildFrame(const ClampingScrollPhysics())); expect(logValue, 'didChangeDependencies 100.0'); controller.jumpTo(200.0); expect(logValue, 'listener 200.0'); controller.jumpTo(300.0); expect(logValue, 'listener 300.0'); await tester.pumpWidget(buildFrame(const BouncingScrollPhysics())); expect(logValue, 'didChangeDependencies 300.0'); controller.jumpTo(400.0); expect(logValue, 'listener 400.0'); }); testWidgets('Scrollable.of() is possible using ScrollNotification context', (WidgetTester tester) async { late ScrollNotification notification; await tester.pumpWidget(NotificationListener<ScrollNotification>( onNotification: (ScrollNotification value) { notification = value; return false; }, child: const SingleChildScrollView( child: SizedBox(height: 1200.0), ), )); final TestGesture gesture = await tester.startGesture(const Offset(100.0, 100.0)); await tester.pump(const Duration(seconds: 1)); final StatefulElement scrollableElement = find.byType(Scrollable).evaluate().first as StatefulElement; expect(Scrollable.of(notification.context!), equals(scrollableElement.state)); // Finish gesture to release resources. await gesture.up(); await tester.pumpAndSettle(); }); testWidgets('Static Scrollable methods can target a specific axis', (WidgetTester tester) async { final TestScrollController horizontalController = TestScrollController(deferLoading: true); addTearDown(horizontalController.dispose); final TestScrollController verticalController = TestScrollController(deferLoading: false); addTearDown(verticalController.dispose); late final AxisDirection foundAxisDirection; late final bool foundRecommendation; await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: SingleChildScrollView( scrollDirection: Axis.horizontal, controller: horizontalController, child: SingleChildScrollView( controller: verticalController, child: Builder( builder: (BuildContext context) { foundAxisDirection = Scrollable.of( context, axis: Axis.horizontal, ).axisDirection; foundRecommendation = Scrollable.recommendDeferredLoadingForContext( context, axis: Axis.horizontal, ); return const SizedBox(height: 1200.0, width: 1200.0); } ), ), ), )); await tester.pumpAndSettle(); expect(foundAxisDirection, AxisDirection.right); expect(foundRecommendation, isTrue); }); testWidgets('Axis targeting scrollables establishes the correct dependencies', (WidgetTester tester) async { final GlobalKey<TestScrollableState> verticalKey = GlobalKey<TestScrollableState>(); final GlobalKey<TestChildState> childKey = GlobalKey<TestChildState>(); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: TestScrollable( key: verticalKey, child: TestChild(key: childKey), ), ), )); await tester.pumpAndSettle(); expect(verticalKey.currentState!.dependenciesChanged, 1); expect(childKey.currentState!.dependenciesChanged, 1); final ScrollController controller = ScrollController(); addTearDown(controller.dispose); // Change the horizontal ScrollView, adding a controller await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: SingleChildScrollView( scrollDirection: Axis.horizontal, controller: controller, child: TestScrollable( key: verticalKey, child: TestChild(key: childKey), ), ), )); await tester.pumpAndSettle(); expect(verticalKey.currentState!.dependenciesChanged, 1); expect(childKey.currentState!.dependenciesChanged, 2); }); }
flutter/packages/flutter/test/widgets/scrollable_of_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/scrollable_of_test.dart", "repo_id": "flutter", "token_count": 2757 }
770
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'semantics_tester.dart'; void main() { testWidgets('Semantics 4', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); // O // / \ O=root // L L L=node with label // / \ C=node with checked // C C* *=node removed next pass // await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Stack( fit: StackFit.expand, children: <Widget>[ Semantics( container: true, label: 'L1', ), Semantics( label: 'L2', container: true, child: Stack( fit: StackFit.expand, children: <Widget>[ Semantics( checked: true, ), Semantics( checked: false, ), ], ), ), ], ), )); expect(semantics, hasSemantics( TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( id: 1, label: 'L1', rect: TestSemantics.fullScreen, ), TestSemantics.rootChild( id: 2, label: 'L2', rect: TestSemantics.fullScreen, children: <TestSemantics>[ TestSemantics( id: 3, flags: SemanticsFlag.hasCheckedState.index | SemanticsFlag.isChecked.index, rect: TestSemantics.fullScreen, ), TestSemantics( id: 4, flags: SemanticsFlag.hasCheckedState.index, rect: TestSemantics.fullScreen, ), ], ), ], ), )); // O O=root // / \ L=node with label // L* LC C=node with checked // *=node removed next pass // await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Stack( fit: StackFit.expand, children: <Widget>[ Semantics( label: 'L1', container: true, ), Semantics( label: 'L2', container: true, child: Stack( fit: StackFit.expand, children: <Widget>[ Semantics( checked: true, ), Semantics(), ], ), ), ], ), )); expect(semantics, hasSemantics( TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( id: 1, label: 'L1', rect: TestSemantics.fullScreen, ), TestSemantics.rootChild( id: 2, label: 'L2', flags: SemanticsFlag.hasCheckedState.index | SemanticsFlag.isChecked.index, rect: TestSemantics.fullScreen, ), ], ), )); // O=root // OLC L=node with label // C=node with checked // await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: Stack( fit: StackFit.expand, children: <Widget>[ Semantics(), Semantics( label: 'L2', container: true, child: Stack( fit: StackFit.expand, children: <Widget>[ Semantics( checked: true, ), Semantics(), ], ), ), ], ), )); expect(semantics, hasSemantics( TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( id: 2, label: 'L2', flags: SemanticsFlag.hasCheckedState.index | SemanticsFlag.isChecked.index, rect: TestSemantics.fullScreen, ), ], ), )); semantics.dispose(); }); }
flutter/packages/flutter/test/widgets/semantics_4_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/semantics_4_test.dart", "repo_id": "flutter", "token_count": 2436 }
771
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:collection'; import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'semantics_tester.dart'; typedef TraversalTestFunction = Future<void> Function(TraversalTester tester); const Size tenByTen = Size(10.0, 10.0); void main() { setUp(() { debugResetSemanticsIdCounter(); }); void testTraversal(String description, TraversalTestFunction testFunction) { testWidgets(description, (WidgetTester tester) async { final TraversalTester traversalTester = TraversalTester(tester); await testFunction(traversalTester); traversalTester.dispose(); }); } // ┌───┐ ┌───┐ // │ A │>│ B │ // └───┘ └───┘ testTraversal('Semantics traverses horizontally left-to-right', (TraversalTester tester) async { await tester.test( textDirection: TextDirection.ltr, children: <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(20.0, 0.0) & tenByTen, }, expectedTraversal: 'A B', ); }); // ┌───┐ ┌───┐ // │ A │<│ B │ // └───┘ └───┘ testTraversal('Semantics traverses horizontally right-to-left', (TraversalTester tester) async { await tester.test( textDirection: TextDirection.rtl, children: <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(20.0, 0.0) & tenByTen, }, expectedTraversal: 'B A', ); }); // ┌───┐ // │ A │ // └───┘ // V // ┌───┐ // │ B │ // └───┘ testTraversal('Semantics traverses vertically top-to-bottom', (TraversalTester tester) async { for (final TextDirection textDirection in TextDirection.values) { await tester.test( textDirection: textDirection, children: <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(0.0, 20.0) & tenByTen, }, expectedTraversal: 'A B', ); } }); // ┌───┐ ┌───┐ // │ A │>│ B │ // └───┘ └───┘ // ┌─────┘ // V // ┌───┐ ┌───┐ // │ C │>│ D │ // └───┘ └───┘ testTraversal('Semantics traverses a grid left-to-right', (TraversalTester tester) async { await tester.test( textDirection: TextDirection.ltr, children: <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(20.0, 0.0) & tenByTen, 'C': const Offset(0.0, 20.0) & tenByTen, 'D': const Offset(20.0, 20.0) & tenByTen, }, expectedTraversal: 'A B C D', ); }); // ┌───┐ ┌───┐ // │ A │<│ B │ // └───┘ └───┘ // └─────┐ // V // ┌───┐ ┌───┐ // │ C │<│ D │ // └───┘ └───┘ testTraversal('Semantics traverses a grid right-to-left', (TraversalTester tester) async { await tester.test( textDirection: TextDirection.rtl, children: <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(20.0, 0.0) & tenByTen, 'C': const Offset(0.0, 20.0) & tenByTen, 'D': const Offset(20.0, 20.0) & tenByTen, }, expectedTraversal: 'B A D C', ); }); // ┌───┐ ┌───┐ // │ A │ │ C │ // └───┘<->┌───┐<->└───┘ // │ B │ // └───┘ testTraversal('Semantics traverses vertically overlapping nodes horizontally', (TraversalTester tester) async { final Map<String, Rect> children = <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(20.0, 5.0) & tenByTen, 'C': const Offset(40.0, 0.0) & tenByTen, }; await tester.test( textDirection: TextDirection.ltr, children: children, expectedTraversal: 'A B C', ); await tester.test( textDirection: TextDirection.rtl, children: children, expectedTraversal: 'C B A', ); }); // LTR: // ┌───┐ ┌───┐ ┌───┐ ┌───┐ // │ A │>│ B │>│ C │>│ D │ // └───┘ └───┘ └───┘ └───┘ // ┌─────────────────┘ // V // ┌───┐ ┌─────────┐ ┌───┐ // │ E │>│ │>│ G │ // └───┘ │ F │ └───┘ // ┌───|─────────|───┘ // ┌───┐ │ │ ┌───┐ // │ H │─|─────────|>│ I │ // └───┘ └─────────┘ └───┘ // ┌─────────────────┘ // V // ┌───┐ ┌───┐ ┌───┐ ┌───┐ // │ J │>│ K │>│ L │>│ M │ // └───┘ └───┘ └───┘ └───┘ // // RTL: // ┌───┐ ┌───┐ ┌───┐ ┌───┐ // │ A │<│ B │<│ C │<│ D │ // └───┘ └───┘ └───┘ └───┘ // └─────────────────┐ // V // ┌───┐ ┌─────────┐ ┌───┐ // │ E │<│ │<│ G │ // └───┘ │ F │ └───┘ // └──|─────────|────┐ // ┌───┐ │ │ ┌───┐ // │ H │<|─────────|─│ I │ // └───┘ └─────────┘ └───┘ // └─────────────────┐ // V // ┌───┐ ┌───┐ ┌───┐ ┌───┐ // │ J │<│ K │<│ L │<│ M │ // └───┘ └───┘ └───┘ └───┘ testTraversal('Semantics traverses vertical groups, then horizontal groups, then knots', (TraversalTester tester) async { final Map<String, Rect> children = <String, Rect>{ 'A': Offset.zero & tenByTen, 'B': const Offset(20.0, 0.0) & tenByTen, 'C': const Offset(40.0, 0.0) & tenByTen, 'D': const Offset(60.0, 0.0) & tenByTen, 'E': const Offset(0.0, 20.0) & tenByTen, 'F': const Offset(20.0, 20.0) & (tenByTen * 2.0), 'G': const Offset(60.0, 20.0) & tenByTen, 'H': const Offset(0.0, 40.0) & tenByTen, 'I': const Offset(60.0, 40.0) & tenByTen, 'J': const Offset(0.0, 60.0) & tenByTen, 'K': const Offset(20.0, 60.0) & tenByTen, 'L': const Offset(40.0, 60.0) & tenByTen, 'M': const Offset(60.0, 60.0) & tenByTen, }; await tester.test( textDirection: TextDirection.ltr, children: children, expectedTraversal: 'A B C D E F G H I J K L M', ); await tester.test( textDirection: TextDirection.rtl, children: children, expectedTraversal: 'D C B A G F E I H M L K J', ); }); // The following test tests traversal of the simplest "knot", which is two // nodes overlapping both vertically and horizontally. For example: // // ┌─────────┐ // │ │ // │ A │ // │ ┌───┼─────┐ // │ │ │ │ // └─────┼───┘ │ // │ B │ // │ │ // └─────────┘ // // The outcome depends on the relative positions of the centers of `Rect`s of // their respective boxes, specifically the direction (i.e. angle) of the // vector pointing from A to B. We test different angles, one for each octant: // // -3π/4 -π/2 -π/4 // ╲ │ ╱ // ╲ 1│2 ╱ // ╲ │ ╱ // i=0 ╲│╱ 3 // π ──────┼────── 0 // 7 ╱│╲ 4 // ╱ │ ╲ // ╱ 6│5 ╲ // ╱ │ ╲ // 3π/4 π/2 π/4 // // For LTR, angles falling into octants 3, 4, 5, and 6, produce A -> B, all // others produce B -> A. // // For RTL, angles falling into octants 5, 6, 7, and 0, produce A -> B, all // others produce B -> A. testTraversal('Semantics sorts knots', (TraversalTester tester) async { const double start = -math.pi + math.pi / 8.0; for (int i = 0; i < 8; i += 1) { final double angle = start + i.toDouble() * math.pi / 4.0; // These values should be truncated so that double precision rounding // issues won't impact the heights/widths and throw off the traversal // ordering. final double dx = (math.cos(angle) * 15.0) / 10.0; final double dy = (math.sin(angle) * 15.0) / 10.0; final Map<String, Rect> children = <String, Rect>{ 'A': const Offset(10.0, 10.0) & tenByTen, 'B': Offset(10.0 + dx, 10.0 + dy) & tenByTen, }; try { await tester.test( textDirection: TextDirection.ltr, children: children, expectedTraversal: 3 <= i && i <= 6 ? 'A B' : 'B A', ); await tester.test( textDirection: TextDirection.rtl, children: children, expectedTraversal: 1 <= i && i <= 4 ? 'B A' : 'A B', ); } catch (error) { fail( 'Test failed with i == $i, angle == ${angle / math.pi}π\n' '$error', ); } } }); } class TraversalTester { TraversalTester(this.tester) : semantics = SemanticsTester(tester); final WidgetTester tester; final SemanticsTester semantics; Future<void> test({ required TextDirection textDirection, required Map<String, Rect> children, required String expectedTraversal, }) async { assert(children is LinkedHashMap); await tester.pumpWidget( Directionality( textDirection: textDirection, child: Semantics( textDirection: textDirection, child: CustomMultiChildLayout( delegate: TestLayoutDelegate(children), children: children.keys.map<Widget>((String label) { return LayoutId( id: label, child: Semantics( container: true, explicitChildNodes: true, label: label, child: SizedBox( width: children[label]!.width, height: children[label]!.height, ), ), ); }).toList(), ), ), ), ); expect(semantics, hasSemantics( TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( textDirection: textDirection, children: expectedTraversal.split(' ').map<TestSemantics>((String label) { return TestSemantics( label: label, ); }).toList(), ), ], ), ignoreTransform: true, ignoreRect: true, ignoreId: true, )); } void dispose() { semantics.dispose(); } } class TestLayoutDelegate extends MultiChildLayoutDelegate { TestLayoutDelegate(this.children); final Map<String, Rect> children; @override void performLayout(Size size) { children.forEach((String label, Rect rect) { layoutChild(label, BoxConstraints.loose(size)); positionChild(label, rect.topLeft); }); } @override bool shouldRelayout(MultiChildLayoutDelegate oldDelegate) => oldDelegate == this; }
flutter/packages/flutter/test/widgets/semantics_traversal_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/semantics_traversal_test.dart", "repo_id": "flutter", "token_count": 5225 }
772
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('SizedBox constructors', (WidgetTester tester) async { const SizedBox a = SizedBox(); expect(a.width, isNull); expect(a.height, isNull); const SizedBox b = SizedBox(width: 10.0); expect(b.width, 10.0); expect(b.height, isNull); const SizedBox c = SizedBox(width: 10.0, height: 20.0); expect(c.width, 10.0); expect(c.height, 20.0); final SizedBox d = SizedBox.fromSize(); expect(d.width, isNull); expect(d.height, isNull); final SizedBox e = SizedBox.fromSize(size: const Size(1.0, 2.0)); expect(e.width, 1.0); expect(e.height, 2.0); const SizedBox f = SizedBox.expand(); expect(f.width, double.infinity); expect(f.height, double.infinity); const SizedBox g = SizedBox.shrink(); expect(g.width, 0.0); expect(g.height, 0.0); }); testWidgets('SizedBox - no child', (WidgetTester tester) async { final GlobalKey patient = GlobalKey(); await tester.pumpWidget( Center( child: SizedBox( key: patient, ), ), ); expect(patient.currentContext!.size, equals(Size.zero)); await tester.pumpWidget( Center( child: SizedBox( key: patient, height: 0.0, ), ), ); expect(patient.currentContext!.size, equals(Size.zero)); await tester.pumpWidget( Center( child: SizedBox.shrink( key: patient, ), ), ); expect(patient.currentContext!.size, equals(Size.zero)); await tester.pumpWidget( Center( child: SizedBox( key: patient, width: 100.0, height: 100.0, ), ), ); expect(patient.currentContext!.size, equals(const Size(100.0, 100.0))); await tester.pumpWidget( Center( child: SizedBox( key: patient, width: 1000.0, height: 1000.0, ), ), ); expect(patient.currentContext!.size, equals(const Size(800.0, 600.0))); await tester.pumpWidget( Center( child: SizedBox.expand( key: patient, ), ), ); expect(patient.currentContext!.size, equals(const Size(800.0, 600.0))); await tester.pumpWidget( Center( child: SizedBox.shrink( key: patient, ), ), ); expect(patient.currentContext!.size, equals(Size.zero)); }); testWidgets('SizedBox - container child', (WidgetTester tester) async { final GlobalKey patient = GlobalKey(); await tester.pumpWidget( Center( child: SizedBox( key: patient, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(const Size(800.0, 600.0))); await tester.pumpWidget( Center( child: SizedBox( key: patient, height: 0.0, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(const Size(800.0, 0.0))); await tester.pumpWidget( Center( child: SizedBox.shrink( key: patient, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(Size.zero)); await tester.pumpWidget( Center( child: SizedBox( key: patient, width: 100.0, height: 100.0, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(const Size(100.0, 100.0))); await tester.pumpWidget( Center( child: SizedBox( key: patient, width: 1000.0, height: 1000.0, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(const Size(800.0, 600.0))); await tester.pumpWidget( Center( child: SizedBox.expand( key: patient, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(const Size(800.0, 600.0))); await tester.pumpWidget( Center( child: SizedBox.shrink( key: patient, child: Container(), ), ), ); expect(patient.currentContext!.size, equals(Size.zero)); }); testWidgets('SizedBox.square tests', (WidgetTester tester) async { await tester.pumpWidget( const SizedBox.square( dimension: 100, child: SizedBox.shrink(), ) ); expect( tester.renderObject<RenderConstrainedBox>(find.byType(SizedBox).first).additionalConstraints, BoxConstraints.tight(const Size.square(100)), ); }); }
flutter/packages/flutter/test/widgets/sized_box_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/sized_box_test.dart", "repo_id": "flutter", "token_count": 2269 }
773
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; void verifyPaintPosition(GlobalKey key, Offset ideal) { final RenderObject target = key.currentContext!.findRenderObject()!; expect(target.parent, isA<RenderViewport>()); final SliverPhysicalParentData parentData = target.parentData! as SliverPhysicalParentData; final Offset actual = parentData.paintOffset; expect(actual, ideal); } void main() { testWidgets('Sliver appbars - scrolling', (WidgetTester tester) async { GlobalKey key1, key2, key3, key4, key5; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( slivers: <Widget>[ BigSliver(key: key1 = GlobalKey()), SliverPersistentHeader(key: key2 = GlobalKey(), delegate: TestDelegate()), SliverPersistentHeader(key: key3 = GlobalKey(), delegate: TestDelegate()), BigSliver(key: key4 = GlobalKey()), BigSliver(key: key5 = GlobalKey()), ], ), ), ); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; final double max = RenderBigSliver.height * 3.0 + TestDelegate().maxExtent * 2.0 - 600.0; // 600 is the height of the test viewport assert(max < 10000.0); expect(max, 1450.0); expect(position.pixels, 0.0); expect(position.minScrollExtent, 0.0); expect(position.maxScrollExtent, max); position.animateTo(10000.0, curve: Curves.linear, duration: const Duration(minutes: 1)); await tester.pumpAndSettle(const Duration(milliseconds: 10)); expect(position.pixels, max); expect(position.minScrollExtent, 0.0); expect(position.maxScrollExtent, max); verifyPaintPosition(key1, Offset.zero); verifyPaintPosition(key2, Offset.zero); verifyPaintPosition(key3, Offset.zero); verifyPaintPosition(key4, Offset.zero); verifyPaintPosition(key5, const Offset(0.0, 50.0)); }); testWidgets('Sliver appbars - scrolling off screen', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TestDelegate delegate = TestDelegate(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( slivers: <Widget>[ const BigSliver(), SliverPersistentHeader(key: key, delegate: delegate), const BigSliver(), const BigSliver(), ], ), ), ); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; position.animateTo(RenderBigSliver.height + delegate.maxExtent - 5.0, curve: Curves.linear, duration: const Duration(minutes: 1)); await tester.pumpAndSettle(const Duration(milliseconds: 1000)); final RenderBox box = tester.renderObject<RenderBox>(find.text('Sliver App Bar')); final Rect rect = Rect.fromPoints(box.localToGlobal(Offset.zero), box.localToGlobal(box.size.bottomRight(Offset.zero))); expect(rect, equals(const Rect.fromLTWH(0.0, -195.0, 800.0, 200.0))); }); testWidgets('Sliver appbars - scrolling - overscroll gap is below header', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( physics: const BouncingScrollPhysics(), slivers: <Widget>[ SliverPersistentHeader(delegate: TestDelegate()), SliverList( delegate: SliverChildListDelegate(<Widget>[ const SizedBox( height: 300.0, child: Text('X'), ), ]), ), ], ), ), ); expect(tester.getTopLeft(find.text('Sliver App Bar')), Offset.zero); expect(tester.getTopLeft(find.text('X')), const Offset(0.0, 200.0)); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; position.jumpTo(-50.0); await tester.pump(); expect(tester.getTopLeft(find.text('Sliver App Bar')), Offset.zero); expect(tester.getTopLeft(find.text('X')), const Offset(0.0, 250.0)); }); testWidgets('Sliver appbars const child delegate - scrolling - overscroll gap is below header', (WidgetTester tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( physics: const BouncingScrollPhysics(), slivers: <Widget>[ SliverPersistentHeader(delegate: TestDelegate()), const SliverList( delegate: SliverChildListDelegate.fixed(<Widget>[ SizedBox( height: 300.0, child: Text('X'), ), ]), ), ], ), ), ); expect(tester.getTopLeft(find.text('Sliver App Bar')), Offset.zero); expect(tester.getTopLeft(find.text('X')), const Offset(0.0, 200.0)); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; position.jumpTo(-50.0); await tester.pump(); expect(tester.getTopLeft(find.text('Sliver App Bar')), Offset.zero); expect(tester.getTopLeft(find.text('X')), const Offset(0.0, 250.0)); }); group('has correct semantics when', () { testWidgets('within viewport', (WidgetTester tester) async { const double cacheExtent = 250; final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( cacheExtent: cacheExtent, physics: const BouncingScrollPhysics(), slivers: <Widget>[ SliverPersistentHeader(delegate: TestDelegate()), const SliverList( delegate: SliverChildListDelegate.fixed(<Widget>[ SizedBox( height: 300.0, child: Text('X'), ), ]), ), ], ), ), ); final SemanticsFinder sliverAppBar = find.semantics.byLabel( 'Sliver App Bar', ); expect(sliverAppBar, findsOne); expect(sliverAppBar, containsSemantics(isHidden: false)); handle.dispose(); }); testWidgets('partially scrolling off screen', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TestDelegate delegate = TestDelegate(); final SemanticsHandle handle = tester.ensureSemantics(); const double cacheExtent = 250; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( cacheExtent: cacheExtent, slivers: <Widget>[ SliverPersistentHeader(key: key, delegate: delegate), const BigSliver(), const BigSliver(), ], ), ), ); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; position.animateTo(delegate.maxExtent - 20.0, curve: Curves.linear, duration: const Duration(minutes: 1)); await tester.pumpAndSettle(const Duration(milliseconds: 1000)); final RenderBox box = tester.renderObject<RenderBox>(find.text('Sliver App Bar')); final Rect rect = Rect.fromPoints(box.localToGlobal(Offset.zero), box.localToGlobal(box.size.bottomRight(Offset.zero))); expect(rect, equals(const Rect.fromLTWH(0.0, -180.0, 800.0, 200.0))); final SemanticsFinder sliverAppBar = find.semantics.byLabel( 'Sliver App Bar', ); expect(sliverAppBar, findsOne); expect(sliverAppBar, containsSemantics(isHidden: false)); handle.dispose(); }); testWidgets('completely scrolling off screen but within cache extent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TestDelegate delegate = TestDelegate(); final SemanticsHandle handle = tester.ensureSemantics(); const double cacheExtent = 250; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( cacheExtent: cacheExtent, slivers: <Widget>[ SliverPersistentHeader(key: key, delegate: delegate), const BigSliver(), const BigSliver(), ], ), ), ); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; position.animateTo(delegate.maxExtent + 20.0, curve: Curves.linear, duration: const Duration(minutes: 1)); await tester.pumpAndSettle(const Duration(milliseconds: 1000)); final SemanticsFinder sliverAppBar = find.semantics.byLabel( 'Sliver App Bar', ); expect(sliverAppBar, findsOne); expect(sliverAppBar, containsSemantics(isHidden: true)); handle.dispose(); }); testWidgets('completely scrolling off screen and not within cache extent', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final TestDelegate delegate = TestDelegate(); final SemanticsHandle handle = tester.ensureSemantics(); const double cacheExtent = 250; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( cacheExtent: cacheExtent, slivers: <Widget>[ SliverPersistentHeader(key: key, delegate: delegate), const BigSliver(), const BigSliver(), ], ), ), ); final ScrollPosition position = tester.state<ScrollableState>(find.byType(Scrollable)).position; position.animateTo(delegate.maxExtent + 300.0, curve: Curves.linear, duration: const Duration(minutes: 1)); await tester.pumpAndSettle(const Duration(milliseconds: 1000)); final SemanticsFinder sliverAppBar = find.semantics.byLabel( 'Sliver App Bar', ); expect(sliverAppBar, findsNothing); handle.dispose(); }); }); } class TestDelegate extends SliverPersistentHeaderDelegate { @override double get maxExtent => 200.0; @override double get minExtent => 200.0; @override Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { return SizedBox(height: maxExtent, child: const Text('Sliver App Bar'),); } @override bool shouldRebuild(TestDelegate oldDelegate) => false; } class RenderBigSliver extends RenderSliver { static const double height = 550.0; double get paintExtent => (height - constraints.scrollOffset).clamp(0.0, constraints.remainingPaintExtent); @override void performLayout() { geometry = SliverGeometry( scrollExtent: height, paintExtent: paintExtent, maxPaintExtent: height, ); } } class BigSliver extends LeafRenderObjectWidget { const BigSliver({ super.key }); @override RenderBigSliver createRenderObject(BuildContext context) { return RenderBigSliver(); } }
flutter/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart", "repo_id": "flutter", "token_count": 5145 }
774
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; class InnerWidget extends StatefulWidget { const InnerWidget({ super.key }); @override InnerWidgetState createState() => InnerWidgetState(); } class InnerWidgetState extends State<InnerWidget> { bool _didInitState = false; @override void initState() { super.initState(); _didInitState = true; } @override Widget build(BuildContext context) { return Container(); } } class OuterContainer extends StatefulWidget { const OuterContainer({ super.key, required this.child }); final InnerWidget child; @override OuterContainerState createState() => OuterContainerState(); } class OuterContainerState extends State<OuterContainer> { @override Widget build(BuildContext context) { return widget.child; } } void main() { testWidgets('resync stateful widget', (WidgetTester tester) async { const Key innerKey = Key('inner'); const Key outerKey = Key('outer'); const InnerWidget inner1 = InnerWidget(key: innerKey); InnerWidget inner2; const OuterContainer outer1 = OuterContainer(key: outerKey, child: inner1); OuterContainer outer2; await tester.pumpWidget(outer1); final StatefulElement innerElement = tester.element(find.byKey(innerKey)); final InnerWidgetState innerElementState = innerElement.state as InnerWidgetState; expect(innerElementState.widget, equals(inner1)); expect(innerElementState._didInitState, isTrue); expect(innerElement.renderObject!.attached, isTrue); inner2 = const InnerWidget(key: innerKey); outer2 = OuterContainer(key: outerKey, child: inner2); await tester.pumpWidget(outer2); expect(tester.element(find.byKey(innerKey)), equals(innerElement)); expect(innerElement.state, equals(innerElementState)); expect(innerElementState.widget, equals(inner2)); expect(innerElementState._didInitState, isTrue); expect(innerElement.renderObject!.attached, isTrue); final StatefulElement outerElement = tester.element(find.byKey(outerKey)); expect(outerElement.state.widget, equals(outer2)); outerElement.markNeedsBuild(); await tester.pump(); expect(tester.element(find.byKey(innerKey)), equals(innerElement)); expect(innerElement.state, equals(innerElementState)); expect(innerElementState.widget, equals(inner2)); expect(innerElement.renderObject!.attached, isTrue); }); }
flutter/packages/flutter/test/widgets/stateful_components_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/stateful_components_test.dart", "repo_id": "flutter", "token_count": 812 }
775
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Nested TickerMode cannot turn tickers back on', (WidgetTester tester) async { int outerTickCount = 0; int innerTickCount = 0; Widget nestedTickerModes({required bool innerEnabled, required bool outerEnabled}) { return Directionality( textDirection: TextDirection.rtl, child: TickerMode( enabled: outerEnabled, child: Row( children: <Widget>[ _TickingWidget( onTick: () { outerTickCount++; }, ), TickerMode( enabled: innerEnabled, child: _TickingWidget( onTick: () { innerTickCount++; }, ), ), ], ), ), ); } await tester.pumpWidget( nestedTickerModes( outerEnabled: false, innerEnabled: true, ), ); expect(outerTickCount, 0); expect(innerTickCount, 0); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); expect(outerTickCount, 0); expect(innerTickCount, 0); await tester.pumpWidget( nestedTickerModes( outerEnabled: true, innerEnabled: false, ), ); outerTickCount = 0; innerTickCount = 0; await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); expect(outerTickCount, 4); expect(innerTickCount, 0); await tester.pumpWidget( nestedTickerModes( outerEnabled: true, innerEnabled: true, ), ); outerTickCount = 0; innerTickCount = 0; await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); expect(outerTickCount, 4); expect(innerTickCount, 4); await tester.pumpWidget( nestedTickerModes( outerEnabled: false, innerEnabled: false, ), ); outerTickCount = 0; innerTickCount = 0; await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1)); expect(outerTickCount, 0); expect(innerTickCount, 0); }); testWidgets('Changing TickerMode does not rebuild widgets with SingleTickerProviderStateMixin', (WidgetTester tester) async { Widget widgetUnderTest({required bool tickerEnabled}) { return TickerMode( enabled: tickerEnabled, child: const _TickingWidget(), ); } _TickingWidgetState state() => tester.state<_TickingWidgetState>(find.byType(_TickingWidget)); await tester.pumpWidget(widgetUnderTest(tickerEnabled: true)); expect(state().ticker.isTicking, isTrue); expect(state().buildCount, 1); await tester.pumpWidget(widgetUnderTest(tickerEnabled: false)); expect(state().ticker.isTicking, isFalse); expect(state().buildCount, 1); await tester.pumpWidget(widgetUnderTest(tickerEnabled: true)); expect(state().ticker.isTicking, isTrue); expect(state().buildCount, 1); }); testWidgets('Changing TickerMode does not rebuild widgets with TickerProviderStateMixin', (WidgetTester tester) async { Widget widgetUnderTest({required bool tickerEnabled}) { return TickerMode( enabled: tickerEnabled, child: const _MultiTickingWidget(), ); } _MultiTickingWidgetState state() => tester.state<_MultiTickingWidgetState>(find.byType(_MultiTickingWidget)); await tester.pumpWidget(widgetUnderTest(tickerEnabled: true)); expect(state().ticker.isTicking, isTrue); expect(state().buildCount, 1); await tester.pumpWidget(widgetUnderTest(tickerEnabled: false)); expect(state().ticker.isTicking, isFalse); expect(state().buildCount, 1); await tester.pumpWidget(widgetUnderTest(tickerEnabled: true)); expect(state().ticker.isTicking, isTrue); expect(state().buildCount, 1); }); testWidgets('Moving widgets with SingleTickerProviderStateMixin to a new TickerMode ancestor works', (WidgetTester tester) async { final GlobalKey tickingWidgetKey = GlobalKey(); Widget widgetUnderTest({required LocalKey tickerModeKey, required bool tickerEnabled}) { return TickerMode( key: tickerModeKey, enabled: tickerEnabled, child: _TickingWidget(key: tickingWidgetKey), ); } // Using different local keys to simulate changing TickerMode ancestors. await tester.pumpWidget(widgetUnderTest(tickerEnabled: true, tickerModeKey: UniqueKey())); final State tickerModeState = tester.state(find.byType(TickerMode)); final _TickingWidgetState tickingState = tester.state<_TickingWidgetState>(find.byType(_TickingWidget)); expect(tickingState.ticker.isTicking, isTrue); await tester.pumpWidget(widgetUnderTest(tickerEnabled: false, tickerModeKey: UniqueKey())); expect(tester.state(find.byType(TickerMode)), isNot(same(tickerModeState))); expect(tickingState, same(tester.state<_TickingWidgetState>(find.byType(_TickingWidget)))); expect(tickingState.ticker.isTicking, isFalse); }); testWidgets('Moving widgets with TickerProviderStateMixin to a new TickerMode ancestor works', (WidgetTester tester) async { final GlobalKey tickingWidgetKey = GlobalKey(); Widget widgetUnderTest({required LocalKey tickerModeKey, required bool tickerEnabled}) { return TickerMode( key: tickerModeKey, enabled: tickerEnabled, child: _MultiTickingWidget(key: tickingWidgetKey), ); } // Using different local keys to simulate changing TickerMode ancestors. await tester.pumpWidget(widgetUnderTest(tickerEnabled: true, tickerModeKey: UniqueKey())); final State tickerModeState = tester.state(find.byType(TickerMode)); final _MultiTickingWidgetState tickingState = tester.state<_MultiTickingWidgetState>(find.byType(_MultiTickingWidget)); expect(tickingState.ticker.isTicking, isTrue); await tester.pumpWidget(widgetUnderTest(tickerEnabled: false, tickerModeKey: UniqueKey())); expect(tester.state(find.byType(TickerMode)), isNot(same(tickerModeState))); expect(tickingState, same(tester.state<_MultiTickingWidgetState>(find.byType(_MultiTickingWidget)))); expect(tickingState.ticker.isTicking, isFalse); }); testWidgets('Ticking widgets in old route do not rebuild when new route is pushed', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( routes: <String, WidgetBuilder>{ '/foo' : (BuildContext context) => const Text('New route'), }, home: const Row( children: <Widget>[ _TickingWidget(), _MultiTickingWidget(), Text('Old route'), ], ), )); _MultiTickingWidgetState multiTickingState() => tester.state<_MultiTickingWidgetState>(find.byType(_MultiTickingWidget, skipOffstage: false)); _TickingWidgetState tickingState() => tester.state<_TickingWidgetState>(find.byType(_TickingWidget, skipOffstage: false)); expect(find.text('Old route'), findsOneWidget); expect(find.text('New route'), findsNothing); expect(multiTickingState().ticker.isTicking, isTrue); expect(multiTickingState().buildCount, 1); expect(tickingState().ticker.isTicking, isTrue); expect(tickingState().buildCount, 1); tester.state<NavigatorState>(find.byType(Navigator)).pushNamed('/foo'); await tester.pumpAndSettle(); expect(find.text('Old route'), findsNothing); expect(find.text('New route'), findsOneWidget); expect(multiTickingState().ticker.isTicking, isFalse); expect(multiTickingState().buildCount, 1); expect(tickingState().ticker.isTicking, isFalse); expect(tickingState().buildCount, 1); }); } class _TickingWidget extends StatefulWidget { const _TickingWidget({super.key, this.onTick}); final VoidCallback? onTick; @override State<_TickingWidget> createState() => _TickingWidgetState(); } class _TickingWidgetState extends State<_TickingWidget> with SingleTickerProviderStateMixin { late Ticker ticker; int buildCount = 0; @override void initState() { super.initState(); ticker = createTicker((Duration _) { widget.onTick?.call(); })..start(); } @override Widget build(BuildContext context) { buildCount += 1; return Container(); } @override void dispose() { ticker.dispose(); super.dispose(); } } class _MultiTickingWidget extends StatefulWidget { const _MultiTickingWidget({super.key}); @override State<_MultiTickingWidget> createState() => _MultiTickingWidgetState(); } class _MultiTickingWidgetState extends State<_MultiTickingWidget> with TickerProviderStateMixin { late Ticker ticker; int buildCount = 0; @override void initState() { super.initState(); ticker = createTicker((Duration _) { })..start(); } @override Widget build(BuildContext context) { buildCount += 1; return Container(); } @override void dispose() { ticker.dispose(); super.dispose(); } }
flutter/packages/flutter/test/widgets/ticker_mode_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/ticker_mode_test.dart", "repo_id": "flutter", "token_count": 3656 }
776
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'semantics_tester.dart'; class TestState extends StatefulWidget { const TestState({ super.key, required this.child, required this.log }); final Widget child; final List<String> log; @override State<TestState> createState() => _TestStateState(); } class _TestStateState extends State<TestState> { @override void initState() { super.initState(); widget.log.add('created new state'); } @override Widget build(BuildContext context) { return widget.child; } } void main() { testWidgets('Visibility', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); final List<String> log = <String>[]; final Widget testChild = GestureDetector( onTap: () { log.add('tap'); }, child: Builder( builder: (BuildContext context) { final bool animating = TickerMode.of(context); return TestState( log: log, child: Text('a $animating', textDirection: TextDirection.rtl), ); }, ), ); final Matcher expectedSemanticsWhenPresent = hasSemantics( TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( label: 'a true', textDirection: TextDirection.rtl, actions: <SemanticsAction>[SemanticsAction.tap], ), ], ), ignoreId: true, ignoreRect: true, ignoreTransform: true, ); final Matcher expectedSemanticsWhenPresentWithIgnorePointer = hasSemantics( TestSemantics.root( children: <TestSemantics>[ TestSemantics.rootChild( label: 'a true', textDirection: TextDirection.rtl, ), ], ), ignoreId: true, ignoreRect: true, ignoreTransform: true, ); final Matcher expectedSemanticsWhenAbsent = hasSemantics(TestSemantics.root()); // We now run a sequence of pumpWidget calls one after the other. In // addition to verifying that the right behavior is seen in each case, this // also verifies that the widget can dynamically change from state to state. await tester.pumpWidget(Visibility(child: testChild)); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(800.0, 600.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility)); expect(log, <String>['created new state', 'tap']); log.clear(); await tester.pumpWidget(Visibility(visible: false, child: testChild)); expect(find.byType(Text, skipOffstage: false), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), const Size(800.0, 600.0)); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( replacement: const Placeholder(), visible: false, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); expect(find.byType(Placeholder), findsOneWidget); expect(find.byType(Visibility), paints..path()); expect(tester.getSize(find.byType(Visibility)), const Size(800.0, 600.0)); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( replacement: const Placeholder(), child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility)); expect(log, <String>['created new state', 'tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( maintainState: true, maintainAnimation: true, maintainSize: true, maintainInteractivity: true, maintainSemantics: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility)); expect(log, <String>['created new state', 'tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, maintainInteractivity: true, maintainSemantics: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>[]); await tester.tap(find.byType(Visibility)); expect(log, <String>['tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, maintainInteractivity: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility)); expect(log, <String>['tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, maintainSemantics: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresentWithIgnorePointer); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, maintainAnimation: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.byType(Text), findsNothing); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>['created new state']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>['created new state']); log.clear(); // Now we toggle the visibility off and on a few times to make sure that works. await tester.pumpWidget(Center( child: Visibility( maintainState: true, child: testChild, ), )); expect(find.byType(Text), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>['tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( maintainState: true, child: testChild, ), )); expect(find.byType(Text), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>[]); await tester.tap(find.byType(Visibility)); expect(log, <String>['tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, maintainState: true, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); // Same but without maintainState. await tester.pumpWidget(Center( child: Visibility( visible: false, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( child: testChild, ), )); expect(find.byType(Text), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility)); expect(log, <String>['created new state', 'tap']); log.clear(); await tester.pumpWidget(Center( child: Visibility( visible: false, child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), Size.zero); expect(semantics, expectedSemanticsWhenAbsent); expect(log, <String>[]); await tester.tap(find.byType(Visibility), warnIfMissed: false); expect(log, <String>[]); log.clear(); await tester.pumpWidget(Center( child: Visibility( child: testChild, ), )); expect(find.byType(Text), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paints..paragraph()); expect(tester.getSize(find.byType(Visibility)), const Size(84.0, 14.0)); expect(semantics, expectedSemanticsWhenPresent); expect(log, <String>['created new state']); await tester.tap(find.byType(Visibility)); expect(log, <String>['created new state', 'tap']); log.clear(); semantics.dispose(); }); testWidgets('Visibility does not force compositing when visible and maintain*', (WidgetTester tester) async { await tester.pumpWidget( const Visibility( maintainSize: true, maintainAnimation: true, maintainState: true, child: Text('hello', textDirection: TextDirection.ltr), ), ); // Root transform from the tester and then the picture created by the text. expect(tester.layers, hasLength(2)); expect(tester.layers, isNot(contains(isA<OpacityLayer>()))); expect(tester.layers.last, isA<PictureLayer>()); }); testWidgets('SliverVisibility does not force compositing when visible and maintain*', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: CustomScrollView( slivers: <Widget>[ SliverVisibility( maintainSize: true, maintainAnimation: true, maintainState: true, sliver: SliverList( delegate: SliverChildListDelegate.fixed( addRepaintBoundaries: false, <Widget>[ Text('hello'), ], ), )) ] ), ), ); // This requires a lot more layers due to including sliver lists which do manage additional // offset layers. Just trust me this is one fewer layers than before... expect(tester.layers, hasLength(6)); expect(tester.layers, isNot(contains(isA<OpacityLayer>()))); expect(tester.layers.last, isA<PictureLayer>()); }); testWidgets('Visibility.of returns correct value', (WidgetTester tester) async { await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: _ShowVisibility(), ), ); expect(find.text('is visible ? true', skipOffstage: false), findsOneWidget); await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: Visibility( maintainState: true, child: _ShowVisibility(), ), ), ); expect(find.text('is visible ? true', skipOffstage: false), findsOneWidget); await tester.pumpWidget( const Directionality( textDirection: TextDirection.ltr, child: Visibility( visible: false, maintainState: true, child: _ShowVisibility(), ), ), ); expect(find.text('is visible ? false', skipOffstage: false), findsOneWidget); }); testWidgets('Visibility.of works when multiple Visibility widgets are in hierarchy', (WidgetTester tester) async { bool didChangeDependencies = false; void handleDidChangeDependencies() { didChangeDependencies = true; } Widget newWidget({required bool ancestorIsVisible, required bool descendantIsVisible}) { return Directionality( textDirection: TextDirection.ltr, child: Visibility( visible: ancestorIsVisible, maintainState: true, child: Center( child: Visibility( visible: descendantIsVisible, maintainState: true, child: _ShowVisibility( onDidChangeDependencies: handleDidChangeDependencies, ), ), ), ), ); } await tester.pumpWidget(newWidget(ancestorIsVisible: true, descendantIsVisible: true)); expect(didChangeDependencies, isTrue); expect(find.text('is visible ? true', skipOffstage: false), findsOneWidget); didChangeDependencies = false; await tester.pumpWidget(newWidget(ancestorIsVisible: true, descendantIsVisible: false)); expect(didChangeDependencies, isTrue); expect(find.text('is visible ? false', skipOffstage: false), findsOneWidget); didChangeDependencies = false; await tester.pumpWidget(newWidget(ancestorIsVisible: true, descendantIsVisible: false)); expect(didChangeDependencies, isFalse); await tester.pumpWidget(newWidget(ancestorIsVisible: false, descendantIsVisible: false)); expect(didChangeDependencies, isTrue); didChangeDependencies = false; await tester.pumpWidget(newWidget(ancestorIsVisible: false, descendantIsVisible: true)); expect(didChangeDependencies, isTrue); expect(find.text('is visible ? false', skipOffstage: false), findsOneWidget); }); } class _ShowVisibility extends StatefulWidget { const _ShowVisibility({this.onDidChangeDependencies}); final VoidCallback? onDidChangeDependencies; @override State<_ShowVisibility> createState() => _ShowVisibilityState(); } class _ShowVisibilityState extends State<_ShowVisibility> { @override void didChangeDependencies() { super.didChangeDependencies(); if (widget.onDidChangeDependencies != null) { widget.onDidChangeDependencies!(); } } @override Widget build(BuildContext context) { return Text('is visible ? ${Visibility.of(context)}'); } }
flutter/packages/flutter/test/widgets/visibility_test.dart/0
{ "file_path": "flutter/packages/flutter/test/widgets/visibility_test.dart", "repo_id": "flutter", "token_count": 8031 }
777
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/gestures.dart'; void main() { // Change made in https://github.com/flutter/flutter/pull/28602 final PointerEnterEvent enterEvent = PointerEnterEvent.fromMouseEvent(PointerHoverEvent()); // Change made in https://github.com/flutter/flutter/pull/28602 final PointerExitEvent exitEvent = PointerExitEvent.fromMouseEvent(PointerHoverEvent()); // Changes made in https://github.com/flutter/flutter/pull/66043 VelocityTracker tracker = VelocityTracker.withKind(PointerDeviceKind.touch); tracker = VelocityTracker.withKind(PointerDeviceKind.mouse); tracker = VelocityTracker.withKind(PointerDeviceKind.touch, error: ''); // Changes made in https://github.com/flutter/flutter/pull/81858 DragGestureRecognizer(); DragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); DragGestureRecognizer(error: ''); VerticalDragGestureRecognizer(); VerticalDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); VerticalDragGestureRecognizer(error: ''); HorizontalDragGestureRecognizer(); HorizontalDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); HorizontalDragGestureRecognizer(error: ''); GestureRecognizer(); GestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); GestureRecognizer(error: ''); OneSequenceGestureRecognizer(); OneSequenceGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); OneSequenceGestureRecognizer(error: ''); PrimaryPointerGestureRecognizer(); PrimaryPointerGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); PrimaryPointerGestureRecognizer(error: ''); EagerGestureRecognizer(); EagerGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); EagerGestureRecognizer(error: ''); ForcePressGestureRecognizer(); ForcePressGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); ForcePressGestureRecognizer(error: ''); LongPressGestureRecognizer(); LongPressGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); LongPressGestureRecognizer(error: ''); MultiDragGestureRecognizer(); MultiDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); MultiDragGestureRecognizer(error: ''); ImmediateMultiDragGestureRecognizer(); ImmediateMultiDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); ImmediateMultiDragGestureRecognizer(error: ''); HorizontalMultiDragGestureRecognizer(); HorizontalMultiDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); HorizontalMultiDragGestureRecognizer(error: ''); VerticalMultiDragGestureRecognizer(); VerticalMultiDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); VerticalMultiDragGestureRecognizer(error: ''); DelayedMultiDragGestureRecognizer(); DelayedMultiDragGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); DelayedMultiDragGestureRecognizer(error: ''); DoubleTapGestureRecognizer(); DoubleTapGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); DoubleTapGestureRecognizer(error: ''); MultiTapGestureRecognizer(); MultiTapGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); MultiTapGestureRecognizer(error: ''); ScaleGestureRecognizer(); ScaleGestureRecognizer(supportedDevices: <PointerDeviceKind>{PointerDeviceKind.touch}); ScaleGestureRecognizer(error: ''); }
flutter/packages/flutter/test_fixes/gestures/gestures.dart.expect/0
{ "file_path": "flutter/packages/flutter/test_fixes/gestures/gestures.dart.expect", "repo_id": "flutter", "token_count": 1210 }
778
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; void main() { // Changes made in https://github.com/flutter/flutter/pull/66482 ThemeData(textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red)); ThemeData(textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue)); ThemeData(textSelectionTheme: TextSelectionThemeData(selectionHandleColor: Colors.yellow)); ThemeData(); ThemeData(textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red)); ThemeData(textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue)); ThemeData( textSelectionTheme: TextSelectionThemeData(selectionHandleColor: Colors.yellow)); ThemeData( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionHandleColor: Colors.yellow,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionHandleColor: Colors.yellow,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData(error: ''); ThemeData.raw(error: ''); ThemeData.raw(textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red)); ThemeData.raw(textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue)); ThemeData.raw(textSelectionTheme: TextSelectionThemeData(selectionHandleColor: Colors.yellow)); ThemeData.raw(); ThemeData.raw(textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red)); ThemeData.raw(textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue)); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(selectionHandleColor: Colors.yellow)); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionHandleColor: Colors.yellow,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionHandleColor: Colors.yellow,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); ThemeData.raw( textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red, selectionHandleColor: Colors.yellow,), ); // Changes made in https://github.com/flutter/flutter/pull/81336 ThemeData themeData = ThemeData(); themeData = ThemeData(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.red)); themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(secondary: Colors.red)); themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(secondary: Colors.red)); themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, secondary: Colors.red)); themeData = ThemeData(error: ''); themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(secondary: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(secondary: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, secondary: Colors.red)); themeData = ThemeData.raw(error: ''); themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.red)); themeData = themeData.copyWith(error: ''); themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(secondary: Colors.red)); themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(secondary: Colors.red)); themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, secondary: Colors.red)); themeData.colorScheme.secondary; // Changes made in https://github.com/flutter/flutter/pull/81336 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.accentColorBrightness; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/81336 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.accentTextTheme; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/81336 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.accentIconTheme; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/81336 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.buttonColor; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/87281 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.fixTextFieldOutlineLabel; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/93396 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.primaryColorBrightness; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/97972 ThemeData themeData = ThemeData(); themeData = ThemeData(checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), radioTheme: RadioThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), )); themeData = ThemeData( checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), radioTheme: RadioThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), ); themeData = ThemeData.raw(checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), radioTheme: RadioThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), )); themeData = ThemeData.raw( checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), radioTheme: RadioThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), ); themeData = themeData.copyWith(checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), radioTheme: RadioThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), )); themeData = themeData.copyWith( checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), radioTheme: RadioThemeData( fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) { if (states.contains(WidgetState.disabled)) { return null; } if (states.contains(WidgetState.selected)) { return Colors.black; } return null; }), ), ); themeData.toggleableActiveColor; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/109070 ThemeData themeData = ThemeData(); themeData = ThemeData(); themeData = ThemeData.raw(); themeData = themeData.copyWith(); themeData.selectedRowColor; // Removing field reference not supported. // Changes made in https://github.com/flutter/flutter/pull/110162 ThemeData themeData = ThemeData(); themeData = ThemeData(colorScheme: ColorScheme(error: Colors.red)); themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(error: Colors.red)); themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(error: Colors.red)); themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, error: Colors.red)); themeData = ThemeData(otherParam: ''); themeData = ThemeData.raw(colorScheme: ColorScheme(error: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(error: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(error: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, error: Colors.red)); themeData = ThemeData.raw(otherParam: ''); themeData = themeData.copyWith(colorScheme: ColorScheme(error: Colors.red)); themeData = themeData.copyWith(otherParam: ''); themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(error: Colors.red)); themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(error: Colors.red)); themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, error: Colors.red)); themeData.colorScheme.error; // Changes made in https://github.com/flutter/flutter/pull/110162 ThemeData themeData = ThemeData(); themeData = ThemeData(colorScheme: ColorScheme(surface: Colors.grey)); themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(surface: Colors.grey)); themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(surface: Colors.grey)); themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, surface: Colors.grey)); themeData = ThemeData(otherParam: ''); themeData = ThemeData.raw(colorScheme: ColorScheme(surface: Colors.grey)); themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(surface: Colors.grey)); themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(surface: Colors.grey)); themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, surface: Colors.grey)); themeData = ThemeData.raw(otherParam: ''); themeData = themeData.copyWith(colorScheme: ColorScheme(surface: Colors.grey)); themeData = themeData.copyWith(otherParam: ''); themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(surface: Colors.grey)); themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(surface: Colors.grey)); themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, surface: Colors.grey)); themeData.colorScheme.surface; // Changes made in https://github.com/flutter/flutter/pull/110162 ThemeData themeData = ThemeData(); themeData = ThemeData(colorScheme: ColorScheme(surface: Colors.grey).copyWith(error: Colors.red)); themeData = ThemeData.raw(colorScheme: ColorScheme(surface: Colors.grey).copyWith(error: Colors.red)); themeData = themeData.copyWith(colorScheme: ColorScheme(surface: Colors.grey).copyWith(error: Colors.red)); // Changes made in https://github.com/flutter/flutter/pull/111080 ThemeData themeData = ThemeData(); themeData = ThemeData(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData.raw(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData.copyWith(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); // Changes made in https://github.com/flutter/flutter/pull/131455 ThemeData themeData = ThemeData.copyWith(); }
flutter/packages/flutter/test_fixes/material/theme_data.dart.expect/0
{ "file_path": "flutter/packages/flutter/test_fixes/material/theme_data.dart.expect", "repo_id": "flutter", "token_count": 6893 }
779
{ "tests": [ "animated_icons_private_test.dart.tmpl" ], "pubspec": "pubspec.yaml", "test_deps": [], "deps": [ "lib/src/material/animated_icons/animated_icons.dart", "lib/src/material/animated_icons/animated_icons_data.dart", "lib/src/material/animated_icons/data/add_event.g.dart", "lib/src/material/animated_icons/data/arrow_menu.g.dart", "lib/src/material/animated_icons/data/close_menu.g.dart", "lib/src/material/animated_icons/data/ellipsis_search.g.dart", "lib/src/material/animated_icons/data/event_add.g.dart", "lib/src/material/animated_icons/data/home_menu.g.dart", "lib/src/material/animated_icons/data/list_view.g.dart", "lib/src/material/animated_icons/data/menu_arrow.g.dart", "lib/src/material/animated_icons/data/menu_close.g.dart", "lib/src/material/animated_icons/data/menu_home.g.dart", "lib/src/material/animated_icons/data/pause_play.g.dart", "lib/src/material/animated_icons/data/play_pause.g.dart", "lib/src/material/animated_icons/data/search_ellipsis.g.dart", "lib/src/material/animated_icons/data/view_list.g.dart" ] }
flutter/packages/flutter/test_private/test/animated_icons_private_test.json/0
{ "file_path": "flutter/packages/flutter/test_private/test/animated_icons_private_test.json", "repo_id": "flutter", "token_count": 498 }
780
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /// Provides API to test Flutter applications that run on real /// devices and emulators. /// /// The application runs in a separate process from the test itself. /// /// This is Flutter's version of Selenium WebDriver (generic web), /// Protractor (Angular), Espresso (Android) or Earl Gray (iOS). library flutter_driver; export 'src/common/deserialization_factory.dart'; export 'src/common/diagnostics_tree.dart'; export 'src/common/enum_util.dart'; export 'src/common/error.dart'; export 'src/common/find.dart'; export 'src/common/frame_sync.dart'; export 'src/common/fuchsia_compat.dart'; export 'src/common/geometry.dart'; export 'src/common/gesture.dart'; export 'src/common/health.dart'; export 'src/common/message.dart'; export 'src/common/render_tree.dart'; export 'src/common/request_data.dart'; export 'src/common/semantics.dart'; export 'src/common/text.dart'; export 'src/common/text_input_action.dart'; export 'src/common/wait.dart'; export 'src/driver/common.dart'; export 'src/driver/driver.dart'; export 'src/driver/timeline.dart'; export 'src/driver/timeline_summary.dart';
flutter/packages/flutter_driver/lib/flutter_driver.dart/0
{ "file_path": "flutter/packages/flutter_driver/lib/flutter_driver.dart", "repo_id": "flutter", "token_count": 408 }
781
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'message.dart'; /// A Flutter Driver command that enables or disables semantics. class SetSemantics extends Command { /// Creates a command that enables or disables semantics. const SetSemantics(this.enabled, { super.timeout }); /// Deserializes this command from the value generated by [serialize]. SetSemantics.deserialize(super.json) : enabled = json['enabled']!.toLowerCase() == 'true', super.deserialize(); /// Whether semantics should be enabled (true) or disabled (false). final bool enabled; @override String get kind => 'set_semantics'; @override Map<String, String> serialize() => super.serialize()..addAll(<String, String>{ 'enabled': '$enabled', }); } /// The result of a [SetSemantics] command. class SetSemanticsResult extends Result { /// Create a result with the given [changedState]. const SetSemanticsResult(this.changedState); /// Whether the [SetSemantics] command actually changed the state that the /// application was in. final bool changedState; /// Deserializes this result from JSON. static SetSemanticsResult fromJson(Map<String, dynamic> json) { return SetSemanticsResult(json['changedState'] as bool); } @override Map<String, dynamic> toJson() => <String, dynamic>{ 'changedState': changedState, }; }
flutter/packages/flutter_driver/lib/src/common/semantics.dart/0
{ "file_path": "flutter/packages/flutter_driver/lib/src/common/semantics.dart", "repo_id": "flutter", "token_count": 425 }
782
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:convert' show JsonEncoder, json; import 'dart:math' as math; import 'package:file/file.dart'; import 'package:path/path.dart' as path; import 'common.dart'; import 'frame_request_pending_latency_summarizer.dart'; import 'gc_summarizer.dart'; import 'gpu_sumarizer.dart'; import 'memory_summarizer.dart'; import 'percentile_utils.dart'; import 'profiling_summarizer.dart'; import 'raster_cache_summarizer.dart'; import 'refresh_rate_summarizer.dart'; import 'scene_display_lag_summarizer.dart'; import 'timeline.dart'; import 'vsync_frame_lag_summarizer.dart'; const JsonEncoder _prettyEncoder = JsonEncoder.withIndent(' '); const String _kEmptyDurationMessage = r''' The TimelineSummary had no events to summarize. This can happen if the timeline summarization covered too short of a period or if the driver script failed to interact with the application to generate events. For example, if your driver script contained only a "driver.scroll()" command but the app under test was not scrollable then no events would be generated by the interaction. '''; /// The maximum amount of time considered safe to spend for a frame's build /// phase. Anything past that is in the danger of missing the frame at 60FPS. /// /// This is a hard-coded number and does not take into account the real device /// frame rate. Prefer using percentiles on the total build or raster time /// than metrics based on this value. const Duration kBuildBudget = Duration(milliseconds: 16); /// The name of the framework frame build events we need to filter or extract. const String kBuildFrameEventName = 'Frame'; /// The name of the engine frame rasterization events we need to filter or extract. const String kRasterizeFrameEventName = 'GPURasterizer::Draw'; /// Extracts statistics from a [Timeline]. class TimelineSummary { /// Creates a timeline summary given a full timeline object. TimelineSummary.summarize(this._timeline); final Timeline _timeline; /// Average amount of time spent per frame in the framework building widgets, /// updating layout, painting and compositing. /// /// Throws a [StateError] if this summary contains no timeline events. double computeAverageFrameBuildTimeMillis() { return _averageInMillis(_extractFrameDurations()); } /// The [p]-th percentile frame rasterization time in milliseconds. /// /// Throws a [StateError] if this summary contains no timeline events. double computePercentileFrameBuildTimeMillis(double p) { return _percentileInMillis(_extractFrameDurations(), p); } /// The longest frame build time in milliseconds. /// /// Throws a [StateError] if this summary contains no timeline events. double computeWorstFrameBuildTimeMillis() { return _maxInMillis(_extractFrameDurations()); } /// The number of frames that missed the [kBuildBudget] and therefore are /// in the danger of missing frames. /// /// This does not take into account the real device frame rate. Prefer using /// [computePercentileFrameBuildTimeMillis] for evaluating performance. int computeMissedFrameBuildBudgetCount() { return _extractFrameDurations() .where((Duration duration) => duration > kBuildBudget) .length; } /// Average amount of time spent per frame in the engine rasterizer. /// /// Throws a [StateError] if this summary contains no timeline events. double computeAverageFrameRasterizerTimeMillis() { return _averageInMillis(_extractGpuRasterizerDrawDurations()); } /// Standard deviation amount of time spent per frame in the engine rasterizer. /// /// Throws a [StateError] if this summary contains no timeline events. double computeStandardDeviationFrameRasterizerTimeMillis() { final List<Duration> durations = _extractGpuRasterizerDrawDurations(); final double average = _averageInMillis(durations); double tally = 0.0; for (final Duration duration in durations) { final double time = duration.inMicroseconds.toDouble() / 1000.0; tally += (average - time).abs(); } return tally / durations.length; } /// The longest frame rasterization time in milliseconds. /// /// Throws a [StateError] if this summary contains no timeline events. double computeWorstFrameRasterizerTimeMillis() { return _maxInMillis(_extractGpuRasterizerDrawDurations()); } /// The [p]-th percentile frame rasterization time in milliseconds. /// /// Throws a [StateError] if this summary contains no timeline events. double computePercentileFrameRasterizerTimeMillis(double p) { return _percentileInMillis(_extractGpuRasterizerDrawDurations(), p); } /// The number of frames that missed the [kBuildBudget] on the raster thread /// and therefore are in the danger of missing frames. /// /// This does not take into account the real device frame rate. Prefer using /// [computePercentileFrameRasterizerTimeMillis] for evaluating performance. int computeMissedFrameRasterizerBudgetCount() { return _extractGpuRasterizerDrawDurations() .where((Duration duration) => duration > kBuildBudget) .length; } /// The total number of frames recorded in the timeline. int countFrames() => _extractFrameDurations().length; /// The total number of rasterizer cycles recorded in the timeline. int countRasterizations() => _extractGpuRasterizerDrawDurations().length; /// The total number of old generation garbage collections recorded in the timeline. int oldGenerationGarbageCollections() { return _timeline.events!.where((TimelineEvent event) { return event.category == 'GC' && event.name == 'CollectOldGeneration'; }).length; } /// The total number of new generation garbage collections recorded in the timeline. int newGenerationGarbageCollections() { return _timeline.events!.where((TimelineEvent event) { return event.category == 'GC' && event.name == 'CollectNewGeneration'; }).length; } /// Encodes this summary as JSON. /// /// Data ends with "_time_millis" means time in milliseconds and numbers in /// the "frame_build_times", "frame_rasterizer_times", "frame_begin_times" and /// "frame_rasterizer_begin_times" lists are in microseconds. /// /// * "average_frame_build_time_millis": Average amount of time spent per /// frame in the framework building widgets, updating layout, painting and /// compositing. /// See [computeAverageFrameBuildTimeMillis]. /// * "90th_percentile_frame_build_time_millis" and /// "99th_percentile_frame_build_time_millis": The p-th percentile frame /// rasterization time in milliseconds. 90 and 99-th percentile number is /// usually a better metric to estimate worse cases. See discussion in /// https://github.com/flutter/flutter/pull/19121#issuecomment-419520765 /// See [computePercentileFrameBuildTimeMillis]. /// * "worst_frame_build_time_millis": The longest frame build time. /// See [computeWorstFrameBuildTimeMillis]. /// * "missed_frame_build_budget_count': The number of frames that missed /// the [kBuildBudget] and therefore are in the danger of missing frames. /// See [computeMissedFrameBuildBudgetCount]. Because [kBuildBudget] is a /// constant, this does not represent a real missed frame count. /// * "average_frame_rasterizer_time_millis": Average amount of time spent /// per frame in the engine rasterizer. /// See [computeAverageFrameRasterizerTimeMillis]. /// * "stddev_frame_rasterizer_time_millis": Standard deviation of the amount /// of time spent per frame in the engine rasterizer. /// See [computeStandardDeviationFrameRasterizerTimeMillis]. /// * "90th_percentile_frame_rasterizer_time_millis" and /// "99th_percentile_frame_rasterizer_time_millis": The 90/99-th percentile /// frame rasterization time in milliseconds. /// See [computePercentileFrameRasterizerTimeMillis]. /// * "worst_frame_rasterizer_time_millis": The longest frame rasterization /// time. /// See [computeWorstFrameRasterizerTimeMillis]. /// * "missed_frame_rasterizer_budget_count": The number of frames that missed /// the [kBuildBudget] on the raster thread and therefore are in the danger /// of missing frames. See [computeMissedFrameRasterizerBudgetCount]. /// Because [kBuildBudget] is a constant, this does not represent a real /// missed frame count. /// * "frame_count": The total number of frames recorded in the timeline. This /// is also the length of the "frame_build_times" and the "frame_begin_times" /// lists. /// See [countFrames]. /// * "frame_rasterizer_count": The total number of rasterizer cycles recorded /// in the timeline. This is also the length of the "frame_rasterizer_times" /// and the "frame_rasterizer_begin_times" lists. /// See [countRasterizations]. /// * "frame_build_times": The build time of each frame, by tracking the /// [TimelineEvent] with name [kBuildFrameEventName]. /// * "frame_rasterizer_times": The rasterize time of each frame, by tracking /// the [TimelineEvent] with name [kRasterizeFrameEventName] /// * "frame_begin_times": The build begin timestamp of each frame. /// * "frame_rasterizer_begin_times": The rasterize begin time of each frame. /// * "average_vsync_transitions_missed": Computes the average of the /// `vsync_transitions_missed` over the lag events. /// See [SceneDisplayLagSummarizer.computeAverageVsyncTransitionsMissed]. /// * "90th_percentile_vsync_transitions_missed" and /// "99th_percentile_vsync_transitions_missed": The 90/99-th percentile /// `vsync_transitions_missed` over the lag events. /// See [SceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed]. /// * "average_vsync_frame_lag": Computes the average of the time between /// platform vsync signal and the engine frame process start time. /// See [VsyncFrameLagSummarizer.computeAverageVsyncFrameLag]. /// * "90th_percentile_vsync_frame_lag" and "99th_percentile_vsync_frame_lag": /// The 90/99-th percentile delay between platform vsync signal and engine /// frame process start time. /// See [VsyncFrameLagSummarizer.computePercentileVsyncFrameLag]. /// * "average_layer_cache_count": The average of the values seen for the /// count of the engine layer cache entries. /// See [RasterCacheSummarizer.computeAverageLayerCount]. /// * "90th_percentile_layer_cache_count" and /// "99th_percentile_layer_cache_count": The 90/99-th percentile values seen /// for the count of the engine layer cache entries. /// See [RasterCacheSummarizer.computePercentileLayerCount]. /// * "worst_layer_cache_count": The worst (highest) value seen for the /// count of the engine layer cache entries. /// See [RasterCacheSummarizer.computeWorstLayerCount]. /// * "average_layer_cache_memory": The average of the values seen for the /// memory used for the engine layer cache entries, in megabytes. /// See [RasterCacheSummarizer.computeAverageLayerMemory]. /// * "90th_percentile_layer_cache_memory" and /// "99th_percentile_layer_cache_memory": The 90/99-th percentile values seen /// for the memory used for the engine layer cache entries. /// See [RasterCacheSummarizer.computePercentileLayerMemory]. /// * "worst_layer_cache_memory": The worst (highest) value seen for the /// memory used for the engine layer cache entries. /// See [RasterCacheSummarizer.computeWorstLayerMemory]. /// * "average_picture_cache_count": The average of the values seen for the /// count of the engine picture cache entries. /// See [RasterCacheSummarizer.computeAveragePictureCount]. /// * "90th_percentile_picture_cache_count" and /// "99th_percentile_picture_cache_count": The 90/99-th percentile values seen /// for the count of the engine picture cache entries. /// See [RasterCacheSummarizer.computePercentilePictureCount]. /// * "worst_picture_cache_count": The worst (highest) value seen for the /// count of the engine picture cache entries. /// See [RasterCacheSummarizer.computeWorstPictureCount]. /// * "average_picture_cache_memory": The average of the values seen for the /// memory used for the engine picture cache entries, in megabytes. /// See [RasterCacheSummarizer.computeAveragePictureMemory]. /// * "90th_percentile_picture_cache_memory" and /// "99th_percentile_picture_cache_memory": The 90/99-th percentile values seen /// for the memory used for the engine picture cache entries. /// See [RasterCacheSummarizer.computePercentilePictureMemory]. /// * "worst_picture_cache_memory": The worst (highest) value seen for the /// memory used for the engine picture cache entries. /// See [RasterCacheSummarizer.computeWorstPictureMemory]. /// * "average_frame_request_pending_latency": Computes the average of the delay /// between `Animator::RequestFrame` and `Animator::BeginFrame` in the engine. /// See [FrameRequestPendingLatencySummarizer.computeAverageFrameRequestPendingLatency]. /// * "90th_percentile_frame_request_pending_latency" and /// "99th_percentile_frame_request_pending_latency": The 90/99-th percentile /// delay between `Animator::RequestFrame` and `Animator::BeginFrame` in the /// engine. /// See [FrameRequestPendingLatencySummarizer.computePercentileFrameRequestPendingLatency]. Map<String, dynamic> get summaryJson { final SceneDisplayLagSummarizer sceneDisplayLagSummarizer = _sceneDisplayLagSummarizer(); final VsyncFrameLagSummarizer vsyncFrameLagSummarizer = _vsyncFrameLagSummarizer(); final Map<String, dynamic> profilingSummary = _profilingSummarizer().summarize(); final RasterCacheSummarizer rasterCacheSummarizer = _rasterCacheSummarizer(); final GCSummarizer gcSummarizer = _gcSummarizer(); final RefreshRateSummary refreshRateSummary = RefreshRateSummary(vsyncEvents: _extractNamedEvents(kUIThreadVsyncProcessEvent)); final FrameRequestPendingLatencySummarizer frameRequestPendingLatencySummarizer = _frameRequestPendingLatencySummarizer(); final GpuSumarizer gpuSummarizer = _gpuSumarizer(); final GPUMemorySumarizer memorySumarizer = _memorySummarizer(); final Map<String, dynamic> timelineSummary = <String, dynamic>{ 'average_frame_build_time_millis': computeAverageFrameBuildTimeMillis(), '90th_percentile_frame_build_time_millis': computePercentileFrameBuildTimeMillis(90.0), '99th_percentile_frame_build_time_millis': computePercentileFrameBuildTimeMillis(99.0), 'worst_frame_build_time_millis': computeWorstFrameBuildTimeMillis(), 'missed_frame_build_budget_count': computeMissedFrameBuildBudgetCount(), 'average_frame_rasterizer_time_millis': computeAverageFrameRasterizerTimeMillis(), 'stddev_frame_rasterizer_time_millis': computeStandardDeviationFrameRasterizerTimeMillis(), '90th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(90.0), '99th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(99.0), 'worst_frame_rasterizer_time_millis': computeWorstFrameRasterizerTimeMillis(), 'missed_frame_rasterizer_budget_count': computeMissedFrameRasterizerBudgetCount(), 'frame_count': countFrames(), 'frame_rasterizer_count': countRasterizations(), 'new_gen_gc_count': newGenerationGarbageCollections(), 'old_gen_gc_count': oldGenerationGarbageCollections(), 'frame_build_times': _extractFrameDurations() .map<int>((Duration duration) => duration.inMicroseconds) .toList(), 'frame_rasterizer_times': _extractGpuRasterizerDrawDurations() .map<int>((Duration duration) => duration.inMicroseconds) .toList(), 'frame_begin_times': _extractBeginTimestamps(kBuildFrameEventName) .map<int>((Duration duration) => duration.inMicroseconds) .toList(), 'frame_rasterizer_begin_times': _extractBeginTimestamps(kRasterizeFrameEventName) .map<int>((Duration duration) => duration.inMicroseconds) .toList(), 'average_vsync_transitions_missed': sceneDisplayLagSummarizer.computeAverageVsyncTransitionsMissed(), '90th_percentile_vsync_transitions_missed': sceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed(90.0), '99th_percentile_vsync_transitions_missed': sceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed(99.0), 'average_vsync_frame_lag': vsyncFrameLagSummarizer.computeAverageVsyncFrameLag(), '90th_percentile_vsync_frame_lag': vsyncFrameLagSummarizer.computePercentileVsyncFrameLag(90.0), '99th_percentile_vsync_frame_lag': vsyncFrameLagSummarizer.computePercentileVsyncFrameLag(99.0), 'average_layer_cache_count': rasterCacheSummarizer.computeAverageLayerCount(), '90th_percentile_layer_cache_count': rasterCacheSummarizer.computePercentileLayerCount(90.0), '99th_percentile_layer_cache_count': rasterCacheSummarizer.computePercentileLayerCount(99.0), 'average_frame_request_pending_latency': frameRequestPendingLatencySummarizer.computeAverageFrameRequestPendingLatency(), '90th_percentile_frame_request_pending_latency': frameRequestPendingLatencySummarizer.computePercentileFrameRequestPendingLatency(90.0), '99th_percentile_frame_request_pending_latency': frameRequestPendingLatencySummarizer.computePercentileFrameRequestPendingLatency(99.0), 'worst_layer_cache_count': rasterCacheSummarizer.computeWorstLayerCount(), 'average_layer_cache_memory': rasterCacheSummarizer.computeAverageLayerMemory(), '90th_percentile_layer_cache_memory': rasterCacheSummarizer.computePercentileLayerMemory(90.0), '99th_percentile_layer_cache_memory': rasterCacheSummarizer.computePercentileLayerMemory(99.0), 'worst_layer_cache_memory': rasterCacheSummarizer.computeWorstLayerMemory(), 'average_picture_cache_count': rasterCacheSummarizer.computeAveragePictureCount(), '90th_percentile_picture_cache_count': rasterCacheSummarizer.computePercentilePictureCount(90.0), '99th_percentile_picture_cache_count': rasterCacheSummarizer.computePercentilePictureCount(99.0), 'worst_picture_cache_count': rasterCacheSummarizer.computeWorstPictureCount(), 'average_picture_cache_memory': rasterCacheSummarizer.computeAveragePictureMemory(), '90th_percentile_picture_cache_memory': rasterCacheSummarizer.computePercentilePictureMemory(90.0), '99th_percentile_picture_cache_memory': rasterCacheSummarizer.computePercentilePictureMemory(99.0), 'worst_picture_cache_memory': rasterCacheSummarizer.computeWorstPictureMemory(), 'total_ui_gc_time': gcSummarizer.totalGCTimeMillis, '30hz_frame_percentage': refreshRateSummary.percentageOf30HzFrames, '60hz_frame_percentage': refreshRateSummary.percentageOf60HzFrames, '80hz_frame_percentage': refreshRateSummary.percentageOf80HzFrames, '90hz_frame_percentage': refreshRateSummary.percentageOf90HzFrames, '120hz_frame_percentage': refreshRateSummary.percentageOf120HzFrames, 'illegal_refresh_rate_frame_count': refreshRateSummary.framesWithIllegalRefreshRate.length, 'average_gpu_frame_time': gpuSummarizer.computeAverageGPUTime(), '90th_percentile_gpu_frame_time': gpuSummarizer.computePercentileGPUTime(90.0), '99th_percentile_gpu_frame_time': gpuSummarizer.computePercentileGPUTime(99.0), 'worst_gpu_frame_time': gpuSummarizer.computeWorstGPUTime(), 'average_gpu_memory_mb': memorySumarizer.computeAverageMemoryUsage(), '90th_percentile_gpu_memory_mb': memorySumarizer.computePercentileMemoryUsage(90.0), '99th_percentile_gpu_memory_mb': memorySumarizer.computePercentileMemoryUsage(99.0), 'worst_gpu_memory_mb': memorySumarizer.computeWorstMemoryUsage(), }; timelineSummary.addAll(profilingSummary); return timelineSummary; } /// Writes all of the recorded timeline data to a file. /// /// By default, this will dump [summaryJson] to a companion file named /// `$traceName.timeline_summary.json`. If you want to skip the summary, set /// the `includeSummary` parameter to false. /// /// See also: /// /// * [Timeline.fromJson], which explains detail about the timeline data. Future<void> writeTimelineToFile( String traceName, { String? destinationDirectory, bool pretty = false, bool includeSummary = true, }) async { destinationDirectory ??= testOutputsDirectory; await fs.directory(destinationDirectory).create(recursive: true); final File file = fs.file(path.join(destinationDirectory, '$traceName.timeline.json')); await file.writeAsString(_encodeJson(_timeline.json, pretty)); if (includeSummary) { await _writeSummaryToFile(traceName, destinationDirectory: destinationDirectory, pretty: pretty); } } Future<void> _writeSummaryToFile( String traceName, { required String destinationDirectory, bool pretty = false, }) async { await fs.directory(destinationDirectory).create(recursive: true); final File file = fs.file(path.join(destinationDirectory, '$traceName.timeline_summary.json')); await file.writeAsString(_encodeJson(summaryJson, pretty)); } String _encodeJson(Map<String, dynamic> jsonObject, bool pretty) { return pretty ? _prettyEncoder.convert(jsonObject) : json.encode(jsonObject); } List<TimelineEvent> _extractNamedEvents(String name) { return _timeline.events! .where((TimelineEvent event) => event.name == name) .toList(); } List<TimelineEvent> _extractEventsWithNames(Set<String> names) { return _timeline.events! .where((TimelineEvent event) => names.contains(event.name)) .toList(); } List<Duration> _extractDurations( String name, Duration Function(TimelineEvent beginEvent, TimelineEvent endEvent) extractor, ) { final List<Duration> result = <Duration>[]; final List<TimelineEvent> events = _extractNamedEvents(name); // Timeline does not guarantee that the first event is the "begin" event. TimelineEvent? begin; for (final TimelineEvent event in events) { if (event.phase == 'B' || event.phase == 'b') { begin = event; } else { if (begin != null) { result.add(extractor(begin, event)); // each begin only gets used once. begin = null; } } } return result; } /// Extracts Duration list that are reported as a pair of begin/end events. /// /// Extracts Duration of events by looking for events with the name and phase /// begin ("ph": "B"). This routine assumes that the next event with the same /// name is phase end ("ph": "E"), but it's not examined. /// "SceneDisplayLag" event is an exception, with phase ("ph") labeled /// 'b' and 'e', meaning begin and end phase for an async event. /// See [SceneDisplayLagSummarizer]. /// See: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU List<Duration> _extractBeginEndEvents(String name) { return _extractDurations( name, (TimelineEvent beginEvent, TimelineEvent endEvent) { return Duration(microseconds: endEvent.timestampMicros! - beginEvent.timestampMicros!); }, ); } List<Duration> _extractBeginTimestamps(String name) { final List<Duration> result = _extractDurations( name, (TimelineEvent beginEvent, TimelineEvent endEvent) { return Duration(microseconds: beginEvent.timestampMicros!); }, ); // Align timestamps so the first event is at 0. for (int i = result.length - 1; i >= 0; i -= 1) { result[i] = result[i] - result[0]; } return result; } double _averageInMillis(List<Duration> durations) { if (durations.isEmpty) { throw StateError(_kEmptyDurationMessage); } final double total = durations.fold<double>(0.0, (double t, Duration duration) => t + duration.inMicroseconds.toDouble() / 1000.0); return total / durations.length; } double _percentileInMillis(List<Duration> durations, double percentile) { if (durations.isEmpty) { throw StateError(_kEmptyDurationMessage); } assert(percentile >= 0.0 && percentile <= 100.0); final List<double> doubles = durations.map<double>((Duration duration) => duration.inMicroseconds.toDouble() / 1000.0).toList(); return findPercentile(doubles, percentile); } double _maxInMillis(List<Duration> durations) { if (durations.isEmpty) { throw StateError(_kEmptyDurationMessage); } return durations .map<double>((Duration duration) => duration.inMicroseconds.toDouble() / 1000.0) .reduce(math.max); } SceneDisplayLagSummarizer _sceneDisplayLagSummarizer() => SceneDisplayLagSummarizer(_extractNamedEvents(kSceneDisplayLagEvent)); List<Duration> _extractGpuRasterizerDrawDurations() => _extractBeginEndEvents(kRasterizeFrameEventName); ProfilingSummarizer _profilingSummarizer() => ProfilingSummarizer.fromEvents(_extractEventsWithNames(kProfilingEvents)); List<Duration> _extractFrameDurations() => _extractBeginEndEvents(kBuildFrameEventName); VsyncFrameLagSummarizer _vsyncFrameLagSummarizer() => VsyncFrameLagSummarizer(_extractEventsWithNames(kVsyncTimelineEventNames)); RasterCacheSummarizer _rasterCacheSummarizer() => RasterCacheSummarizer(_extractNamedEvents(kRasterCacheEvent)); FrameRequestPendingLatencySummarizer _frameRequestPendingLatencySummarizer() => FrameRequestPendingLatencySummarizer(_extractNamedEvents(kFrameRequestPendingEvent)); GCSummarizer _gcSummarizer() => GCSummarizer.fromEvents(_extractEventsWithNames(kGCRootEvents)); GpuSumarizer _gpuSumarizer() => GpuSumarizer(_extractEventsWithNames(GpuSumarizer.kGpuEvents)); GPUMemorySumarizer _memorySummarizer() => GPUMemorySumarizer(_extractEventsWithNames(GPUMemorySumarizer.kMemoryEvents)); }
flutter/packages/flutter_driver/lib/src/driver/timeline_summary.dart/0
{ "file_path": "flutter/packages/flutter_driver/lib/src/driver/timeline_summary.dart", "repo_id": "flutter", "token_count": 8468 }
783
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter_driver/flutter_driver.dart'; import '../../common.dart'; void main() { test('RequestData does not insert "null" string when no message is provided', () { const RequestData data = RequestData(null); expect(data.serialize(), <String, String>{'command': 'request_data'}); }); }
flutter/packages/flutter_driver/test/src/real_tests/request_data_test.dart/0
{ "file_path": "flutter/packages/flutter_driver/test/src/real_tests/request_data_test.dart", "repo_id": "flutter", "token_count": 143 }
784
## Directory contents The Dart files and golden master `.expect` files in this directory are used to test the [`dart fix` framework](https://dart.dev/tools/dart-fix) refactorings used by the Flutter framework. See the flutter/packages/flutter_driver/lib/fix_data directory for the current package:flutter data-driven fixes. To run these tests locally, execute this command in the flutter/packages/flutter_driver/test_fixes directory. ```sh dart fix --compare-to-golden ``` For more documentation about Data Driven Fixes, see https://dart.dev/go/data-driven-fixes#test-folder. To learn more about how fixes are authored in package:flutter, see https://github.com/flutter/flutter/wiki/Data-driven-Fixes ## When making structural changes to this directory The tests in this directory are also invoked from external repositories. Specifically, the CI system for the dart-lang/sdk repo runs these tests in order to ensure that changes to the dart fix file format do not break Flutter. See [tools/bots/flutter/analyze_flutter_flutter.sh](https://github.com/dart-lang/sdk/blob/main/tools/bots/flutter/analyze_flutter_flutter.sh) for where the tests are invoked. When possible, please coordinate changes to this directory that might affect the `analyze_flutter_flutter.sh` script.
flutter/packages/flutter_driver/test_fixes/README.md/0
{ "file_path": "flutter/packages/flutter_driver/test_fixes/README.md", "repo_id": "flutter", "token_count": 373 }
785
{ "datePickerHourSemanticsLabelOne": "$hour ሰዓት", "datePickerHourSemanticsLabelOther": "$hour ሰዓት", "datePickerMinuteSemanticsLabelOne": "1 ደቂቃ", "datePickerMinuteSemanticsLabelOther": "$minute ደቂቃዎች", "datePickerDateOrder": "dmy", "datePickerDateTimeOrder": "date_time_dayPeriod", "anteMeridiemAbbreviation": "ጥዋት", "postMeridiemAbbreviation": "ከሰዓት", "todayLabel": "ዛሬ", "alertDialogLabel": "ማንቂያ", "timerPickerHourLabelOne": "ሰዓት", "timerPickerHourLabelOther": "ሰዓቶች", "timerPickerMinuteLabelOne": "ደቂቃ", "timerPickerMinuteLabelOther": "ደቂቃ", "timerPickerSecondLabelOne": "ሴኮ", "timerPickerSecondLabelOther": "ሴኮ", "cutButtonLabel": "ቁረጥ", "copyButtonLabel": "ቅዳ", "pasteButtonLabel": "ለጥፍ", "selectAllButtonLabel": "ሁሉንም ምረጥ", "tabSemanticsLabel": "ትር $tabIndex ከ$tabCount", "modalBarrierDismissLabel": "አሰናብት", "searchTextFieldPlaceholderLabel": "ፍለጋ", "noSpellCheckReplacementsLabel": "ምንም ተተኪዎች አልተገኙም", "menuDismissLabel": "ምናሌን አሰናብት", "lookUpButtonLabel": "ይመልከቱ", "searchWebButtonLabel": "ድርን ፈልግ", "shareButtonLabel": "አጋራ...", "clearButtonLabel": "Clear" }
flutter/packages/flutter_localizations/lib/src/l10n/cupertino_am.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/cupertino_am.arb", "repo_id": "flutter", "token_count": 678 }
786
{ "searchWebButtonLabel": "Search Web", "shareButtonLabel": "Share...", "lookUpButtonLabel": "Look up", "noSpellCheckReplacementsLabel": "No replacements found", "menuDismissLabel": "Dismiss menu", "searchTextFieldPlaceholderLabel": "Search", "tabSemanticsLabel": "Tab $tabIndex of $tabCount", "datePickerHourSemanticsLabelOne": "$hour o'clock", "datePickerHourSemanticsLabelOther": "$hour o'clock", "datePickerMinuteSemanticsLabelOne": "1 minute", "datePickerMinuteSemanticsLabelOther": "$minute minutes", "datePickerDateOrder": "dmy", "datePickerDateTimeOrder": "date_time_dayPeriod", "anteMeridiemAbbreviation": "AM", "postMeridiemAbbreviation": "PM", "todayLabel": "Today", "alertDialogLabel": "Alert", "timerPickerHourLabelOne": "hour", "timerPickerHourLabelOther": "hours", "timerPickerMinuteLabelOne": "min.", "timerPickerMinuteLabelOther": "min.", "timerPickerSecondLabelOne": "sec.", "timerPickerSecondLabelOther": "sec.", "cutButtonLabel": "Cut", "copyButtonLabel": "Copy", "pasteButtonLabel": "Paste", "clearButtonLabel": "Clear", "selectAllButtonLabel": "Select all", "modalBarrierDismissLabel": "Dismiss" }
flutter/packages/flutter_localizations/lib/src/l10n/cupertino_en_AU.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/cupertino_en_AU.arb", "repo_id": "flutter", "token_count": 399 }
787
{ "datePickerHourSemanticsLabelOne": "klo $hour", "datePickerHourSemanticsLabelOther": "klo $hour", "datePickerMinuteSemanticsLabelOne": "1 minuutti", "datePickerMinuteSemanticsLabelOther": "$minute minuuttia", "datePickerDateOrder": "dmy", "datePickerDateTimeOrder": "date_time_dayPeriod", "anteMeridiemAbbreviation": "ap", "postMeridiemAbbreviation": "ip", "todayLabel": "Tänään", "alertDialogLabel": "Ilmoitus", "timerPickerHourLabelOne": "tunti", "timerPickerHourLabelOther": "tuntia", "timerPickerMinuteLabelOne": "min", "timerPickerMinuteLabelOther": "min", "timerPickerSecondLabelOne": "s", "timerPickerSecondLabelOther": "s", "cutButtonLabel": "Leikkaa", "copyButtonLabel": "Kopioi", "pasteButtonLabel": "Liitä", "selectAllButtonLabel": "Valitse kaikki", "tabSemanticsLabel": "Välilehti $tabIndex kautta $tabCount", "modalBarrierDismissLabel": "Ohita", "searchTextFieldPlaceholderLabel": "Hae", "noSpellCheckReplacementsLabel": "Korvaavia sanoja ei löydy", "menuDismissLabel": "Hylkää valikko", "lookUpButtonLabel": "Hae", "searchWebButtonLabel": "Hae verkosta", "shareButtonLabel": "Jaa…", "clearButtonLabel": "Clear" }
flutter/packages/flutter_localizations/lib/src/l10n/cupertino_fi.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/cupertino_fi.arb", "repo_id": "flutter", "token_count": 454 }
788
{ "datePickerHourSemanticsLabelOne": "$hour საათი", "datePickerHourSemanticsLabelOther": "$hour საათი", "datePickerMinuteSemanticsLabelOne": "1 წუთი", "datePickerMinuteSemanticsLabelOther": "$minute წუთი", "datePickerDateOrder": "dmy", "datePickerDateTimeOrder": "date_dayPeriod_time", "anteMeridiemAbbreviation": "AM", "postMeridiemAbbreviation": "PM", "todayLabel": "დღეს", "alertDialogLabel": "გაფრთხილება", "timerPickerHourLabelOne": "საათი", "timerPickerHourLabelOther": "საათი", "timerPickerMinuteLabelOne": "წთ", "timerPickerMinuteLabelOther": "წთ", "timerPickerSecondLabelOne": "წმ", "timerPickerSecondLabelOther": "წმ", "cutButtonLabel": "ამოჭრა", "copyButtonLabel": "კოპირება", "pasteButtonLabel": "ჩასმა", "selectAllButtonLabel": "ყველას არჩევა", "tabSemanticsLabel": "ჩანართი $tabIndex / $tabCount-დან", "modalBarrierDismissLabel": "დახურვა", "searchTextFieldPlaceholderLabel": "ძიება", "noSpellCheckReplacementsLabel": "ჩანაცვლება არ მოიძებნა", "menuDismissLabel": "მენიუს უარყოფა", "lookUpButtonLabel": "აიხედეთ ზემოთ", "searchWebButtonLabel": "ვებში ძიება", "shareButtonLabel": "გაზიარება...", "clearButtonLabel": "Clear" }
flutter/packages/flutter_localizations/lib/src/l10n/cupertino_ka.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/cupertino_ka.arb", "repo_id": "flutter", "token_count": 865 }
789
{ "datePickerHourSemanticsLabelOne": "$hour बजे", "datePickerHourSemanticsLabelOther": "$hour बजे", "datePickerMinuteSemanticsLabelOne": "१ मिनेट", "datePickerMinuteSemanticsLabelOther": "$minute मिनेट", "datePickerDateOrder": "mdy", "datePickerDateTimeOrder": "date_time_dayPeriod", "anteMeridiemAbbreviation": "पूर्वाह्न", "postMeridiemAbbreviation": "अपराह्न", "todayLabel": "आज", "alertDialogLabel": "अलर्ट", "timerPickerHourLabelOne": "घन्टा", "timerPickerHourLabelOther": "घन्टा", "timerPickerMinuteLabelOne": "मिनेट", "timerPickerMinuteLabelOther": "मिनेट", "timerPickerSecondLabelOne": "सेकेन्ड", "timerPickerSecondLabelOther": "सेकेन्ड", "cutButtonLabel": "काट्नुहोस्", "copyButtonLabel": "प्रतिलिपि गर्नुहोस्", "pasteButtonLabel": "टाँस्नुहोस्", "selectAllButtonLabel": "सबै चयन गर्नुहोस्", "tabSemanticsLabel": "$tabCount मध्ये $tabIndex ट्याब", "modalBarrierDismissLabel": "खारेज गर्नुहोस्", "searchTextFieldPlaceholderLabel": "खोज्नुहोस्", "noSpellCheckReplacementsLabel": "बदल्नु पर्ने कुनै पनि कुरा भेटिएन", "menuDismissLabel": "मेनु खारेज गर्नुहोस्", "lookUpButtonLabel": "माथितिर हेर्नुहोस्", "searchWebButtonLabel": "वेबमा खोज्नुहोस्", "shareButtonLabel": "सेयर गर्नुहोस्...", "clearButtonLabel": "Clear" }
flutter/packages/flutter_localizations/lib/src/l10n/cupertino_ne.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/cupertino_ne.arb", "repo_id": "flutter", "token_count": 849 }
790
{ "datePickerHourSemanticsLabelOne": "Klockan $hour", "datePickerHourSemanticsLabelOther": "Klockan $hour", "datePickerMinuteSemanticsLabelOne": "1 minut", "datePickerMinuteSemanticsLabelOther": "$minute minuter", "datePickerDateOrder": "dmy", "datePickerDateTimeOrder": "date_time_dayPeriod", "anteMeridiemAbbreviation": "FM", "postMeridiemAbbreviation": "EM", "todayLabel": "I dag", "alertDialogLabel": "Varning", "timerPickerHourLabelOne": "timme", "timerPickerHourLabelOther": "timmar", "timerPickerMinuteLabelOne": "min", "timerPickerMinuteLabelOther": "min", "timerPickerSecondLabelOne": "sek", "timerPickerSecondLabelOther": "sek", "cutButtonLabel": "Klipp ut", "copyButtonLabel": "Kopiera", "pasteButtonLabel": "Klistra in", "selectAllButtonLabel": "Markera allt", "tabSemanticsLabel": "Flik $tabIndex av $tabCount", "modalBarrierDismissLabel": "Stäng", "searchTextFieldPlaceholderLabel": "Sök", "noSpellCheckReplacementsLabel": "Inga ersättningar hittades", "menuDismissLabel": "Stäng menyn", "lookUpButtonLabel": "Titta upp", "searchWebButtonLabel": "Sök på webben", "shareButtonLabel": "Dela …", "clearButtonLabel": "Clear" }
flutter/packages/flutter_localizations/lib/src/l10n/cupertino_sv.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/cupertino_sv.arb", "repo_id": "flutter", "token_count": 440 }
791
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file has been automatically generated. Please do not edit it manually. // To regenerate run (omit --overwrite to print to console instead of the file): // dart --enable-asserts dev/tools/localization/bin/gen_date_localizations.dart --overwrite import 'package:intl/date_symbols.dart' as intl; /// The subset of date symbols supported by the intl package which are also /// supported by flutter_localizations. final Map<String, intl.DateSymbols> dateSymbols = <String, intl.DateSymbols>{ 'af': intl.DateSymbols( NAME: 'af', ERAS: const <String>[ 'v.C.', 'n.C.', ], ERANAMES: const <String>[ 'voor Christus', 'na Christus', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember', ], STANDALONEMONTHS: const <String>[ 'Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember', ], SHORTMONTHS: const <String>[ 'Jan.', 'Feb.', 'Mrt.', 'Apr.', 'Mei', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Des.', ], STANDALONESHORTMONTHS: const <String>[ 'Jan.', 'Feb.', 'Mrt.', 'Apr.', 'Mei', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Des.', ], WEEKDAYS: const <String>[ 'Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag', ], STANDALONEWEEKDAYS: const <String>[ 'Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag', ], SHORTWEEKDAYS: const <String>[ 'So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'W', 'D', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'W', 'D', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ '1ste kwartaal', '2de kwartaal', '3de kwartaal', '4de kwartaal', ], AMPMS: const <String>[ 'vm.', 'nm.', ], DATEFORMATS: const <String>[ 'EEEE dd MMMM y', 'dd MMMM y', 'dd MMM y', 'y-MM-dd', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'am': intl.DateSymbols( NAME: 'am', ERAS: const <String>[ 'ዓ/ዓ', 'ዓ/ም', ], ERANAMES: const <String>[ 'ዓመተ ዓለም', 'ዓመተ ምሕረት', ], NARROWMONTHS: const <String>[ 'ጃ', 'ፌ', 'ማ', 'ኤ', 'ሜ', 'ጁ', 'ጁ', 'ኦ', 'ሴ', 'ኦ', 'ኖ', 'ዲ', ], STANDALONENARROWMONTHS: const <String>[ 'ጃ', 'ፌ', 'ማ', 'ኤ', 'ሜ', 'ጁ', 'ጁ', 'ኦ', 'ሴ', 'ኦ', 'ኖ', 'ዲ', ], MONTHS: const <String>[ 'ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕሪል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክቶበር', 'ኖቬምበር', 'ዲሴምበር', ], STANDALONEMONTHS: const <String>[ 'ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕሪል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክቶበር', 'ኖቬምበር', 'ዲሴምበር', ], SHORTMONTHS: const <String>[ 'ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕሪ', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክቶ', 'ኖቬም', 'ዲሴም', ], STANDALONESHORTMONTHS: const <String>[ 'ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕሪ', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክቶ', 'ኖቬም', 'ዲሴም', ], WEEKDAYS: const <String>[ 'እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ', ], STANDALONEWEEKDAYS: const <String>[ 'እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ', ], SHORTWEEKDAYS: const <String>[ 'እሑድ', 'ሰኞ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'እሑድ', 'ሰኞ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ', ], NARROWWEEKDAYS: const <String>[ 'እ', 'ሰ', 'ማ', 'ረ', 'ሐ', 'ዓ', 'ቅ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'እ', 'ሰ', 'ማ', 'ረ', 'ሐ', 'ዓ', 'ቅ', ], SHORTQUARTERS: const <String>[ 'ሩብ1', 'ሩብ2', 'ሩብ3', 'ሩብ4', ], QUARTERS: const <String>[ '1ኛው ሩብ', '2ኛው ሩብ', '3ኛው ሩብ', '4ኛው ሩብ', ], AMPMS: const <String>[ 'ጥዋት', 'ከሰዓት', ], DATEFORMATS: const <String>[ 'y MMMM d, EEEE', 'd MMMM y', 'd MMM y', 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'ar': intl.DateSymbols( NAME: 'ar', ERAS: const <String>[ 'ق.م', 'م', ], ERANAMES: const <String>[ 'قبل الميلاد', 'ميلادي', ], NARROWMONTHS: const <String>[ 'ي', 'ف', 'م', 'أ', 'و', 'ن', 'ل', 'غ', 'س', 'ك', 'ب', 'د', ], STANDALONENARROWMONTHS: const <String>[ 'ي', 'ف', 'م', 'أ', 'و', 'ن', 'ل', 'غ', 'س', 'ك', 'ب', 'د', ], MONTHS: const <String>[ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ], STANDALONEMONTHS: const <String>[ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ], SHORTMONTHS: const <String>[ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ], STANDALONESHORTMONTHS: const <String>[ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ], WEEKDAYS: const <String>[ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', ], STANDALONEWEEKDAYS: const <String>[ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', ], SHORTWEEKDAYS: const <String>[ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', ], STANDALONESHORTWEEKDAYS: const <String>[ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', ], NARROWWEEKDAYS: const <String>[ 'ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س', ], SHORTQUARTERS: const <String>[ 'الربع الأول', 'الربع الثاني', 'الربع الثالث', 'الربع الرابع', ], QUARTERS: const <String>[ 'الربع الأول', 'الربع الثاني', 'الربع الثالث', 'الربع الرابع', ], AMPMS: const <String>[ 'ص', 'م', ], DATEFORMATS: const <String>[ 'EEEE، d MMMM y', 'd MMMM y', 'dd‏/MM‏/y', 'd‏/M‏/y', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 5, WEEKENDRANGE: const <int>[ 4, 5, ], FIRSTWEEKCUTOFFDAY: 4, DATETIMEFORMATS: const <String>[ '{1} في {0}', '{1} في {0}', '{1}, {0}', '{1}, {0}', ], ZERODIGIT: '٠', ), 'as': intl.DateSymbols( NAME: 'as', ERAS: const <String>[ 'খ্ৰীঃ পূঃ', 'খ্ৰীঃ', ], ERANAMES: const <String>[ 'খ্ৰীষ্টপূৰ্ব', 'খ্ৰীষ্টাব্দ', ], NARROWMONTHS: const <String>[ 'জ', 'ফ', 'ম', 'এ', 'ম', 'জ', 'জ', 'আ', 'ছ', 'অ', 'ন', 'ড', ], STANDALONENARROWMONTHS: const <String>[ 'জ', 'ফ', 'ম', 'এ', 'ম', 'জ', 'জ', 'আ', 'ছ', 'অ', 'ন', 'ড', ], MONTHS: const <String>[ 'জানুৱাৰী', 'ফেব্ৰুৱাৰী', 'মাৰ্চ', 'এপ্ৰিল', 'মে’', 'জুন', 'জুলাই', 'আগষ্ট', 'ছেপ্তেম্বৰ', 'অক্টোবৰ', 'নৱেম্বৰ', 'ডিচেম্বৰ', ], STANDALONEMONTHS: const <String>[ 'জানুৱাৰী', 'ফেব্ৰুৱাৰী', 'মাৰ্চ', 'এপ্ৰিল', 'মে’', 'জুন', 'জুলাই', 'আগষ্ট', 'ছেপ্তেম্বৰ', 'অক্টোবৰ', 'নৱেম্বৰ', 'ডিচেম্বৰ', ], SHORTMONTHS: const <String>[ 'জানু', 'ফেব্ৰু', 'মাৰ্চ', 'এপ্ৰিল', 'মে’', 'জুন', 'জুলাই', 'আগ', 'ছেপ্তে', 'অক্টো', 'নৱে', 'ডিচে', ], STANDALONESHORTMONTHS: const <String>[ 'জানু', 'ফেব্ৰু', 'মাৰ্চ', 'এপ্ৰিল', 'মে’', 'জুন', 'জুলাই', 'আগ', 'ছেপ্তে', 'অক্টো', 'নৱে', 'ডিচে', ], WEEKDAYS: const <String>[ 'দেওবাৰ', 'সোমবাৰ', 'মঙ্গলবাৰ', 'বুধবাৰ', 'বৃহস্পতিবাৰ', 'শুক্ৰবাৰ', 'শনিবাৰ', ], STANDALONEWEEKDAYS: const <String>[ 'দেওবাৰ', 'সোমবাৰ', 'মঙ্গলবাৰ', 'বুধবাৰ', 'বৃহস্পতিবাৰ', 'শুক্ৰবাৰ', 'শনিবাৰ', ], SHORTWEEKDAYS: const <String>[ 'দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহ', 'শুক্ৰ', 'শনি', ], STANDALONESHORTWEEKDAYS: const <String>[ 'দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহ', 'শুক্ৰ', 'শনি', ], NARROWWEEKDAYS: const <String>[ 'দ', 'স', 'ম', 'ব', 'ব', 'শ', 'শ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'দ', 'স', 'ম', 'ব', 'ব', 'শ', 'শ', ], SHORTQUARTERS: const <String>[ '১মঃ তিঃ', '২য়ঃ তিঃ', '৩য়ঃ তিঃ', '৪ৰ্থঃ তিঃ', ], QUARTERS: const <String>[ 'প্ৰথম তিনিমাহ', 'দ্বিতীয় তিনিমাহ', 'তৃতীয় তিনিমাহ', 'চতুৰ্থ তিনিমাহ', ], AMPMS: const <String>[ 'পূৰ্বাহ্ন', 'অপৰাহ্ন', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM, y', 'dd-MM-y', 'd-M-y', ], TIMEFORMATS: const <String>[ 'a h.mm.ss zzzz', 'a h.mm.ss z', 'a h.mm.ss', 'a h.mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ZERODIGIT: '০', ), 'az': intl.DateSymbols( NAME: 'az', ERAS: const <String>[ 'e.ə.', 'y.e.', ], ERANAMES: const <String>[ 'eramızdan əvvəl', 'yeni era', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ 'yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr', ], STANDALONEMONTHS: const <String>[ 'yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr', ], SHORTMONTHS: const <String>[ 'yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek', ], STANDALONESHORTMONTHS: const <String>[ 'yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek', ], WEEKDAYS: const <String>[ 'bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə', ], STANDALONEWEEKDAYS: const <String>[ 'bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə', ], SHORTWEEKDAYS: const <String>[ 'B.', 'B.e.', 'Ç.a.', 'Ç.', 'C.a.', 'C.', 'Ş.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.', ], NARROWWEEKDAYS: const <String>[ '7', '1', '2', '3', '4', '5', '6', ], STANDALONENARROWWEEKDAYS: const <String>[ '7', '1', '2', '3', '4', '5', '6', ], SHORTQUARTERS: const <String>[ '1-ci kv.', '2-ci kv.', '3-cü kv.', '4-cü kv.', ], QUARTERS: const <String>[ '1-ci kvartal', '2-ci kvartal', '3-cü kvartal', '4-cü kvartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'd MMMM y, EEEE', 'd MMMM y', 'd MMM y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'be': intl.DateSymbols( NAME: 'be', ERAS: const <String>[ 'да н.э.', 'н.э.', ], ERANAMES: const <String>[ 'да нараджэння Хрыстова', 'ад нараджэння Хрыстова', ], NARROWMONTHS: const <String>[ 'с', 'л', 'с', 'к', 'м', 'ч', 'л', 'ж', 'в', 'к', 'л', 'с', ], STANDALONENARROWMONTHS: const <String>[ 'с', 'л', 'с', 'к', 'м', 'ч', 'л', 'ж', 'в', 'к', 'л', 'с', ], MONTHS: const <String>[ 'студзеня', 'лютага', 'сакавіка', 'красавіка', 'мая', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня', ], STANDALONEMONTHS: const <String>[ 'студзень', 'люты', 'сакавік', 'красавік', 'май', 'чэрвень', 'ліпень', 'жнівень', 'верасень', 'кастрычнік', 'лістапад', 'снежань', ], SHORTMONTHS: const <String>[ 'сту', 'лют', 'сак', 'кра', 'мая', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне', ], STANDALONESHORTMONTHS: const <String>[ 'сту', 'лют', 'сак', 'кра', 'май', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне', ], WEEKDAYS: const <String>[ 'нядзеля', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота', ], STANDALONEWEEKDAYS: const <String>[ 'нядзеля', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота', ], SHORTWEEKDAYS: const <String>[ 'нд', 'пн', 'аў', 'ср', 'чц', 'пт', 'сб', ], STANDALONESHORTWEEKDAYS: const <String>[ 'нд', 'пн', 'аў', 'ср', 'чц', 'пт', 'сб', ], NARROWWEEKDAYS: const <String>[ 'н', 'п', 'а', 'с', 'ч', 'п', 'с', ], STANDALONENARROWWEEKDAYS: const <String>[ 'н', 'п', 'а', 'с', 'ч', 'п', 'с', ], SHORTQUARTERS: const <String>[ '1-шы кв.', '2-гі кв.', '3-ці кв.', '4-ты кв.', ], QUARTERS: const <String>[ '1-шы квартал', '2-гі квартал', '3-ці квартал', '4-ты квартал', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ "EEEE, d MMMM y 'г'.", "d MMMM y 'г'.", "d MMM y 'г'.", 'd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss, zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'у' {0}", "{1} 'у' {0}", '{1}, {0}', '{1}, {0}', ], ), 'bg': intl.DateSymbols( NAME: 'bg', ERAS: const <String>[ 'пр.Хр.', 'сл.Хр.', ], ERANAMES: const <String>[ 'преди Христа', 'след Христа', ], NARROWMONTHS: const <String>[ 'я', 'ф', 'м', 'а', 'м', 'ю', 'ю', 'а', 'с', 'о', 'н', 'д', ], STANDALONENARROWMONTHS: const <String>[ 'я', 'ф', 'м', 'а', 'м', 'ю', 'ю', 'а', 'с', 'о', 'н', 'д', ], MONTHS: const <String>[ 'януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември', ], STANDALONEMONTHS: const <String>[ 'януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември', ], SHORTMONTHS: const <String>[ 'яну', 'фев', 'март', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек', ], STANDALONESHORTMONTHS: const <String>[ 'яну', 'фев', 'март', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек', ], WEEKDAYS: const <String>[ 'неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота', ], STANDALONEWEEKDAYS: const <String>[ 'неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота', ], SHORTWEEKDAYS: const <String>[ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', ], STANDALONESHORTWEEKDAYS: const <String>[ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', ], NARROWWEEKDAYS: const <String>[ 'н', 'п', 'в', 'с', 'ч', 'п', 'с', ], STANDALONENARROWWEEKDAYS: const <String>[ 'н', 'п', 'в', 'с', 'ч', 'п', 'с', ], SHORTQUARTERS: const <String>[ '1. трим.', '2. трим.', '3. трим.', '4. трим.', ], QUARTERS: const <String>[ '1. тримесечие', '2. тримесечие', '3. тримесечие', '4. тримесечие', ], AMPMS: const <String>[ 'пр.об.', 'сл.об.', ], DATEFORMATS: const <String>[ "EEEE, d MMMM y 'г'.", "d MMMM y 'г'.", "d.MM.y 'г'.", "d.MM.yy 'г'.", ], TIMEFORMATS: const <String>[ "H:mm:ss 'ч'. zzzz", "H:mm:ss 'ч'. z", "H:mm:ss 'ч'.", "H:mm 'ч'.", ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'bn': intl.DateSymbols( NAME: 'bn', ERAS: const <String>[ 'খ্রিস্টপূর্ব', 'খৃষ্টাব্দ', ], ERANAMES: const <String>[ 'খ্রিস্টপূর্ব', 'খ্রীষ্টাব্দ', ], NARROWMONTHS: const <String>[ 'জা', 'ফে', 'মা', 'এ', 'মে', 'জুন', 'জু', 'আ', 'সে', 'অ', 'ন', 'ডি', ], STANDALONENARROWMONTHS: const <String>[ 'জা', 'ফে', 'মা', 'এ', 'মে', 'জুন', 'জু', 'আ', 'সে', 'অ', 'ন', 'ডি', ], MONTHS: const <String>[ 'জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর', ], STANDALONEMONTHS: const <String>[ 'জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর', ], SHORTMONTHS: const <String>[ 'জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর', ], STANDALONESHORTMONTHS: const <String>[ 'জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর', ], WEEKDAYS: const <String>[ 'রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার', ], STANDALONEWEEKDAYS: const <String>[ 'রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার', ], SHORTWEEKDAYS: const <String>[ 'রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি', ], STANDALONESHORTWEEKDAYS: const <String>[ 'রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি', ], NARROWWEEKDAYS: const <String>[ 'র', 'সো', 'ম', 'বু', 'বৃ', 'শু', 'শ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'র', 'সো', 'ম', 'বু', 'বৃ', 'শু', 'শ', ], SHORTQUARTERS: const <String>[ 'ত্রৈমাসিক', 'দ্বিতীয় ত্রৈমাসিক', 'তৃতীয় ত্রৈমাসিক', 'চতুর্থ ত্রৈমাসিক', ], QUARTERS: const <String>[ 'ত্রৈমাসিক', 'দ্বিতীয় ত্রৈমাসিক', 'তৃতীয় ত্রৈমাসিক', 'চতুর্থ ত্রৈমাসিক', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM, y', 'd MMM, y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ZERODIGIT: '০', ), 'bs': intl.DateSymbols( NAME: 'bs', ERAS: const <String>[ 'p. n. e.', 'n. e.', ], ERANAMES: const <String>[ 'prije nove ere', 'nove ere', ], NARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], STANDALONENARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], MONTHS: const <String>[ 'januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar', ], STANDALONEMONTHS: const <String>[ 'januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar', ], SHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec', ], STANDALONESHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec', ], WEEKDAYS: const <String>[ 'nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota', ], STANDALONEWEEKDAYS: const <String>[ 'nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota', ], SHORTWEEKDAYS: const <String>[ 'ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub', ], NARROWWEEKDAYS: const <String>[ 'N', 'P', 'U', 'S', 'Č', 'P', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'n', 'p', 'u', 's', 'č', 'p', 's', ], SHORTQUARTERS: const <String>[ 'KV1', 'KV2', 'KV3', 'KV4', ], QUARTERS: const <String>[ 'Prvi kvartal', 'Drugi kvartal', 'Treći kvartal', 'Četvrti kvartal', ], AMPMS: const <String>[ 'prijepodne', 'popodne', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y.', 'd. MMMM y.', 'd. MMM y.', 'd. M. y.', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'u' {0}", "{1} 'u' {0}", '{1} {0}', '{1} {0}', ], ), 'ca': intl.DateSymbols( NAME: 'ca', ERAS: const <String>[ 'aC', 'dC', ], ERANAMES: const <String>[ 'abans de Crist', 'després de Crist', ], NARROWMONTHS: const <String>[ 'GN', 'FB', 'MÇ', 'AB', 'MG', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DS', ], STANDALONENARROWMONTHS: const <String>[ 'GN', 'FB', 'MÇ', 'AB', 'MG', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DS', ], MONTHS: const <String>[ 'de gener', 'de febrer', 'de març', 'd’abril', 'de maig', 'de juny', 'de juliol', 'd’agost', 'de setembre', 'd’octubre', 'de novembre', 'de desembre', ], STANDALONEMONTHS: const <String>[ 'gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre', ], SHORTMONTHS: const <String>[ 'de gen.', 'de febr.', 'de març', 'd’abr.', 'de maig', 'de juny', 'de jul.', 'd’ag.', 'de set.', 'd’oct.', 'de nov.', 'de des.', ], STANDALONESHORTMONTHS: const <String>[ 'gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.', ], WEEKDAYS: const <String>[ 'diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte', ], STANDALONEWEEKDAYS: const <String>[ 'diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte', ], SHORTWEEKDAYS: const <String>[ 'dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.', ], NARROWWEEKDAYS: const <String>[ 'dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds', ], STANDALONENARROWWEEKDAYS: const <String>[ 'dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds', ], SHORTQUARTERS: const <String>[ '1T', '2T', '3T', '4T', ], QUARTERS: const <String>[ '1r trimestre', '2n trimestre', '3r trimestre', '4t trimestre', ], AMPMS: const <String>[ 'a. m.', 'p. m.', ], DATEFORMATS: const <String>[ "EEEE, d MMMM 'de' y", "d MMMM 'de' y", 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'H:mm:ss (zzzz)', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1}, 'a' 'les' {0}", "{1}, 'a' 'les' {0}", '{1}, {0}', '{1} {0}', ], ), 'cs': intl.DateSymbols( NAME: 'cs', ERAS: const <String>[ 'př. n. l.', 'n. l.', ], ERANAMES: const <String>[ 'před naším letopočtem', 'našeho letopočtu', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ 'ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince', ], STANDALONEMONTHS: const <String>[ 'leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec', ], SHORTMONTHS: const <String>[ 'led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro', ], STANDALONESHORTMONTHS: const <String>[ 'led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro', ], WEEKDAYS: const <String>[ 'neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota', ], STANDALONEWEEKDAYS: const <String>[ 'neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota', ], SHORTWEEKDAYS: const <String>[ 'ne', 'po', 'út', 'st', 'čt', 'pá', 'so', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ne', 'po', 'út', 'st', 'čt', 'pá', 'so', ], NARROWWEEKDAYS: const <String>[ 'N', 'P', 'Ú', 'S', 'Č', 'P', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'N', 'P', 'Ú', 'S', 'Č', 'P', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1. čtvrtletí', '2. čtvrtletí', '3. čtvrtletí', '4. čtvrtletí', ], AMPMS: const <String>[ 'dop.', 'odp.', ], DATEFORMATS: const <String>[ 'EEEE d. MMMM y', 'd. MMMM y', 'd. M. y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'H:mm:ss zzzz', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'cy': intl.DateSymbols( NAME: 'cy', ERAS: const <String>[ 'CC', 'OC', ], ERANAMES: const <String>[ 'Cyn Crist', 'Oed Crist', ], NARROWMONTHS: const <String>[ 'I', 'Ch', 'M', 'E', 'M', 'M', 'G', 'A', 'M', 'H', 'T', 'Rh', ], STANDALONENARROWMONTHS: const <String>[ 'I', 'Ch', 'M', 'E', 'M', 'M', 'G', 'A', 'M', 'H', 'T', 'Rh', ], MONTHS: const <String>[ 'Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr', ], STANDALONEMONTHS: const <String>[ 'Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr', ], SHORTMONTHS: const <String>[ 'Ion', 'Chwef', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gorff', 'Awst', 'Medi', 'Hyd', 'Tach', 'Rhag', ], STANDALONESHORTMONTHS: const <String>[ 'Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gor', 'Awst', 'Medi', 'Hyd', 'Tach', 'Rhag', ], WEEKDAYS: const <String>[ 'Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn', ], STANDALONEWEEKDAYS: const <String>[ 'Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn', ], SHORTWEEKDAYS: const <String>[ 'Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwen', 'Sad', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad', ], NARROWWEEKDAYS: const <String>[ 'S', 'Ll', 'M', 'M', 'I', 'G', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'Ll', 'M', 'M', 'I', 'G', 'S', ], SHORTQUARTERS: const <String>[ 'Ch1', 'Ch2', 'Ch3', 'Ch4', ], QUARTERS: const <String>[ 'chwarter 1af', '2il chwarter', '3ydd chwarter', '4ydd chwarter', ], AMPMS: const <String>[ 'yb', 'yh', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'am' {0}", "{1} 'am' {0}", '{1} {0}', '{1} {0}', ], ), 'da': intl.DateSymbols( NAME: 'da', ERAS: const <String>[ 'f.Kr.', 'e.Kr.', ], ERANAMES: const <String>[ 'f.Kr.', 'e.Kr.', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december', ], STANDALONEMONTHS: const <String>[ 'januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', ], STANDALONEWEEKDAYS: const <String>[ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', ], SHORTWEEKDAYS: const <String>[ 'søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], SHORTQUARTERS: const <String>[ '1. kvt.', '2. kvt.', '3. kvt.', '4. kvt.', ], QUARTERS: const <String>[ '1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ "EEEE 'den' d. MMMM y", 'd. MMMM y', 'd. MMM y', 'dd.MM.y', ], TIMEFORMATS: const <String>[ 'HH.mm.ss zzzz', 'HH.mm.ss z', 'HH.mm.ss', 'HH.mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'kl'. {0}", "{1} 'kl'. {0}", '{1} {0}', '{1} {0}', ], ), 'de': intl.DateSymbols( NAME: 'de', ERAS: const <String>[ 'v. Chr.', 'n. Chr.', ], ERANAMES: const <String>[ 'v. Chr.', 'n. Chr.', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember', ], STANDALONEMONTHS: const <String>[ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember', ], SHORTMONTHS: const <String>[ 'Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez', ], WEEKDAYS: const <String>[ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', ], STANDALONEWEEKDAYS: const <String>[ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', ], SHORTWEEKDAYS: const <String>[ 'So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'M', 'D', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'M', 'D', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y', 'd. MMMM y', 'dd.MM.y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'um' {0}", "{1} 'um' {0}", '{1}, {0}', '{1}, {0}', ], ), 'de_CH': intl.DateSymbols( NAME: 'de_CH', ERAS: const <String>[ 'v. Chr.', 'n. Chr.', ], ERANAMES: const <String>[ 'v. Chr.', 'n. Chr.', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember', ], STANDALONEMONTHS: const <String>[ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember', ], SHORTMONTHS: const <String>[ 'Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez', ], WEEKDAYS: const <String>[ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', ], STANDALONEWEEKDAYS: const <String>[ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', ], SHORTWEEKDAYS: const <String>[ 'So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'M', 'D', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'M', 'D', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y', 'd. MMMM y', 'dd.MM.y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'um' {0}", "{1} 'um' {0}", '{1}, {0}', '{1}, {0}', ], ), 'el': intl.DateSymbols( NAME: 'el', ERAS: const <String>[ 'π.Χ.', 'μ.Χ.', ], ERANAMES: const <String>[ 'προ Χριστού', 'μετά Χριστόν', ], NARROWMONTHS: const <String>[ 'Ι', 'Φ', 'Μ', 'Α', 'Μ', 'Ι', 'Ι', 'Α', 'Σ', 'Ο', 'Ν', 'Δ', ], STANDALONENARROWMONTHS: const <String>[ 'Ι', 'Φ', 'Μ', 'Α', 'Μ', 'Ι', 'Ι', 'Α', 'Σ', 'Ο', 'Ν', 'Δ', ], MONTHS: const <String>[ 'Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου', ], STANDALONEMONTHS: const <String>[ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος', ], SHORTMONTHS: const <String>[ 'Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαΐ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ', ], STANDALONESHORTMONTHS: const <String>[ 'Ιαν', 'Φεβ', 'Μάρ', 'Απρ', 'Μάι', 'Ιούν', 'Ιούλ', 'Αύγ', 'Σεπ', 'Οκτ', 'Νοέ', 'Δεκ', ], WEEKDAYS: const <String>[ 'Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο', ], STANDALONEWEEKDAYS: const <String>[ 'Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο', ], SHORTWEEKDAYS: const <String>[ 'Κυρ', 'Δευ', 'Τρί', 'Τετ', 'Πέμ', 'Παρ', 'Σάβ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Κυρ', 'Δευ', 'Τρί', 'Τετ', 'Πέμ', 'Παρ', 'Σάβ', ], NARROWWEEKDAYS: const <String>[ 'Κ', 'Δ', 'Τ', 'Τ', 'Π', 'Π', 'Σ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Κ', 'Δ', 'Τ', 'Τ', 'Π', 'Π', 'Σ', ], SHORTQUARTERS: const <String>[ 'Τ1', 'Τ2', 'Τ3', 'Τ4', ], QUARTERS: const <String>[ '1ο τρίμηνο', '2ο τρίμηνο', '3ο τρίμηνο', '4ο τρίμηνο', ], AMPMS: const <String>[ 'π.μ.', 'μ.μ.', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} - {0}', '{1} - {0}', '{1}, {0}', '{1}, {0}', ], ), 'en': intl.DateSymbols( NAME: 'en', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'M/d/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_AU': intl.DateSymbols( NAME: 'en_AU', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'Su.', 'M.', 'Tu.', 'W.', 'Th.', 'F.', 'Sa.', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Su.', 'M.', 'Tu.', 'W.', 'Th.', 'F.', 'Sa.', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_CA': intl.DateSymbols( NAME: 'en_CA', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'y-MM-dd', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_GB': intl.DateSymbols( NAME: 'en_GB', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_IE': intl.DateSymbols( NAME: 'en_IE', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_IN': intl.DateSymbols( NAME: 'en_IN', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM y', 'dd-MMM-y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_NZ': intl.DateSymbols( NAME: 'en_NZ', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd/MM/y', 'd/MM/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_SG': intl.DateSymbols( NAME: 'en_SG', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_US': intl.DateSymbols( NAME: 'en_US', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'M/d/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'en_ZA': intl.DateSymbols( NAME: 'en_ZA', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], STANDALONEMONTHS: const <String>[ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec', ], WEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], STANDALONEWEEKDAYS: const <String>[ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ], SHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1st quarter', '2nd quarter', '3rd quarter', '4th quarter', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, dd MMMM y', 'dd MMMM y', 'dd MMM y', 'y/MM/dd', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'at' {0}", "{1} 'at' {0}", '{1}, {0}', '{1}, {0}', ], ), 'es': intl.DateSymbols( NAME: 'es', ERAS: const <String>[ 'a. C.', 'd. C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'después de Cristo', ], NARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], STANDALONEMONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], SHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], STANDALONESHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], WEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], SHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'X', 'J', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'X', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1.er trimestre', '2.º trimestre', '3.er trimestre', '4.º trimestre', ], AMPMS: const <String>[ 'a. m.', 'p. m.', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'H:mm:ss (zzzz)', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'es_419': intl.DateSymbols( NAME: 'es_419', ERAS: const <String>[ 'a. C.', 'd. C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'después de Cristo', ], NARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], STANDALONEMONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], SHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], STANDALONESHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], WEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], SHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], NARROWWEEKDAYS: const <String>[ 'd', 'l', 'm', 'm', 'j', 'v', 's', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1.º trimestre', '2.º trimestre', '3.º trimestre', '4.º trimestre', ], AMPMS: const <String>[ 'a. m.', 'p. m.', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1} {0}', '{1}, {0}', ], ), 'es_MX': intl.DateSymbols( NAME: 'es_MX', ERAS: const <String>[ 'a. C.', 'd. C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'después de Cristo', ], NARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], STANDALONEMONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], SHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], STANDALONESHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], WEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], SHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1.er trimestre', '2.º trimestre', '3.er trimestre', '4.º trimestre', ], AMPMS: const <String>[ 'a. m.', 'p. m.', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", 'd MMM y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1} {0}', '{1}, {0}', ], ), 'es_US': intl.DateSymbols( NAME: 'es_US', ERAS: const <String>[ 'a. C.', 'd. C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'después de Cristo', ], NARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'E', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], STANDALONEMONTHS: const <String>[ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre', ], SHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], STANDALONESHORTMONTHS: const <String>[ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sept', 'oct', 'nov', 'dic', ], WEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', ], SHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1.º trimestre', '2.º trimestre', '3.º trimestre', '4.º trimestre', ], AMPMS: const <String>[ 'a. m.', 'p. m.', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", 'd MMM y', 'd/M/y', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'et': intl.DateSymbols( NAME: 'et', ERAS: const <String>[ 'eKr', 'pKr', ], ERANAMES: const <String>[ 'enne Kristust', 'pärast Kristust', ], NARROWMONTHS: const <String>[ 'J', 'V', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'V', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'jaanuar', 'veebruar', 'märts', 'aprill', 'mai', 'juuni', 'juuli', 'august', 'september', 'oktoober', 'november', 'detsember', ], STANDALONEMONTHS: const <String>[ 'jaanuar', 'veebruar', 'märts', 'aprill', 'mai', 'juuni', 'juuli', 'august', 'september', 'oktoober', 'november', 'detsember', ], SHORTMONTHS: const <String>[ 'jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets', ], STANDALONESHORTMONTHS: const <String>[ 'jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets', ], WEEKDAYS: const <String>[ 'Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev', ], STANDALONEWEEKDAYS: const <String>[ 'Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev', ], SHORTWEEKDAYS: const <String>[ 'P', 'E', 'T', 'K', 'N', 'R', 'L', ], STANDALONESHORTWEEKDAYS: const <String>[ 'P', 'E', 'T', 'K', 'N', 'R', 'L', ], NARROWWEEKDAYS: const <String>[ 'P', 'E', 'T', 'K', 'N', 'R', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'P', 'E', 'T', 'K', 'N', 'R', 'L', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ '1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y', 'd. MMMM y', 'd. MMM y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'eu': intl.DateSymbols( NAME: 'eu', ERAS: const <String>[ 'K.a.', 'K.o.', ], ERANAMES: const <String>[ 'K.a.', 'Kristo ondoren', ], NARROWMONTHS: const <String>[ 'U', 'O', 'M', 'A', 'M', 'E', 'U', 'A', 'I', 'U', 'A', 'A', ], STANDALONENARROWMONTHS: const <String>[ 'U', 'O', 'M', 'A', 'M', 'E', 'U', 'A', 'I', 'U', 'A', 'A', ], MONTHS: const <String>[ 'urtarrilak', 'otsailak', 'martxoak', 'apirilak', 'maiatzak', 'ekainak', 'uztailak', 'abuztuak', 'irailak', 'urriak', 'azaroak', 'abenduak', ], STANDALONEMONTHS: const <String>[ 'urtarrila', 'otsaila', 'martxoa', 'apirila', 'maiatza', 'ekaina', 'uztaila', 'abuztua', 'iraila', 'urria', 'azaroa', 'abendua', ], SHORTMONTHS: const <String>[ 'urt.', 'ots.', 'mar.', 'api.', 'mai.', 'eka.', 'uzt.', 'abu.', 'ira.', 'urr.', 'aza.', 'abe.', ], STANDALONESHORTMONTHS: const <String>[ 'urt.', 'ots.', 'mar.', 'api.', 'mai.', 'eka.', 'uzt.', 'abu.', 'ira.', 'urr.', 'aza.', 'abe.', ], WEEKDAYS: const <String>[ 'igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata', ], STANDALONEWEEKDAYS: const <String>[ 'igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata', ], SHORTWEEKDAYS: const <String>[ 'ig.', 'al.', 'ar.', 'az.', 'og.', 'or.', 'lr.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ig.', 'al.', 'ar.', 'az.', 'og.', 'or.', 'lr.', ], NARROWWEEKDAYS: const <String>[ 'I', 'A', 'A', 'A', 'O', 'O', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'I', 'A', 'A', 'A', 'O', 'O', 'L', ], SHORTQUARTERS: const <String>[ '1Hh', '2Hh', '3Hh', '4Hh', ], QUARTERS: const <String>[ '1. hiruhilekoa', '2. hiruhilekoa', '3. hiruhilekoa', '4. hiruhilekoa', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ "y('e')'ko' MMMM'ren' d('a'), EEEE", "y('e')'ko' MMMM'ren' d('a')", "y('e')'ko' MMM d('a')", 'yy/M/d', ], TIMEFORMATS: const <String>[ 'HH:mm:ss (zzzz)', 'HH:mm:ss (z)', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'fa': intl.DateSymbols( NAME: 'fa', ERAS: const <String>[ 'ق.م.', 'م.', ], ERANAMES: const <String>[ 'قبل از میلاد', 'میلادی', ], NARROWMONTHS: const <String>[ 'ژ', 'ف', 'م', 'آ', 'م', 'ژ', 'ژ', 'ا', 'س', 'ا', 'ن', 'د', ], STANDALONENARROWMONTHS: const <String>[ 'ژ', 'ف', 'م', 'آ', 'م', 'ژ', 'ژ', 'ا', 'س', 'ا', 'ن', 'د', ], MONTHS: const <String>[ 'ژانویهٔ', 'فوریهٔ', 'مارس', 'آوریل', 'مهٔ', 'ژوئن', 'ژوئیهٔ', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر', ], STANDALONEMONTHS: const <String>[ 'ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر', ], SHORTMONTHS: const <String>[ 'ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر', ], STANDALONESHORTMONTHS: const <String>[ 'ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر', ], WEEKDAYS: const <String>[ 'یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه', ], STANDALONEWEEKDAYS: const <String>[ 'یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه', ], SHORTWEEKDAYS: const <String>[ 'یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه', ], STANDALONESHORTWEEKDAYS: const <String>[ 'یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه', ], NARROWWEEKDAYS: const <String>[ 'ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش', ], SHORTQUARTERS: const <String>[ 'س‌م۱', 'س‌م۲', 'س‌م۳', 'س‌م۴', ], QUARTERS: const <String>[ 'سه‌ماههٔ اول', 'سه‌ماههٔ دوم', 'سه‌ماههٔ سوم', 'سه‌ماههٔ چهارم', ], AMPMS: const <String>[ 'قبل‌ازظهر', 'بعدازظهر', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'y/M/d', ], TIMEFORMATS: const <String>[ 'H:mm:ss (zzzz)', 'H:mm:ss (z)', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 5, WEEKENDRANGE: const <int>[ 4, 4, ], FIRSTWEEKCUTOFFDAY: 4, DATETIMEFORMATS: const <String>[ '{1}، ساعت {0}', '{1}، ساعت {0}', '{1}،‏ {0}', '{1}،‏ {0}', ], ZERODIGIT: '۰', ), 'fi': intl.DateSymbols( NAME: 'fi', ERAS: const <String>[ 'eKr.', 'jKr.', ], ERANAMES: const <String>[ 'ennen Kristuksen syntymää', 'jälkeen Kristuksen syntymän', ], NARROWMONTHS: const <String>[ 'T', 'H', 'M', 'H', 'T', 'K', 'H', 'E', 'S', 'L', 'M', 'J', ], STANDALONENARROWMONTHS: const <String>[ 'T', 'H', 'M', 'H', 'T', 'K', 'H', 'E', 'S', 'L', 'M', 'J', ], MONTHS: const <String>[ 'tammikuuta', 'helmikuuta', 'maaliskuuta', 'huhtikuuta', 'toukokuuta', 'kesäkuuta', 'heinäkuuta', 'elokuuta', 'syyskuuta', 'lokakuuta', 'marraskuuta', 'joulukuuta', ], STANDALONEMONTHS: const <String>[ 'tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu', ], SHORTMONTHS: const <String>[ 'tammik.', 'helmik.', 'maalisk.', 'huhtik.', 'toukok.', 'kesäk.', 'heinäk.', 'elok.', 'syysk.', 'lokak.', 'marrask.', 'jouluk.', ], STANDALONESHORTMONTHS: const <String>[ 'tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu', ], WEEKDAYS: const <String>[ 'sunnuntaina', 'maanantaina', 'tiistaina', 'keskiviikkona', 'torstaina', 'perjantaina', 'lauantaina', ], STANDALONEWEEKDAYS: const <String>[ 'sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai', ], SHORTWEEKDAYS: const <String>[ 'su', 'ma', 'ti', 'ke', 'to', 'pe', 'la', ], STANDALONESHORTWEEKDAYS: const <String>[ 'su', 'ma', 'ti', 'ke', 'to', 'pe', 'la', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'K', 'T', 'P', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'K', 'T', 'P', 'L', ], SHORTQUARTERS: const <String>[ '1. nelj.', '2. nelj.', '3. nelj.', '4. nelj.', ], QUARTERS: const <String>[ '1. neljännes', '2. neljännes', '3. neljännes', '4. neljännes', ], AMPMS: const <String>[ 'ap.', 'ip.', ], DATEFORMATS: const <String>[ 'cccc d. MMMM y', 'd. MMMM y', 'd.M.y', 'd.M.y', ], TIMEFORMATS: const <String>[ 'H.mm.ss zzzz', 'H.mm.ss z', 'H.mm.ss', 'H.mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'klo' {0}", "{1} 'klo' {0}", "{1} 'klo' {0}", '{1} {0}', ], ), 'fil': intl.DateSymbols( NAME: 'fil', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], STANDALONENARROWMONTHS: const <String>[ 'E', 'P', 'M', 'A', 'M', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], MONTHS: const <String>[ 'Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre', ], STANDALONEMONTHS: const <String>[ 'Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre', ], SHORTMONTHS: const <String>[ 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], STANDALONESHORTMONTHS: const <String>[ 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], WEEKDAYS: const <String>[ 'Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado', ], STANDALONEWEEKDAYS: const <String>[ 'Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado', ], SHORTWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], NARROWWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ 'ika-1 quarter', 'ika-2 quarter', 'ika-3 quarter', 'ika-4 na quarter', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'M/d/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'nang' {0}", "{1} 'nang' {0}", '{1}, {0}', '{1}, {0}', ], ), 'fr': intl.DateSymbols( NAME: 'fr', ERAS: const <String>[ 'av. J.-C.', 'ap. J.-C.', ], ERANAMES: const <String>[ 'avant Jésus-Christ', 'après Jésus-Christ', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre', ], STANDALONEMONTHS: const <String>[ 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre', ], SHORTMONTHS: const <String>[ 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.', ], STANDALONESHORTMONTHS: const <String>[ 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.', ], WEEKDAYS: const <String>[ 'dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', ], STANDALONEWEEKDAYS: const <String>[ 'dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', ], SHORTWEEKDAYS: const <String>[ 'dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1er trimestre', '2e trimestre', '3e trimestre', '4e trimestre', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'à' {0}", "{1} 'à' {0}", '{1}, {0}', '{1} {0}', ], ), 'fr_CA': intl.DateSymbols( NAME: 'fr_CA', ERAS: const <String>[ 'av. J.-C.', 'ap. J.-C.', ], ERANAMES: const <String>[ 'avant Jésus-Christ', 'après Jésus-Christ', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre', ], STANDALONEMONTHS: const <String>[ 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre', ], SHORTMONTHS: const <String>[ 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juill.', 'août', 'sept.', 'oct.', 'nov.', 'déc.', ], STANDALONESHORTMONTHS: const <String>[ 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juill.', 'août', 'sept.', 'oct.', 'nov.', 'déc.', ], WEEKDAYS: const <String>[ 'dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', ], STANDALONEWEEKDAYS: const <String>[ 'dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', ], SHORTWEEKDAYS: const <String>[ 'dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1er trimestre', '2e trimestre', '3e trimestre', '4e trimestre', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'y-MM-dd', ], TIMEFORMATS: const <String>[ "HH 'h' mm 'min' ss 's' zzzz", "HH 'h' mm 'min' ss 's' z", "HH 'h' mm 'min' ss 's'", "HH 'h' mm", ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'à' {0}", "{1} 'à' {0}", '{1}, {0}', '{1} {0}', ], ), 'gl': intl.DateSymbols( NAME: 'gl', ERAS: const <String>[ 'a.C.', 'd.C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'despois de Cristo', ], NARROWMONTHS: const <String>[ 'x.', 'f.', 'm.', 'a.', 'm.', 'x.', 'x.', 'a.', 's.', 'o.', 'n.', 'd.', ], STANDALONENARROWMONTHS: const <String>[ 'X', 'F', 'M', 'A', 'M', 'X', 'X', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'xaneiro', 'febreiro', 'marzo', 'abril', 'maio', 'xuño', 'xullo', 'agosto', 'setembro', 'outubro', 'novembro', 'decembro', ], STANDALONEMONTHS: const <String>[ 'Xaneiro', 'Febreiro', 'Marzo', 'Abril', 'Maio', 'Xuño', 'Xullo', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Decembro', ], SHORTMONTHS: const <String>[ 'xan.', 'feb.', 'mar.', 'abr.', 'maio', 'xuño', 'xul.', 'ago.', 'set.', 'out.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'Xan.', 'Feb.', 'Mar.', 'Abr.', 'Maio', 'Xuño', 'Xul.', 'Ago.', 'Set.', 'Out.', 'Nov.', 'Dec.', ], WEEKDAYS: const <String>[ 'domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'Domingo', 'Luns', 'Martes', 'Mércores', 'Xoves', 'Venres', 'Sábado', ], SHORTWEEKDAYS: const <String>[ 'dom.', 'luns', 'mar.', 'mér.', 'xov.', 'ven.', 'sáb.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Dom.', 'Luns', 'Mar.', 'Mér.', 'Xov.', 'Ven.', 'Sáb.', ], NARROWWEEKDAYS: const <String>[ 'd.', 'l.', 'm.', 'm.', 'x.', 'v.', 's.', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'X', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1.º trimestre', '2.º trimestre', '3.º trimestre', '4.º trimestre', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", "d 'de' MMM 'de' y", 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{0} 'do' {1}", "{0} 'do' {1}", '{0}, {1}', '{0}, {1}', ], ), 'gsw': intl.DateSymbols( NAME: 'gsw', ERAS: const <String>[ 'v. Chr.', 'n. Chr.', ], ERANAMES: const <String>[ 'v. Chr.', 'n. Chr.', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber', ], STANDALONEMONTHS: const <String>[ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez', ], WEEKDAYS: const <String>[ 'Sunntig', 'Määntig', 'Ziischtig', 'Mittwuch', 'Dunschtig', 'Friitig', 'Samschtig', ], STANDALONEWEEKDAYS: const <String>[ 'Sunntig', 'Määntig', 'Ziischtig', 'Mittwuch', 'Dunschtig', 'Friitig', 'Samschtig', ], SHORTWEEKDAYS: const <String>[ 'Su.', 'Mä.', 'Zi.', 'Mi.', 'Du.', 'Fr.', 'Sa.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Su.', 'Mä.', 'Zi.', 'Mi.', 'Du.', 'Fr.', 'Sa.', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'M', 'D', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'D', 'M', 'D', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal', ], AMPMS: const <String>[ 'am Vormittag', 'am Namittag', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y', 'd. MMMM y', 'dd.MM.y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'gu': intl.DateSymbols( NAME: 'gu', ERAS: const <String>[ 'ઈ.સ.પૂર્વે', 'ઈ.સ.', ], ERANAMES: const <String>[ 'ઈસવીસન પૂર્વે', 'ઇસવીસન', ], NARROWMONTHS: const <String>[ 'જા', 'ફે', 'મા', 'એ', 'મે', 'જૂ', 'જુ', 'ઑ', 'સ', 'ઑ', 'ન', 'ડિ', ], STANDALONENARROWMONTHS: const <String>[ 'જા', 'ફે', 'મા', 'એ', 'મે', 'જૂ', 'જુ', 'ઑ', 'સ', 'ઑ', 'ન', 'ડિ', ], MONTHS: const <String>[ 'જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટોબર', 'નવેમ્બર', 'ડિસેમ્બર', ], STANDALONEMONTHS: const <String>[ 'જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટોબર', 'નવેમ્બર', 'ડિસેમ્બર', ], SHORTMONTHS: const <String>[ 'જાન્યુ', 'ફેબ્રુ', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટે', 'ઑક્ટો', 'નવે', 'ડિસે', ], STANDALONESHORTMONTHS: const <String>[ 'જાન્યુ', 'ફેબ્રુ', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટે', 'ઑક્ટો', 'નવે', 'ડિસે', ], WEEKDAYS: const <String>[ 'રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધવાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર', ], STANDALONEWEEKDAYS: const <String>[ 'રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધવાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર', ], SHORTWEEKDAYS: const <String>[ 'રવિ', 'સોમ', 'મંગળ', 'બુધ', 'ગુરુ', 'શુક્ર', 'શનિ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'રવિ', 'સોમ', 'મંગળ', 'બુધ', 'ગુરુ', 'શુક્ર', 'શનિ', ], NARROWWEEKDAYS: const <String>[ 'ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1લો ત્રિમાસ', '2જો ત્રિમાસ', '3જો ત્રિમાસ', '4થો ત્રિમાસ', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM, y', 'd MMM, y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'hh:mm:ss a zzzz', 'hh:mm:ss a z', 'hh:mm:ss a', 'hh:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} એ {0} વાગ્યે', '{1} એ {0} વાગ્યે', '{1} {0}', '{1} {0}', ], ), 'he': intl.DateSymbols( NAME: 'he', ERAS: const <String>[ 'לפנה״ס', 'לספירה', ], ERANAMES: const <String>[ 'לפני הספירה', 'לספירה', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר', ], STANDALONEMONTHS: const <String>[ 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר', ], SHORTMONTHS: const <String>[ 'ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳', ], STANDALONESHORTMONTHS: const <String>[ 'ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳', ], WEEKDAYS: const <String>[ 'יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום שישי', 'יום שבת', ], STANDALONEWEEKDAYS: const <String>[ 'יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום שישי', 'יום שבת', ], SHORTWEEKDAYS: const <String>[ 'יום א׳', 'יום ב׳', 'יום ג׳', 'יום ד׳', 'יום ה׳', 'יום ו׳', 'שבת', ], STANDALONESHORTWEEKDAYS: const <String>[ 'יום א׳', 'יום ב׳', 'יום ג׳', 'יום ד׳', 'יום ה׳', 'יום ו׳', 'שבת', ], NARROWWEEKDAYS: const <String>[ 'א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳', ], STANDALONENARROWWEEKDAYS: const <String>[ 'א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ 'רבעון 1', 'רבעון 2', 'רבעון 3', 'רבעון 4', ], AMPMS: const <String>[ 'לפנה״צ', 'אחה״צ', ], DATEFORMATS: const <String>[ 'EEEE, d בMMMM y', 'd בMMMM y', 'd בMMM y', 'd.M.y', ], TIMEFORMATS: const <String>[ 'H:mm:ss zzzz', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 4, 5, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} בשעה {0}', '{1} בשעה {0}', '{1}, {0}', '{1}, {0}', ], ), 'hi': intl.DateSymbols( NAME: 'hi', ERAS: const <String>[ 'ईसा-पूर्व', 'ईस्वी', ], ERANAMES: const <String>[ 'ईसा-पूर्व', 'ईसवी सन', ], NARROWMONTHS: const <String>[ 'ज', 'फ़', 'मा', 'अ', 'म', 'जू', 'जु', 'अ', 'सि', 'अ', 'न', 'दि', ], STANDALONENARROWMONTHS: const <String>[ 'ज', 'फ़', 'मा', 'अ', 'म', 'जू', 'जु', 'अ', 'सि', 'अ', 'न', 'दि', ], MONTHS: const <String>[ 'जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर', ], STANDALONEMONTHS: const <String>[ 'जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर', ], SHORTMONTHS: const <String>[ 'जन॰', 'फ़र॰', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुल॰', 'अग॰', 'सित॰', 'अक्तू॰', 'नव॰', 'दिस॰', ], STANDALONESHORTMONTHS: const <String>[ 'जन॰', 'फ़र॰', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुल॰', 'अग॰', 'सित॰', 'अक्तू॰', 'नव॰', 'दिस॰', ], WEEKDAYS: const <String>[ 'रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार', ], STANDALONEWEEKDAYS: const <String>[ 'रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार', ], SHORTWEEKDAYS: const <String>[ 'रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि', ], STANDALONESHORTWEEKDAYS: const <String>[ 'रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि', ], NARROWWEEKDAYS: const <String>[ 'र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श', ], STANDALONENARROWWEEKDAYS: const <String>[ 'र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श', ], SHORTQUARTERS: const <String>[ 'ति1', 'ति2', 'ति3', 'ति4', ], QUARTERS: const <String>[ 'पहली तिमाही', 'दूसरी तिमाही', 'तीसरी तिमाही', 'चौथी तिमाही', ], AMPMS: const <String>[ 'am', 'pm', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} को {0}', '{1} को {0}', '{1}, {0}', '{1}, {0}', ], ), 'hr': intl.DateSymbols( NAME: 'hr', ERAS: const <String>[ 'pr. Kr.', 'po. Kr.', ], ERANAMES: const <String>[ 'prije Krista', 'poslije Krista', ], NARROWMONTHS: const <String>[ '1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.', ], STANDALONENARROWMONTHS: const <String>[ '1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.', ], MONTHS: const <String>[ 'siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca', ], STANDALONEMONTHS: const <String>[ 'siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac', ], SHORTMONTHS: const <String>[ 'sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro', ], STANDALONESHORTMONTHS: const <String>[ 'sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro', ], WEEKDAYS: const <String>[ 'nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota', ], STANDALONEWEEKDAYS: const <String>[ 'nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota', ], SHORTWEEKDAYS: const <String>[ 'ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub', ], NARROWWEEKDAYS: const <String>[ 'N', 'P', 'U', 'S', 'Č', 'P', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'n', 'p', 'u', 's', 'č', 'p', 's', ], SHORTQUARTERS: const <String>[ '1kv', '2kv', '3kv', '4kv', ], QUARTERS: const <String>[ '1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y.', 'd. MMMM y.', 'd. MMM y.', 'dd. MM. y.', ], TIMEFORMATS: const <String>[ 'HH:mm:ss (zzzz)', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'u' {0}", "{1} 'u' {0}", '{1} {0}', '{1} {0}', ], ), 'hu': intl.DateSymbols( NAME: 'hu', ERAS: const <String>[ 'i. e.', 'i. sz.', ], ERANAMES: const <String>[ 'Krisztus előtt', 'időszámításunk szerint', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'Á', 'M', 'J', 'J', 'A', 'Sz', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'Á', 'M', 'J', 'J', 'A', 'Sz', 'O', 'N', 'D', ], MONTHS: const <String>[ 'január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december', ], STANDALONEMONTHS: const <String>[ 'január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december', ], SHORTMONTHS: const <String>[ 'jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat', ], STANDALONEWEEKDAYS: const <String>[ 'vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat', ], SHORTWEEKDAYS: const <String>[ 'V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo', ], STANDALONESHORTWEEKDAYS: const <String>[ 'V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo', ], NARROWWEEKDAYS: const <String>[ 'V', 'H', 'K', 'Sz', 'Cs', 'P', 'Sz', ], STANDALONENARROWWEEKDAYS: const <String>[ 'V', 'H', 'K', 'Sz', 'Cs', 'P', 'Sz', ], SHORTQUARTERS: const <String>[ 'I. n.év', 'II. n.év', 'III. n.év', 'IV. n.év', ], QUARTERS: const <String>[ 'I. negyedév', 'II. negyedév', 'III. negyedév', 'IV. negyedév', ], AMPMS: const <String>[ 'de.', 'du.', ], DATEFORMATS: const <String>[ 'y. MMMM d., EEEE', 'y. MMMM d.', 'y. MMM d.', 'y. MM. dd.', ], TIMEFORMATS: const <String>[ 'H:mm:ss zzzz', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'hy': intl.DateSymbols( NAME: 'hy', ERAS: const <String>[ 'մ.թ.ա.', 'մ.թ.', ], ERANAMES: const <String>[ 'Քրիստոսից առաջ', 'Քրիստոսից հետո', ], NARROWMONTHS: const <String>[ 'Հ', 'Փ', 'Մ', 'Ա', 'Մ', 'Հ', 'Հ', 'Օ', 'Ս', 'Հ', 'Ն', 'Դ', ], STANDALONENARROWMONTHS: const <String>[ 'Հ', 'Փ', 'Մ', 'Ա', 'Մ', 'Հ', 'Հ', 'Օ', 'Ս', 'Հ', 'Ն', 'Դ', ], MONTHS: const <String>[ 'հունվարի', 'փետրվարի', 'մարտի', 'ապրիլի', 'մայիսի', 'հունիսի', 'հուլիսի', 'օգոստոսի', 'սեպտեմբերի', 'հոկտեմբերի', 'նոյեմբերի', 'դեկտեմբերի', ], STANDALONEMONTHS: const <String>[ 'հունվար', 'փետրվար', 'մարտ', 'ապրիլ', 'մայիս', 'հունիս', 'հուլիս', 'օգոստոս', 'սեպտեմբեր', 'հոկտեմբեր', 'նոյեմբեր', 'դեկտեմբեր', ], SHORTMONTHS: const <String>[ 'հնվ', 'փտվ', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սեպ', 'հոկ', 'նոյ', 'դեկ', ], STANDALONESHORTMONTHS: const <String>[ 'հնվ', 'փտվ', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սեպ', 'հոկ', 'նոյ', 'դեկ', ], WEEKDAYS: const <String>[ 'կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ', ], STANDALONEWEEKDAYS: const <String>[ 'կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ', ], SHORTWEEKDAYS: const <String>[ 'կիր', 'երկ', 'երք', 'չրք', 'հնգ', 'ուր', 'շբթ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'կիր', 'երկ', 'երք', 'չրք', 'հնգ', 'ուր', 'շբթ', ], NARROWWEEKDAYS: const <String>[ 'Կ', 'Ե', 'Ե', 'Չ', 'Հ', 'Ո', 'Շ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Կ', 'Ե', 'Ե', 'Չ', 'Հ', 'Ո', 'Շ', ], SHORTQUARTERS: const <String>[ '1-ին եռմս.', '2-րդ եռմս.', '3-րդ եռմս.', '4-րդ եռմս.', ], QUARTERS: const <String>[ '1-ին եռամսյակ', '2-րդ եռամսյակ', '3-րդ եռամսյակ', '4-րդ եռամսյակ', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'y թ. MMMM d, EEEE', 'dd MMMM, y թ.', 'dd MMM, y թ.', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'id': intl.DateSymbols( NAME: 'id', ERAS: const <String>[ 'SM', 'M', ], ERANAMES: const <String>[ 'Sebelum Masehi', 'Masehi', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember', ], STANDALONEMONTHS: const <String>[ 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des', ], WEEKDAYS: const <String>[ 'Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', ], STANDALONEWEEKDAYS: const <String>[ 'Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', ], SHORTWEEKDAYS: const <String>[ 'Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', ], NARROWWEEKDAYS: const <String>[ 'M', 'S', 'S', 'R', 'K', 'J', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'M', 'S', 'S', 'R', 'K', 'J', 'S', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ 'Kuartal ke-1', 'Kuartal ke-2', 'Kuartal ke-3', 'Kuartal ke-4', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, dd MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'HH.mm.ss zzzz', 'HH.mm.ss z', 'HH.mm.ss', 'HH.mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'is': intl.DateSymbols( NAME: 'is', ERAS: const <String>[ 'f.Kr.', 'e.Kr.', ], ERANAMES: const <String>[ 'fyrir Krist', 'eftir Krist', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'Á', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'Á', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember', ], STANDALONEMONTHS: const <String>[ 'janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'maí', 'jún.', 'júl.', 'ágú.', 'sep.', 'okt.', 'nóv.', 'des.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'maí', 'jún.', 'júl.', 'ágú.', 'sep.', 'okt.', 'nóv.', 'des.', ], WEEKDAYS: const <String>[ 'sunnudagur', 'mánudagur', 'þriðjudagur', 'miðvikudagur', 'fimmtudagur', 'föstudagur', 'laugardagur', ], STANDALONEWEEKDAYS: const <String>[ 'sunnudagur', 'mánudagur', 'þriðjudagur', 'miðvikudagur', 'fimmtudagur', 'föstudagur', 'laugardagur', ], SHORTWEEKDAYS: const <String>[ 'sun.', 'mán.', 'þri.', 'mið.', 'fim.', 'fös.', 'lau.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'sun.', 'mán.', 'þri.', 'mið.', 'fim.', 'fös.', 'lau.', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'Þ', 'M', 'F', 'F', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'Þ', 'M', 'F', 'F', 'L', ], SHORTQUARTERS: const <String>[ 'F1', 'F2', 'F3', 'F4', ], QUARTERS: const <String>[ '1. fjórðungur', '2. fjórðungur', '3. fjórðungur', '4. fjórðungur', ], AMPMS: const <String>[ 'f.h.', 'e.h.', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y', 'd. MMMM y', 'd. MMM y', 'd.M.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'kl'. {0}", "{1} 'kl'. {0}", '{1}, {0}', '{1}, {0}', ], ), 'it': intl.DateSymbols( NAME: 'it', ERAS: const <String>[ 'a.C.', 'd.C.', ], ERANAMES: const <String>[ 'avanti Cristo', 'dopo Cristo', ], NARROWMONTHS: const <String>[ 'G', 'F', 'M', 'A', 'M', 'G', 'L', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'G', 'F', 'M', 'A', 'M', 'G', 'L', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre', ], STANDALONEMONTHS: const <String>[ 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre', ], SHORTMONTHS: const <String>[ 'gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic', ], STANDALONESHORTMONTHS: const <String>[ 'gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic', ], WEEKDAYS: const <String>[ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', ], STANDALONEWEEKDAYS: const <String>[ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', ], SHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'G', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'G', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1}, {0}', '{1}, {0}', ], ), 'ja': intl.DateSymbols( NAME: 'ja', ERAS: const <String>[ '紀元前', '西暦', ], ERANAMES: const <String>[ '紀元前', '西暦', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONEMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], SHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONESHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], WEEKDAYS: const <String>[ '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', ], STANDALONEWEEKDAYS: const <String>[ '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', ], SHORTWEEKDAYS: const <String>[ '日', '月', '火', '水', '木', '金', '土', ], STANDALONESHORTWEEKDAYS: const <String>[ '日', '月', '火', '水', '木', '金', '土', ], NARROWWEEKDAYS: const <String>[ '日', '月', '火', '水', '木', '金', '土', ], STANDALONENARROWWEEKDAYS: const <String>[ '日', '月', '火', '水', '木', '金', '土', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '第1四半期', '第2四半期', '第3四半期', '第4四半期', ], AMPMS: const <String>[ '午前', '午後', ], DATEFORMATS: const <String>[ 'y年M月d日EEEE', 'y年M月d日', 'y/MM/dd', 'y/MM/dd', ], TIMEFORMATS: const <String>[ 'H時mm分ss秒 zzzz', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'ka': intl.DateSymbols( NAME: 'ka', ERAS: const <String>[ 'ძვ. წ.', 'ახ. წ.', ], ERANAMES: const <String>[ 'ძველი წელთაღრიცხვით', 'ახალი წელთაღრიცხვით', ], NARROWMONTHS: const <String>[ 'ი', 'თ', 'მ', 'ა', 'მ', 'ი', 'ი', 'ა', 'ს', 'ო', 'ნ', 'დ', ], STANDALONENARROWMONTHS: const <String>[ 'ი', 'თ', 'მ', 'ა', 'მ', 'ი', 'ი', 'ა', 'ს', 'ო', 'ნ', 'დ', ], MONTHS: const <String>[ 'იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი', ], STANDALONEMONTHS: const <String>[ 'იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი', ], SHORTMONTHS: const <String>[ 'იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ', ], STANDALONESHORTMONTHS: const <String>[ 'იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ', ], WEEKDAYS: const <String>[ 'კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი', ], STANDALONEWEEKDAYS: const <String>[ 'კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი', ], SHORTWEEKDAYS: const <String>[ 'კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ', ], NARROWWEEKDAYS: const <String>[ 'კ', 'ო', 'ს', 'ო', 'ხ', 'პ', 'შ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'კ', 'ო', 'ს', 'ო', 'ხ', 'პ', 'შ', ], SHORTQUARTERS: const <String>[ 'I კვ.', 'II კვ.', 'III კვ.', 'IV კვ.', ], QUARTERS: const <String>[ 'I კვარტალი', 'II კვარტალი', 'III კვარტალი', 'IV კვარტალი', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, dd MMMM, y', 'd MMMM, y', 'd MMM. y', 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'kk': intl.DateSymbols( NAME: 'kk', ERAS: const <String>[ 'б.з.д.', 'б.з.', ], ERANAMES: const <String>[ 'Біздің заманымызға дейін', 'біздің заманымыз', ], NARROWMONTHS: const <String>[ 'Қ', 'А', 'Н', 'С', 'М', 'М', 'Ш', 'Т', 'Қ', 'Қ', 'Қ', 'Ж', ], STANDALONENARROWMONTHS: const <String>[ 'Қ', 'А', 'Н', 'С', 'М', 'М', 'Ш', 'Т', 'Қ', 'Қ', 'Қ', 'Ж', ], MONTHS: const <String>[ 'қаңтар', 'ақпан', 'наурыз', 'сәуір', 'мамыр', 'маусым', 'шілде', 'тамыз', 'қыркүйек', 'қазан', 'қараша', 'желтоқсан', ], STANDALONEMONTHS: const <String>[ 'Қаңтар', 'Ақпан', 'Наурыз', 'Сәуір', 'Мамыр', 'Маусым', 'Шілде', 'Тамыз', 'Қыркүйек', 'Қазан', 'Қараша', 'Желтоқсан', ], SHORTMONTHS: const <String>[ 'қаң.', 'ақп.', 'нау.', 'сәу.', 'мам.', 'мау.', 'шіл.', 'там.', 'қыр.', 'қаз.', 'қар.', 'жел.', ], STANDALONESHORTMONTHS: const <String>[ 'қаң.', 'ақп.', 'нау.', 'сәу.', 'мам.', 'мау.', 'шіл.', 'там.', 'қыр.', 'қаз.', 'қар.', 'жел.', ], WEEKDAYS: const <String>[ 'жексенбі', 'дүйсенбі', 'сейсенбі', 'сәрсенбі', 'бейсенбі', 'жұма', 'сенбі', ], STANDALONEWEEKDAYS: const <String>[ 'жексенбі', 'дүйсенбі', 'сейсенбі', 'сәрсенбі', 'бейсенбі', 'жұма', 'сенбі', ], SHORTWEEKDAYS: const <String>[ 'жс', 'дс', 'сс', 'ср', 'бс', 'жм', 'сб', ], STANDALONESHORTWEEKDAYS: const <String>[ 'жс', 'дс', 'сс', 'ср', 'бс', 'жм', 'сб', ], NARROWWEEKDAYS: const <String>[ 'Ж', 'Д', 'С', 'С', 'Б', 'Ж', 'С', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Ж', 'Д', 'С', 'С', 'Б', 'Ж', 'С', ], SHORTQUARTERS: const <String>[ 'І тқс.', 'ІІ тқс.', 'ІІІ тқс.', 'IV тқс.', ], QUARTERS: const <String>[ 'І тоқсан', 'ІІ тоқсан', 'ІІІ тоқсан', 'IV тоқсан', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ "y 'ж'. d MMMM, EEEE", "y 'ж'. d MMMM", "y 'ж'. dd MMM", 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'km': intl.DateSymbols( NAME: 'km', ERAS: const <String>[ 'មុន គ.ស.', 'គ.ស.', ], ERANAMES: const <String>[ 'មុន​គ្រិស្តសករាជ', 'គ្រិស្តសករាជ', ], NARROWMONTHS: const <String>[ 'ម', 'ក', 'ម', 'ម', 'ឧ', 'ម', 'ក', 'ស', 'ក', 'ត', 'វ', 'ធ', ], STANDALONENARROWMONTHS: const <String>[ 'ម', 'ក', 'ម', 'ម', 'ឧ', 'ម', 'ក', 'ស', 'ក', 'ត', 'វ', 'ធ', ], MONTHS: const <String>[ 'មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ', ], STANDALONEMONTHS: const <String>[ 'មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ', ], SHORTMONTHS: const <String>[ 'មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ', ], STANDALONESHORTMONTHS: const <String>[ 'មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ', ], WEEKDAYS: const <String>[ 'អាទិត្យ', 'ច័ន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍', ], STANDALONEWEEKDAYS: const <String>[ 'អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍', ], SHORTWEEKDAYS: const <String>[ 'អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហ', 'សុក្រ', 'សៅរ៍', ], STANDALONESHORTWEEKDAYS: const <String>[ 'អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហ', 'សុក្រ', 'សៅរ៍', ], NARROWWEEKDAYS: const <String>[ 'អ', 'ច', 'អ', 'ព', 'ព', 'ស', 'ស', ], STANDALONENARROWWEEKDAYS: const <String>[ 'អ', 'ច', 'អ', 'ព', 'ព', 'ស', 'ស', ], SHORTQUARTERS: const <String>[ 'ត្រីមាសទី 1', 'ត្រីមាសទី 2', 'ត្រីមាសទី 3', 'ត្រីមាសទី 4', ], QUARTERS: const <String>[ 'ត្រីមាសទី 1', 'ត្រីមាសទី 2', 'ត្រីមាសទី 3', 'ត្រីមាសទី 4', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} នៅ​ម៉ោង {0}', '{1} នៅ​ម៉ោង {0}', '{1}, {0}', '{1}, {0}', ], ), 'kn': intl.DateSymbols( NAME: 'kn', ERAS: const <String>[ '\u{c95}\u{ccd}\u{cb0}\u{cbf}\u{2e}\u{caa}\u{cc2}', '\u{c95}\u{ccd}\u{cb0}\u{cbf}\u{2e}\u{cb6}', ], ERANAMES: const <String>[ '\u{c95}\u{ccd}\u{cb0}\u{cbf}\u{cb8}\u{ccd}\u{ca4}\u{20}\u{caa}\u{cc2}\u{cb0}\u{ccd}\u{cb5}', '\u{c95}\u{ccd}\u{cb0}\u{cbf}\u{cb8}\u{ccd}\u{ca4}\u{20}\u{cb6}\u{c95}', ], NARROWMONTHS: const <String>[ '\u{c9c}', '\u{cab}\u{cc6}', '\u{cae}\u{cbe}', '\u{c8f}', '\u{cae}\u{cc7}', '\u{c9c}\u{cc2}', '\u{c9c}\u{cc1}', '\u{c86}', '\u{cb8}\u{cc6}', '\u{c85}', '\u{ca8}', '\u{ca1}\u{cbf}', ], STANDALONENARROWMONTHS: const <String>[ '\u{c9c}', '\u{cab}\u{cc6}', '\u{cae}\u{cbe}', '\u{c8f}', '\u{cae}\u{cc7}', '\u{c9c}\u{cc2}', '\u{c9c}\u{cc1}', '\u{c86}', '\u{cb8}\u{cc6}', '\u{c85}', '\u{ca8}', '\u{ca1}\u{cbf}', ], MONTHS: const <String>[ '\u{c9c}\u{ca8}\u{cb5}\u{cb0}\u{cbf}', '\u{cab}\u{cc6}\u{cac}\u{ccd}\u{cb0}\u{cb5}\u{cb0}\u{cbf}', '\u{cae}\u{cbe}\u{cb0}\u{ccd}\u{c9a}\u{ccd}', '\u{c8f}\u{caa}\u{ccd}\u{cb0}\u{cbf}\u{cb2}\u{ccd}', '\u{cae}\u{cc7}', '\u{c9c}\u{cc2}\u{ca8}\u{ccd}', '\u{c9c}\u{cc1}\u{cb2}\u{cc8}', '\u{c86}\u{c97}\u{cb8}\u{ccd}\u{c9f}\u{ccd}', '\u{cb8}\u{cc6}\u{caa}\u{ccd}\u{c9f}\u{cc6}\u{c82}\u{cac}\u{cb0}\u{ccd}', '\u{c85}\u{c95}\u{ccd}\u{c9f}\u{ccb}\u{cac}\u{cb0}\u{ccd}', '\u{ca8}\u{cb5}\u{cc6}\u{c82}\u{cac}\u{cb0}\u{ccd}', '\u{ca1}\u{cbf}\u{cb8}\u{cc6}\u{c82}\u{cac}\u{cb0}\u{ccd}', ], STANDALONEMONTHS: const <String>[ '\u{c9c}\u{ca8}\u{cb5}\u{cb0}\u{cbf}', '\u{cab}\u{cc6}\u{cac}\u{ccd}\u{cb0}\u{cb5}\u{cb0}\u{cbf}', '\u{cae}\u{cbe}\u{cb0}\u{ccd}\u{c9a}\u{ccd}', '\u{c8f}\u{caa}\u{ccd}\u{cb0}\u{cbf}\u{cb2}\u{ccd}', '\u{cae}\u{cc7}', '\u{c9c}\u{cc2}\u{ca8}\u{ccd}', '\u{c9c}\u{cc1}\u{cb2}\u{cc8}', '\u{c86}\u{c97}\u{cb8}\u{ccd}\u{c9f}\u{ccd}', '\u{cb8}\u{cc6}\u{caa}\u{ccd}\u{c9f}\u{cc6}\u{c82}\u{cac}\u{cb0}\u{ccd}', '\u{c85}\u{c95}\u{ccd}\u{c9f}\u{ccb}\u{cac}\u{cb0}\u{ccd}', '\u{ca8}\u{cb5}\u{cc6}\u{c82}\u{cac}\u{cb0}\u{ccd}', '\u{ca1}\u{cbf}\u{cb8}\u{cc6}\u{c82}\u{cac}\u{cb0}\u{ccd}', ], SHORTMONTHS: const <String>[ '\u{c9c}\u{ca8}\u{cb5}\u{cb0}\u{cbf}', '\u{cab}\u{cc6}\u{cac}\u{ccd}\u{cb0}\u{cb5}\u{cb0}\u{cbf}', '\u{cae}\u{cbe}\u{cb0}\u{ccd}\u{c9a}\u{ccd}', '\u{c8f}\u{caa}\u{ccd}\u{cb0}\u{cbf}', '\u{cae}\u{cc7}', '\u{c9c}\u{cc2}\u{ca8}\u{ccd}', '\u{c9c}\u{cc1}\u{cb2}\u{cc8}', '\u{c86}\u{c97}', '\u{cb8}\u{cc6}\u{caa}\u{ccd}\u{c9f}\u{cc6}\u{c82}', '\u{c85}\u{c95}\u{ccd}\u{c9f}\u{ccb}', '\u{ca8}\u{cb5}\u{cc6}\u{c82}', '\u{ca1}\u{cbf}\u{cb8}\u{cc6}\u{c82}', ], STANDALONESHORTMONTHS: const <String>[ '\u{c9c}\u{ca8}', '\u{cab}\u{cc6}\u{cac}\u{ccd}\u{cb0}', '\u{cae}\u{cbe}\u{cb0}\u{ccd}\u{c9a}\u{ccd}', '\u{c8f}\u{caa}\u{ccd}\u{cb0}\u{cbf}', '\u{cae}\u{cc7}', '\u{c9c}\u{cc2}\u{ca8}\u{ccd}', '\u{c9c}\u{cc1}\u{cb2}\u{cc8}', '\u{c86}\u{c97}', '\u{cb8}\u{cc6}\u{caa}\u{ccd}\u{c9f}\u{cc6}\u{c82}', '\u{c85}\u{c95}\u{ccd}\u{c9f}\u{ccb}', '\u{ca8}\u{cb5}\u{cc6}\u{c82}', '\u{ca1}\u{cbf}\u{cb8}\u{cc6}\u{c82}', ], WEEKDAYS: const <String>[ '\u{cad}\u{cbe}\u{ca8}\u{cc1}\u{cb5}\u{cbe}\u{cb0}', '\u{cb8}\u{ccb}\u{cae}\u{cb5}\u{cbe}\u{cb0}', '\u{cae}\u{c82}\u{c97}\u{cb3}\u{cb5}\u{cbe}\u{cb0}', '\u{cac}\u{cc1}\u{ca7}\u{cb5}\u{cbe}\u{cb0}', '\u{c97}\u{cc1}\u{cb0}\u{cc1}\u{cb5}\u{cbe}\u{cb0}', '\u{cb6}\u{cc1}\u{c95}\u{ccd}\u{cb0}\u{cb5}\u{cbe}\u{cb0}', '\u{cb6}\u{ca8}\u{cbf}\u{cb5}\u{cbe}\u{cb0}', ], STANDALONEWEEKDAYS: const <String>[ '\u{cad}\u{cbe}\u{ca8}\u{cc1}\u{cb5}\u{cbe}\u{cb0}', '\u{cb8}\u{ccb}\u{cae}\u{cb5}\u{cbe}\u{cb0}', '\u{cae}\u{c82}\u{c97}\u{cb3}\u{cb5}\u{cbe}\u{cb0}', '\u{cac}\u{cc1}\u{ca7}\u{cb5}\u{cbe}\u{cb0}', '\u{c97}\u{cc1}\u{cb0}\u{cc1}\u{cb5}\u{cbe}\u{cb0}', '\u{cb6}\u{cc1}\u{c95}\u{ccd}\u{cb0}\u{cb5}\u{cbe}\u{cb0}', '\u{cb6}\u{ca8}\u{cbf}\u{cb5}\u{cbe}\u{cb0}', ], SHORTWEEKDAYS: const <String>[ '\u{cad}\u{cbe}\u{ca8}\u{cc1}', '\u{cb8}\u{ccb}\u{cae}', '\u{cae}\u{c82}\u{c97}\u{cb3}', '\u{cac}\u{cc1}\u{ca7}', '\u{c97}\u{cc1}\u{cb0}\u{cc1}', '\u{cb6}\u{cc1}\u{c95}\u{ccd}\u{cb0}', '\u{cb6}\u{ca8}\u{cbf}', ], STANDALONESHORTWEEKDAYS: const <String>[ '\u{cad}\u{cbe}\u{ca8}\u{cc1}', '\u{cb8}\u{ccb}\u{cae}', '\u{cae}\u{c82}\u{c97}\u{cb3}', '\u{cac}\u{cc1}\u{ca7}', '\u{c97}\u{cc1}\u{cb0}\u{cc1}', '\u{cb6}\u{cc1}\u{c95}\u{ccd}\u{cb0}', '\u{cb6}\u{ca8}\u{cbf}', ], NARROWWEEKDAYS: const <String>[ '\u{cad}\u{cbe}', '\u{cb8}\u{ccb}', '\u{cae}\u{c82}', '\u{cac}\u{cc1}', '\u{c97}\u{cc1}', '\u{cb6}\u{cc1}', '\u{cb6}', ], STANDALONENARROWWEEKDAYS: const <String>[ '\u{cad}\u{cbe}', '\u{cb8}\u{ccb}', '\u{cae}\u{c82}', '\u{cac}\u{cc1}', '\u{c97}\u{cc1}', '\u{cb6}\u{cc1}', '\u{cb6}', ], SHORTQUARTERS: const <String>[ '\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{20}\u{31}', '\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{20}\u{32}', '\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{20}\u{33}', '\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{20}\u{34}', ], QUARTERS: const <String>[ '\u{31}\u{ca8}\u{cc7}\u{20}\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{cae}\u{cbe}\u{cb8}\u{cbf}\u{c95}', '\u{32}\u{ca8}\u{cc7}\u{20}\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{cae}\u{cbe}\u{cb8}\u{cbf}\u{c95}', '\u{33}\u{ca8}\u{cc7}\u{20}\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{cae}\u{cbe}\u{cb8}\u{cbf}\u{c95}', '\u{34}\u{ca8}\u{cc7}\u{20}\u{ca4}\u{ccd}\u{cb0}\u{cc8}\u{cae}\u{cbe}\u{cb8}\u{cbf}\u{c95}', ], AMPMS: const <String>[ '\u{caa}\u{cc2}\u{cb0}\u{ccd}\u{cb5}\u{cbe}\u{cb9}\u{ccd}\u{ca8}', '\u{c85}\u{caa}\u{cb0}\u{cbe}\u{cb9}\u{ccd}\u{ca8}', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'hh:mm:ss a zzzz', 'hh:mm:ss a z', 'hh:mm:ss a', 'hh:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'ko': intl.DateSymbols( NAME: 'ko', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ '기원전', '서기', ], NARROWMONTHS: const <String>[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월', ], STANDALONENARROWMONTHS: const <String>[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월', ], MONTHS: const <String>[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월', ], STANDALONEMONTHS: const <String>[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월', ], SHORTMONTHS: const <String>[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월', ], STANDALONESHORTMONTHS: const <String>[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월', ], WEEKDAYS: const <String>[ '일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일', ], STANDALONEWEEKDAYS: const <String>[ '일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일', ], SHORTWEEKDAYS: const <String>[ '일', '월', '화', '수', '목', '금', '토', ], STANDALONESHORTWEEKDAYS: const <String>[ '일', '월', '화', '수', '목', '금', '토', ], NARROWWEEKDAYS: const <String>[ '일', '월', '화', '수', '목', '금', '토', ], STANDALONENARROWWEEKDAYS: const <String>[ '일', '월', '화', '수', '목', '금', '토', ], SHORTQUARTERS: const <String>[ '1분기', '2분기', '3분기', '4분기', ], QUARTERS: const <String>[ '제 1/4분기', '제 2/4분기', '제 3/4분기', '제 4/4분기', ], AMPMS: const <String>[ '오전', '오후', ], DATEFORMATS: const <String>[ 'y년 M월 d일 EEEE', 'y년 M월 d일', 'y. M. d.', 'yy. M. d.', ], TIMEFORMATS: const <String>[ 'a h시 m분 s초 zzzz', 'a h시 m분 s초 z', 'a h:mm:ss', 'a h:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'ky': intl.DateSymbols( NAME: 'ky', ERAS: const <String>[ 'б.з.ч.', 'б.з.', ], ERANAMES: const <String>[ 'биздин заманга чейин', 'биздин заман', ], NARROWMONTHS: const <String>[ 'Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д', ], STANDALONENARROWMONTHS: const <String>[ 'Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д', ], MONTHS: const <String>[ 'январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь', ], STANDALONEMONTHS: const <String>[ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь', ], SHORTMONTHS: const <String>[ 'янв.', 'фев.', 'мар.', 'апр.', 'май', 'июн.', 'июл.', 'авг.', 'сен.', 'окт.', 'ноя.', 'дек.', ], STANDALONESHORTMONTHS: const <String>[ 'Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек', ], WEEKDAYS: const <String>[ 'жекшемби', 'дүйшөмбү', 'шейшемби', 'шаршемби', 'бейшемби', 'жума', 'ишемби', ], STANDALONEWEEKDAYS: const <String>[ 'жекшемби', 'дүйшөмбү', 'шейшемби', 'шаршемби', 'бейшемби', 'жума', 'ишемби', ], SHORTWEEKDAYS: const <String>[ 'жек.', 'дүй.', 'шейш.', 'шарш.', 'бейш.', 'жума', 'ишм.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'жек.', 'дүй.', 'шейш.', 'шарш.', 'бейш.', 'жума', 'ишм.', ], NARROWWEEKDAYS: const <String>[ 'Ж', 'Д', 'Ш', 'Ш', 'Б', 'Ж', 'И', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Ж', 'Д', 'Ш', 'Ш', 'Б', 'Ж', 'И', ], SHORTQUARTERS: const <String>[ '1-чей.', '2-чей.', '3-чей.', '4-чей.', ], QUARTERS: const <String>[ '1-чейрек', '2-чейрек', '3-чейрек', '4-чейрек', ], AMPMS: const <String>[ 'таңкы', 'түштөн кийинки', ], DATEFORMATS: const <String>[ "y-'ж'., d-MMMM, EEEE", "y-'ж'., d-MMMM", "y-'ж'., d-MMM", 'd/M/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'lo': intl.DateSymbols( NAME: 'lo', ERAS: const <String>[ 'ກ່ອນ ຄ.ສ.', 'ຄ.ສ.', ], ERANAMES: const <String>[ 'ກ່ອນຄຣິດສັກກະລາດ', 'ຄຣິດສັກກະລາດ', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ 'ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ', ], STANDALONEMONTHS: const <String>[ 'ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ', ], SHORTMONTHS: const <String>[ 'ມ.ກ.', 'ກ.ພ.', 'ມ.ນ.', 'ມ.ສ.', 'ພ.ພ.', 'ມິ.ຖ.', 'ກ.ລ.', 'ສ.ຫ.', 'ກ.ຍ.', 'ຕ.ລ.', 'ພ.ຈ.', 'ທ.ວ.', ], STANDALONESHORTMONTHS: const <String>[ 'ມ.ກ.', 'ກ.ພ.', 'ມ.ນ.', 'ມ.ສ.', 'ພ.ພ.', 'ມິ.ຖ.', 'ກ.ລ.', 'ສ.ຫ.', 'ກ.ຍ.', 'ຕ.ລ.', 'ພ.ຈ.', 'ທ.ວ.', ], WEEKDAYS: const <String>[ 'ວັນອາທິດ', 'ວັນຈັນ', 'ວັນອັງຄານ', 'ວັນພຸດ', 'ວັນພະຫັດ', 'ວັນສຸກ', 'ວັນເສົາ', ], STANDALONEWEEKDAYS: const <String>[ 'ວັນອາທິດ', 'ວັນຈັນ', 'ວັນອັງຄານ', 'ວັນພຸດ', 'ວັນພະຫັດ', 'ວັນສຸກ', 'ວັນເສົາ', ], SHORTWEEKDAYS: const <String>[ 'ອາທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ອາທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ', ], NARROWWEEKDAYS: const <String>[ 'ອາ', 'ຈ', 'ອ', 'ພ', 'ພຫ', 'ສຸ', 'ສ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ອາ', 'ຈ', 'ອ', 'ພ', 'ພຫ', 'ສຸ', 'ສ', ], SHORTQUARTERS: const <String>[ 'ຕມ1', 'ຕມ2', 'ຕມ3', 'ຕມ4', ], QUARTERS: const <String>[ 'ໄຕຣມາດ 1', 'ໄຕຣມາດ 2', 'ໄຕຣມາດ 3', 'ໄຕຣມາດ 4', ], AMPMS: const <String>[ 'ກ່ອນທ່ຽງ', 'ຫຼັງທ່ຽງ', ], DATEFORMATS: const <String>[ 'EEEE ທີ d MMMM G y', 'd MMMM y', 'd MMM y', 'd/M/y', ], TIMEFORMATS: const <String>[ 'H ໂມງ m ນາທີ ss ວິນາທີ zzzz', 'H ໂມງ m ນາທີ ss ວິນາທີ z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'lt': intl.DateSymbols( NAME: 'lt', ERAS: const <String>[ 'pr. Kr.', 'po Kr.', ], ERANAMES: const <String>[ 'prieš Kristų', 'po Kristaus', ], NARROWMONTHS: const <String>[ 'S', 'V', 'K', 'B', 'G', 'B', 'L', 'R', 'R', 'S', 'L', 'G', ], STANDALONENARROWMONTHS: const <String>[ 'S', 'V', 'K', 'B', 'G', 'B', 'L', 'R', 'R', 'S', 'L', 'G', ], MONTHS: const <String>[ 'sausio', 'vasario', 'kovo', 'balandžio', 'gegužės', 'birželio', 'liepos', 'rugpjūčio', 'rugsėjo', 'spalio', 'lapkričio', 'gruodžio', ], STANDALONEMONTHS: const <String>[ 'sausis', 'vasaris', 'kovas', 'balandis', 'gegužė', 'birželis', 'liepa', 'rugpjūtis', 'rugsėjis', 'spalis', 'lapkritis', 'gruodis', ], SHORTMONTHS: const <String>[ 'saus.', 'vas.', 'kov.', 'bal.', 'geg.', 'birž.', 'liep.', 'rugp.', 'rugs.', 'spal.', 'lapkr.', 'gruod.', ], STANDALONESHORTMONTHS: const <String>[ 'saus.', 'vas.', 'kov.', 'bal.', 'geg.', 'birž.', 'liep.', 'rugp.', 'rugs.', 'spal.', 'lapkr.', 'gruod.', ], WEEKDAYS: const <String>[ 'sekmadienis', 'pirmadienis', 'antradienis', 'trečiadienis', 'ketvirtadienis', 'penktadienis', 'šeštadienis', ], STANDALONEWEEKDAYS: const <String>[ 'sekmadienis', 'pirmadienis', 'antradienis', 'trečiadienis', 'ketvirtadienis', 'penktadienis', 'šeštadienis', ], SHORTWEEKDAYS: const <String>[ 'sk', 'pr', 'an', 'tr', 'kt', 'pn', 'št', ], STANDALONESHORTWEEKDAYS: const <String>[ 'sk', 'pr', 'an', 'tr', 'kt', 'pn', 'št', ], NARROWWEEKDAYS: const <String>[ 'S', 'P', 'A', 'T', 'K', 'P', 'Š', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'P', 'A', 'T', 'K', 'P', 'Š', ], SHORTQUARTERS: const <String>[ 'I k.', 'II k.', 'III k.', 'IV k.', ], QUARTERS: const <String>[ 'I ketvirtis', 'II ketvirtis', 'III ketvirtis', 'IV ketvirtis', ], AMPMS: const <String>[ 'priešpiet', 'popiet', ], DATEFORMATS: const <String>[ "y 'm'. MMMM d 'd'., EEEE", "y 'm'. MMMM d 'd'.", 'y-MM-dd', 'y-MM-dd', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'lv': intl.DateSymbols( NAME: 'lv', ERAS: const <String>[ 'p.m.ē.', 'm.ē.', ], ERANAMES: const <String>[ 'pirms mūsu ēras', 'mūsu ērā', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris', ], STANDALONEMONTHS: const <String>[ 'janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris', ], SHORTMONTHS: const <String>[ 'janv.', 'febr.', 'marts', 'apr.', 'maijs', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'janv.', 'febr.', 'marts', 'apr.', 'maijs', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'svētdiena', 'pirmdiena', 'otrdiena', 'trešdiena', 'ceturtdiena', 'piektdiena', 'sestdiena', ], STANDALONEWEEKDAYS: const <String>[ 'Svētdiena', 'Pirmdiena', 'Otrdiena', 'Trešdiena', 'Ceturtdiena', 'Piektdiena', 'Sestdiena', ], SHORTWEEKDAYS: const <String>[ 'svētd.', 'pirmd.', 'otrd.', 'trešd.', 'ceturtd.', 'piektd.', 'sestd.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Svētd.', 'Pirmd.', 'Otrd.', 'Trešd.', 'Ceturtd.', 'Piektd.', 'Sestd.', ], NARROWWEEKDAYS: const <String>[ 'S', 'P', 'O', 'T', 'C', 'P', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'P', 'O', 'T', 'C', 'P', 'S', ], SHORTQUARTERS: const <String>[ '1. cet.', '2. cet.', '3. cet.', '4. cet.', ], QUARTERS: const <String>[ '1. ceturksnis', '2. ceturksnis', '3. ceturksnis', '4. ceturksnis', ], AMPMS: const <String>[ 'priekšpusdienā', 'pēcpusdienā', ], DATEFORMATS: const <String>[ "EEEE, y. 'gada' d. MMMM", "y. 'gada' d. MMMM", "y. 'gada' d. MMM", 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'mk': intl.DateSymbols( NAME: 'mk', ERAS: const <String>[ 'п.н.е.', 'н.е.', ], ERANAMES: const <String>[ 'пред нашата ера', 'од нашата ера', ], NARROWMONTHS: const <String>[ 'ј', 'ф', 'м', 'а', 'м', 'ј', 'ј', 'а', 'с', 'о', 'н', 'д', ], STANDALONENARROWMONTHS: const <String>[ 'ј', 'ф', 'м', 'а', 'м', 'ј', 'ј', 'а', 'с', 'о', 'н', 'д', ], MONTHS: const <String>[ 'јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември', ], STANDALONEMONTHS: const <String>[ 'јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември', ], SHORTMONTHS: const <String>[ 'јан.', 'фев.', 'мар.', 'апр.', 'мај', 'јун.', 'јул.', 'авг.', 'септ.', 'окт.', 'ноем.', 'дек.', ], STANDALONESHORTMONTHS: const <String>[ 'јан.', 'фев.', 'мар.', 'апр.', 'мај', 'јун.', 'јул.', 'авг.', 'септ.', 'окт.', 'ноем.', 'дек.', ], WEEKDAYS: const <String>[ 'недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота', ], STANDALONEWEEKDAYS: const <String>[ 'недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота', ], SHORTWEEKDAYS: const <String>[ 'нед.', 'пон.', 'вто.', 'сре.', 'чет.', 'пет.', 'саб.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'нед.', 'пон.', 'вто.', 'сре.', 'чет.', 'пет.', 'саб.', ], NARROWWEEKDAYS: const <String>[ 'н', 'п', 'в', 'с', 'ч', 'п', 'с', ], STANDALONENARROWWEEKDAYS: const <String>[ 'н', 'п', 'в', 'с', 'ч', 'п', 'с', ], SHORTQUARTERS: const <String>[ 'јан-мар', 'апр-јун', 'јул-сеп', 'окт-дек', ], QUARTERS: const <String>[ 'прво тромесечје', 'второ тромесечје', 'трето тромесечје', 'четврто тромесечје', ], AMPMS: const <String>[ 'претпладне', 'попладне', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd.M.y', 'd.M.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1}, 'во' {0}", "{1}, 'во' {0}", "{1}, 'во' {0}", "{1}, 'во' {0}", ], ), 'ml': intl.DateSymbols( NAME: 'ml', ERAS: const <String>[ 'ക്രി.മു.', 'എഡി', ], ERANAMES: const <String>[ 'ക്രിസ്‌തുവിന് മുമ്പ്', 'ആന്നോ ഡൊമിനി', ], NARROWMONTHS: const <String>[ 'ജ', 'ഫെ', 'മാ', 'ഏ', 'മെ', 'ജൂൺ', 'ജൂ', 'ഓ', 'സെ', 'ഒ', 'ന', 'ഡി', ], STANDALONENARROWMONTHS: const <String>[ 'ജ', 'ഫെ', 'മാ', 'ഏ', 'മെ', 'ജൂൺ', 'ജൂ', 'ഓ', 'സെ', 'ഒ', 'ന', 'ഡി', ], MONTHS: const <String>[ 'ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്', 'ഏപ്രിൽ', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗസ്റ്റ്', 'സെപ്റ്റംബർ', 'ഒക്‌ടോബർ', 'നവംബർ', 'ഡിസംബർ', ], STANDALONEMONTHS: const <String>[ 'ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്', 'ഏപ്രിൽ', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗസ്റ്റ്', 'സെപ്റ്റംബർ', 'ഒക്‌ടോബർ', 'നവംബർ', 'ഡിസംബർ', ], SHORTMONTHS: const <String>[ 'ജനു', 'ഫെബ്രു', 'മാർ', 'ഏപ്രി', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗ', 'സെപ്റ്റം', 'ഒക്ടോ', 'നവം', 'ഡിസം', ], STANDALONESHORTMONTHS: const <String>[ 'ജനു', 'ഫെബ്രു', 'മാർ', 'ഏപ്രി', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗ', 'സെപ്റ്റം', 'ഒക്ടോ', 'നവം', 'ഡിസം', ], WEEKDAYS: const <String>[ 'ഞായറാഴ്‌ച', 'തിങ്കളാഴ്‌ച', 'ചൊവ്വാഴ്ച', 'ബുധനാഴ്‌ച', 'വ്യാഴാഴ്‌ച', 'വെള്ളിയാഴ്‌ച', 'ശനിയാഴ്‌ച', ], STANDALONEWEEKDAYS: const <String>[ 'ഞായറാഴ്‌ച', 'തിങ്കളാഴ്‌ച', 'ചൊവ്വാഴ്‌ച', 'ബുധനാഴ്‌ച', 'വ്യാഴാഴ്‌ച', 'വെള്ളിയാഴ്‌ച', 'ശനിയാഴ്‌ച', ], SHORTWEEKDAYS: const <String>[ 'ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി', ], NARROWWEEKDAYS: const <String>[ 'ഞ', 'തി', 'ചൊ', 'ബു', 'വ്യാ', 'വെ', 'ശ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ഞാ', 'തി', 'ചൊ', 'ബു', 'വ്യാ', 'വെ', 'ശ', ], SHORTQUARTERS: const <String>[ 'ഒന്നാം പാദം', 'രണ്ടാം പാദം', 'മൂന്നാം പാദം', 'നാലാം പാദം', ], QUARTERS: const <String>[ 'ഒന്നാം പാദം', 'രണ്ടാം പാദം', 'മൂന്നാം പാദം', 'നാലാം പാദം', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'y, MMMM d, EEEE', 'y, MMMM d', 'y, MMM d', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'mn': intl.DateSymbols( NAME: 'mn', ERAS: const <String>[ 'МЭӨ', 'МЭ', ], ERANAMES: const <String>[ 'манай эриний өмнөх', 'манай эриний', ], NARROWMONTHS: const <String>[ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', ], STANDALONENARROWMONTHS: const <String>[ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', ], MONTHS: const <String>[ 'нэгдүгээр сар', 'хоёрдугаар сар', 'гуравдугаар сар', 'дөрөвдүгээр сар', 'тавдугаар сар', 'зургаадугаар сар', 'долоодугаар сар', 'наймдугаар сар', 'есдүгээр сар', 'аравдугаар сар', 'арван нэгдүгээр сар', 'арван хоёрдугаар сар', ], STANDALONEMONTHS: const <String>[ 'Нэгдүгээр сар', 'Хоёрдугаар сар', 'Гуравдугаар сар', 'Дөрөвдүгээр сар', 'Тавдугаар сар', 'Зургаадугаар сар', 'Долоодугаар сар', 'Наймдугаар сар', 'Есдүгээр сар', 'Аравдугаар сар', 'Арван нэгдүгээр сар', 'Арван хоёрдугаар сар', ], SHORTMONTHS: const <String>[ '1-р сар', '2-р сар', '3-р сар', '4-р сар', '5-р сар', '6-р сар', '7-р сар', '8-р сар', '9-р сар', '10-р сар', '11-р сар', '12-р сар', ], STANDALONESHORTMONTHS: const <String>[ '1-р сар', '2-р сар', '3-р сар', '4-р сар', '5-р сар', '6-р сар', '7-р сар', '8-р сар', '9-р сар', '10-р сар', '11-р сар', '12-р сар', ], WEEKDAYS: const <String>[ 'ням', 'даваа', 'мягмар', 'лхагва', 'пүрэв', 'баасан', 'бямба', ], STANDALONEWEEKDAYS: const <String>[ 'Ням', 'Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба', ], SHORTWEEKDAYS: const <String>[ 'Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя', ], NARROWWEEKDAYS: const <String>[ 'Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя', ], SHORTQUARTERS: const <String>[ 'I улирал', 'II улирал', 'III улирал', 'IV улирал', ], QUARTERS: const <String>[ '1-р улирал', '2-р улирал', '3-р улирал', '4-р улирал', ], AMPMS: const <String>[ 'ү.ө.', 'ү.х.', ], DATEFORMATS: const <String>[ "y 'оны' MMMM'ын' d, EEEE 'гараг'", "y 'оны' MMMM'ын' d", "y 'оны' MMM'ын' d", 'y.MM.dd', ], TIMEFORMATS: const <String>[ 'HH:mm:ss (zzzz)', 'HH:mm:ss (z)', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'mr': intl.DateSymbols( NAME: 'mr', ERAS: const <String>[ 'इ. स. पू.', 'इ. स.', ], ERANAMES: const <String>[ 'ईसवीसनपूर्व', 'ईसवीसन', ], NARROWMONTHS: const <String>[ 'जा', 'फे', 'मा', 'ए', 'मे', 'जू', 'जु', 'ऑ', 'स', 'ऑ', 'नो', 'डि', ], STANDALONENARROWMONTHS: const <String>[ 'जा', 'फे', 'मा', 'ए', 'मे', 'जू', 'जु', 'ऑ', 'स', 'ऑ', 'नो', 'डि', ], MONTHS: const <String>[ 'जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ऑगस्ट', 'सप्टेंबर', 'ऑक्टोबर', 'नोव्हेंबर', 'डिसेंबर', ], STANDALONEMONTHS: const <String>[ 'जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ऑगस्ट', 'सप्टेंबर', 'ऑक्टोबर', 'नोव्हेंबर', 'डिसेंबर', ], SHORTMONTHS: const <String>[ 'जाने', 'फेब्रु', 'मार्च', 'एप्रि', 'मे', 'जून', 'जुलै', 'ऑग', 'सप्टें', 'ऑक्टो', 'नोव्हें', 'डिसें', ], STANDALONESHORTMONTHS: const <String>[ 'जाने', 'फेब्रु', 'मार्च', 'एप्रि', 'मे', 'जून', 'जुलै', 'ऑग', 'सप्टें', 'ऑक्टो', 'नोव्हें', 'डिसें', ], WEEKDAYS: const <String>[ 'रविवार', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार', ], STANDALONEWEEKDAYS: const <String>[ 'रविवार', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार', ], SHORTWEEKDAYS: const <String>[ 'रवि', 'सोम', 'मंगळ', 'बुध', 'गुरु', 'शुक्र', 'शनि', ], STANDALONESHORTWEEKDAYS: const <String>[ 'रवि', 'सोम', 'मंगळ', 'बुध', 'गुरु', 'शुक्र', 'शनि', ], NARROWWEEKDAYS: const <String>[ 'र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श', ], STANDALONENARROWWEEKDAYS: const <String>[ 'र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श', ], SHORTQUARTERS: const <String>[ 'ति१', 'ति२', 'ति३', 'ति४', ], QUARTERS: const <String>[ 'प्रथम तिमाही', 'द्वितीय तिमाही', 'तृतीय तिमाही', 'चतुर्थ तिमाही', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM, y', 'd MMM, y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} रोजी {0}', '{1} रोजी {0}', '{1}, {0}', '{1}, {0}', ], ZERODIGIT: '०', ), 'ms': intl.DateSymbols( NAME: 'ms', ERAS: const <String>[ 'S.M.', 'TM', ], ERANAMES: const <String>[ 'S.M.', 'TM', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'O', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'O', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember', ], STANDALONEMONTHS: const <String>[ 'Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogo', 'Sep', 'Okt', 'Nov', 'Dis', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogo', 'Sep', 'Okt', 'Nov', 'Dis', ], WEEKDAYS: const <String>[ 'Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu', ], STANDALONEWEEKDAYS: const <String>[ 'Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu', ], SHORTWEEKDAYS: const <String>[ 'Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab', ], NARROWWEEKDAYS: const <String>[ 'A', 'I', 'S', 'R', 'K', 'J', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'A', 'I', 'S', 'R', 'K', 'J', 'S', ], SHORTQUARTERS: const <String>[ 'S1', 'S2', 'S3', 'S4', ], QUARTERS: const <String>[ 'Suku pertama', 'Suku Ke-2', 'Suku Ke-3', 'Suku Ke-4', ], AMPMS: const <String>[ 'PG', 'PTG', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd/MM/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1}, {0}', '{1}, {0}', ], ), 'my': intl.DateSymbols( NAME: 'my', ERAS: const <String>[ 'ဘီစီ', 'အဒေီ', ], ERANAMES: const <String>[ 'ခရစ်တော် မပေါ်မီနှစ်', 'ခရစ်နှစ်', ], NARROWMONTHS: const <String>[ 'ဇ', 'ဖ', 'မ', 'ဧ', 'မ', 'ဇ', 'ဇ', 'ဩ', 'စ', 'အ', 'န', 'ဒ', ], STANDALONENARROWMONTHS: const <String>[ 'ဇ', 'ဖ', 'မ', 'ဧ', 'မ', 'ဇ', 'ဇ', 'ဩ', 'စ', 'အ', 'န', 'ဒ', ], MONTHS: const <String>[ 'ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'ဩဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ', ], STANDALONEMONTHS: const <String>[ 'ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'ဩဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ', ], SHORTMONTHS: const <String>[ 'ဇန်', 'ဖေ', 'မတ်', 'ဧ', 'မေ', 'ဇွန်', 'ဇူ', 'ဩ', 'စက်', 'အောက်', 'နို', 'ဒီ', ], STANDALONESHORTMONTHS: const <String>[ 'ဇန်', 'ဖေ', 'မတ်', 'ဧ', 'မေ', 'ဇွန်', 'ဇူ', 'ဩ', 'စက်', 'အောက်', 'နို', 'ဒီ', ], WEEKDAYS: const <String>[ 'တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ', ], STANDALONEWEEKDAYS: const <String>[ 'တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ', ], SHORTWEEKDAYS: const <String>[ 'တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ', ], NARROWWEEKDAYS: const <String>[ 'တ', 'တ', 'အ', 'ဗ', 'က', 'သ', 'စ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'တ', 'တ', 'အ', 'ဗ', 'က', 'သ', 'စ', ], SHORTQUARTERS: const <String>[ 'ပထမ သုံးလပတ်', 'ဒုတိယ သုံးလပတ်', 'တတိယ သုံးလပတ်', 'စတုတ္ထ သုံးလပတ်', ], QUARTERS: const <String>[ 'ပထမ သုံးလပတ်', 'ဒုတိယ သုံးလပတ်', 'တတိယ သုံးလပတ်', 'စတုတ္ထ သုံးလပတ်', ], AMPMS: const <String>[ 'နံနက်', 'ညနေ', ], DATEFORMATS: const <String>[ 'y- MMMM d- EEEE', 'y- MMMM d', 'y- MMM d', 'dd-MM-yy', ], TIMEFORMATS: const <String>[ 'zzzz HH:mm:ss', 'z HH:mm:ss', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ZERODIGIT: '၀', ), 'nb': intl.DateSymbols( NAME: 'nb', ERAS: const <String>[ 'f.Kr.', 'e.Kr.', ], ERANAMES: const <String>[ 'før Kristus', 'etter Kristus', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember', ], STANDALONEMONTHS: const <String>[ 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'mai', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'des.', ], STANDALONESHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des', ], WEEKDAYS: const <String>[ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', ], STANDALONEWEEKDAYS: const <String>[ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', ], SHORTWEEKDAYS: const <String>[ 'søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ '1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE d. MMMM y', 'd. MMMM y', 'd. MMM y', 'dd.MM.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'kl'. {0}", "{1} 'kl'. {0}", '{1}, {0}', '{1}, {0}', ], ), 'ne': intl.DateSymbols( NAME: 'ne', ERAS: const <String>[ 'ईसा पूर्व', 'सन्', ], ERANAMES: const <String>[ 'ईसा पूर्व', 'सन्', ], NARROWMONTHS: const <String>[ 'जन', 'फेब', 'मार्च', 'अप्र', 'मे', 'जुन', 'जुल', 'अग', 'सेप', 'अक्टो', 'नोभे', 'डिसे', ], STANDALONENARROWMONTHS: const <String>[ 'जन', 'फेेब', 'मार्च', 'अप्र', 'मे', 'जुन', 'जुल', 'अग', 'सेप', 'अक्टो', 'नोभे', 'डिसे', ], MONTHS: const <String>[ 'जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर', ], STANDALONEMONTHS: const <String>[ 'जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर', ], SHORTMONTHS: const <String>[ 'जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर', ], STANDALONESHORTMONTHS: const <String>[ 'जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर', ], WEEKDAYS: const <String>[ 'आइतबार', 'सोमबार', 'मङ्गलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार', ], STANDALONEWEEKDAYS: const <String>[ 'आइतबार', 'सोमबार', 'मङ्गलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार', ], SHORTWEEKDAYS: const <String>[ 'आइत', 'सोम', 'मङ्गल', 'बुध', 'बिहि', 'शुक्र', 'शनि', ], STANDALONESHORTWEEKDAYS: const <String>[ 'आइत', 'सोम', 'मङ्गल', 'बुध', 'बिहि', 'शुक्र', 'शनि', ], NARROWWEEKDAYS: const <String>[ 'आ', 'सो', 'म', 'बु', 'बि', 'शु', 'श', ], STANDALONENARROWWEEKDAYS: const <String>[ 'आ', 'सो', 'म', 'बु', 'बि', 'शु', 'श', ], SHORTQUARTERS: const <String>[ 'पहिलो सत्र', 'दोस्रो सत्र', 'तेस्रो सत्र', 'चौथो सत्र', ], QUARTERS: const <String>[ 'पहिलो सत्र', 'दोस्रो सत्र', 'तेस्रो सत्र', 'चौथो सत्र', ], AMPMS: const <String>[ 'पूर्वाह्न', 'अपराह्न', ], DATEFORMATS: const <String>[ 'y MMMM d, EEEE', 'y MMMM d', 'y MMM d', 'yy/M/d', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1}, {0}', '{1}, {0}', ], ZERODIGIT: '०', ), 'nl': intl.DateSymbols( NAME: 'nl', ERAS: const <String>[ 'v.Chr.', 'n.Chr.', ], ERANAMES: const <String>[ 'voor Christus', 'na Christus', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december', ], STANDALONEMONTHS: const <String>[ 'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', ], STANDALONEWEEKDAYS: const <String>[ 'zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', ], SHORTWEEKDAYS: const <String>[ 'zo', 'ma', 'di', 'wo', 'do', 'vr', 'za', ], STANDALONESHORTWEEKDAYS: const <String>[ 'zo', 'ma', 'di', 'wo', 'do', 'vr', 'za', ], NARROWWEEKDAYS: const <String>[ 'Z', 'M', 'D', 'W', 'D', 'V', 'Z', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Z', 'M', 'D', 'W', 'D', 'V', 'Z', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ '1e kwartaal', '2e kwartaal', '3e kwartaal', '4e kwartaal', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'dd-MM-y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'om' {0}", "{1} 'om' {0}", '{1} {0}', '{1} {0}', ], ), 'no': intl.DateSymbols( NAME: 'no', ERAS: const <String>[ 'f.Kr.', 'e.Kr.', ], ERANAMES: const <String>[ 'før Kristus', 'etter Kristus', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember', ], STANDALONEMONTHS: const <String>[ 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'mai', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'des.', ], STANDALONESHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des', ], WEEKDAYS: const <String>[ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', ], STANDALONEWEEKDAYS: const <String>[ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', ], SHORTWEEKDAYS: const <String>[ 'søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ '1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE d. MMMM y', 'd. MMMM y', 'd. MMM y', 'dd.MM.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ "{1} 'kl'. {0}", "{1} 'kl'. {0}", '{1}, {0}', '{1}, {0}', ], ), 'or': intl.DateSymbols( NAME: 'or', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'ଖ୍ରୀଷ୍ଟପୂର୍ବ', 'ଖ୍ରୀଷ୍ଟାବ୍ଦ', ], NARROWMONTHS: const <String>[ 'ଜା', 'ଫେ', 'ମା', 'ଅ', 'ମଇ', 'ଜୁ', 'ଜୁ', 'ଅ', 'ସେ', 'ଅ', 'ନ', 'ଡି', ], STANDALONENARROWMONTHS: const <String>[ 'ଜା', 'ଫେ', 'ମା', 'ଅ', 'ମଇ', 'ଜୁ', 'ଜୁ', 'ଅ', 'ସେ', 'ଅ', 'ନ', 'ଡି', ], MONTHS: const <String>[ 'ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର', ], STANDALONEMONTHS: const <String>[ 'ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର', ], SHORTMONTHS: const <String>[ 'ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର', ], STANDALONESHORTMONTHS: const <String>[ 'ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର', ], WEEKDAYS: const <String>[ 'ରବିବାର', 'ସୋମବାର', 'ମଙ୍ଗଳବାର', 'ବୁଧବାର', 'ଗୁରୁବାର', 'ଶୁକ୍ରବାର', 'ଶନିବାର', ], STANDALONEWEEKDAYS: const <String>[ 'ରବିବାର', 'ସୋମବାର', 'ମଙ୍ଗଳବାର', 'ବୁଧବାର', 'ଗୁରୁବାର', 'ଶୁକ୍ରବାର', 'ଶନିବାର', ], SHORTWEEKDAYS: const <String>[ 'ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି', ], NARROWWEEKDAYS: const <String>[ 'ର', 'ସୋ', 'ମ', 'ବୁ', 'ଗୁ', 'ଶୁ', 'ଶ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ର', 'ସୋ', 'ମ', 'ବୁ', 'ଗୁ', 'ଶୁ', 'ଶ', ], SHORTQUARTERS: const <String>[ '1ମ ତ୍ରୟମାସ', '2ୟ ତ୍ରୟମାସ', '3ୟ ତ୍ରୟମାସ', '4ର୍ଥ ତ୍ରୟମାସ', ], QUARTERS: const <String>[ '1ମ ତ୍ରୟମାସ', '2ୟ ତ୍ରୟମାସ', '3ୟ ତ୍ରୟମାସ', '4ର୍ଥ ତ୍ରୟମାସ', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'M/d/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{0} ଠାରେ {1}', '{0} ଠାରେ {1}', '{1}, {0}', '{1}, {0}', ], ), 'pa': intl.DateSymbols( NAME: 'pa', ERAS: const <String>[ 'ਈ. ਪੂ.', 'ਸੰਨ', ], ERANAMES: const <String>[ 'ਈਸਵੀ ਪੂਰਵ', 'ਈਸਵੀ ਸੰਨ', ], NARROWMONTHS: const <String>[ 'ਜ', 'ਫ਼', 'ਮਾ', 'ਅ', 'ਮ', 'ਜੂ', 'ਜੁ', 'ਅ', 'ਸ', 'ਅ', 'ਨ', 'ਦ', ], STANDALONENARROWMONTHS: const <String>[ 'ਜ', 'ਫ਼', 'ਮਾ', 'ਅ', 'ਮ', 'ਜੂ', 'ਜੁ', 'ਅ', 'ਸ', 'ਅ', 'ਨ', 'ਦ', ], MONTHS: const <String>[ 'ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ', ], STANDALONEMONTHS: const <String>[ 'ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ', ], SHORTMONTHS: const <String>[ 'ਜਨ', 'ਫ਼ਰ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾ', 'ਅਗ', 'ਸਤੰ', 'ਅਕਤੂ', 'ਨਵੰ', 'ਦਸੰ', ], STANDALONESHORTMONTHS: const <String>[ 'ਜਨ', 'ਫ਼ਰ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾ', 'ਅਗ', 'ਸਤੰ', 'ਅਕਤੂ', 'ਨਵੰ', 'ਦਸੰ', ], WEEKDAYS: const <String>[ 'ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁੱਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨਿੱਚਰਵਾਰ', ], STANDALONEWEEKDAYS: const <String>[ 'ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁੱਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨਿੱਚਰਵਾਰ', ], SHORTWEEKDAYS: const <String>[ 'ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕਰ', 'ਸ਼ਨਿੱਚਰ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕਰ', 'ਸ਼ਨਿੱਚਰ', ], NARROWWEEKDAYS: const <String>[ 'ਐ', 'ਸੋ', 'ਮੰ', 'ਬੁੱ', 'ਵੀ', 'ਸ਼ੁੱ', 'ਸ਼', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ਐ', 'ਸੋ', 'ਮੰ', 'ਬੁੱ', 'ਵੀ', 'ਸ਼ੁੱ', 'ਸ਼', ], SHORTQUARTERS: const <String>[ 'ਤਿਮਾਹੀ1', 'ਤਿਮਾਹੀ2', 'ਤਿਮਾਹੀ3', 'ਤਿਮਾਹੀ4', ], QUARTERS: const <String>[ 'ਪਹਿਲੀ ਤਿਮਾਹੀ', 'ਦੂਜੀ ਤਿਮਾਹੀ', 'ਤੀਜੀ ਤਿਮਾਹੀ', 'ਚੌਥੀ ਤਿਮਾਹੀ', ], AMPMS: const <String>[ 'ਪੂ.ਦੁ.', 'ਬਾ.ਦੁ.', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1}, {0}', '{1}, {0}', ], ), 'pl': intl.DateSymbols( NAME: 'pl', ERAS: const <String>[ 'p.n.e.', 'n.e.', ], ERANAMES: const <String>[ 'przed naszą erą', 'naszej ery', ], NARROWMONTHS: const <String>[ 's', 'l', 'm', 'k', 'm', 'c', 'l', 's', 'w', 'p', 'l', 'g', ], STANDALONENARROWMONTHS: const <String>[ 'S', 'L', 'M', 'K', 'M', 'C', 'L', 'S', 'W', 'P', 'L', 'G', ], MONTHS: const <String>[ 'stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia', ], STANDALONEMONTHS: const <String>[ 'styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień', ], SHORTMONTHS: const <String>[ 'sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru', ], STANDALONESHORTMONTHS: const <String>[ 'sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru', ], WEEKDAYS: const <String>[ 'niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota', ], STANDALONEWEEKDAYS: const <String>[ 'niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota', ], SHORTWEEKDAYS: const <String>[ 'niedz.', 'pon.', 'wt.', 'śr.', 'czw.', 'pt.', 'sob.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'niedz.', 'pon.', 'wt.', 'śr.', 'czw.', 'pt.', 'sob.', ], NARROWWEEKDAYS: const <String>[ 'n', 'p', 'w', 'ś', 'c', 'p', 's', ], STANDALONENARROWWEEKDAYS: const <String>[ 'N', 'P', 'W', 'Ś', 'C', 'P', 'S', ], SHORTQUARTERS: const <String>[ 'I kw.', 'II kw.', 'III kw.', 'IV kw.', ], QUARTERS: const <String>[ 'I kwartał', 'II kwartał', 'III kwartał', 'IV kwartał', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd.MM.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1}, {0}', '{1}, {0}', ], ), 'ps': intl.DateSymbols( NAME: 'ps', ERAS: const <String>[ 'له میلاد وړاندې', 'م.', ], ERANAMES: const <String>[ 'له میلاد څخه وړاندې', 'له میلاد څخه وروسته', ], NARROWMONTHS: const <String>[ 'ج', 'ف', 'م', 'ا', 'م', 'ج', 'ج', 'ا', 'س', 'ا', 'ن', 'د', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ 'جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اګست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], STANDALONEMONTHS: const <String>[ 'جنوري', 'فېبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اګست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], SHORTMONTHS: const <String>[ 'جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اګست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], STANDALONESHORTMONTHS: const <String>[ 'جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اګست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], WEEKDAYS: const <String>[ 'يونۍ', 'دونۍ', 'درېنۍ', 'څلرنۍ', 'پينځنۍ', 'جمعه', 'اونۍ', ], STANDALONEWEEKDAYS: const <String>[ 'يونۍ', 'دونۍ', 'درېنۍ', 'څلرنۍ', 'پينځنۍ', 'جمعه', 'اونۍ', ], SHORTWEEKDAYS: const <String>[ 'يونۍ', 'دونۍ', 'درېنۍ', 'څلرنۍ', 'پينځنۍ', 'جمعه', 'اونۍ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'يونۍ', 'دونۍ', 'درېنۍ', 'څلرنۍ', 'پينځنۍ', 'جمعه', 'اونۍ', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'لومړۍ ربعه', '۲مه ربعه', '۳مه ربعه', '۴مه ربعه', ], QUARTERS: const <String>[ 'لومړۍ ربعه', '۲مه ربعه', '۳مه ربعه', '۴مه ربعه', ], AMPMS: const <String>[ 'غ.م.', 'غ.و.', ], DATEFORMATS: const <String>[ 'EEEE د y د MMMM d', 'د y د MMMM d', 'y MMM d', 'y/M/d', ], TIMEFORMATS: const <String>[ 'H:mm:ss (zzzz)', 'H:mm:ss (z)', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 5, WEEKENDRANGE: const <int>[ 3, 4, ], FIRSTWEEKCUTOFFDAY: 4, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ZERODIGIT: '۰', ), 'pt': intl.DateSymbols( NAME: 'pt', ERAS: const <String>[ 'a.C.', 'd.C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'depois de Cristo', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro', ], STANDALONEMONTHS: const <String>[ 'janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro', ], SHORTMONTHS: const <String>[ 'jan.', 'fev.', 'mar.', 'abr.', 'mai.', 'jun.', 'jul.', 'ago.', 'set.', 'out.', 'nov.', 'dez.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'fev.', 'mar.', 'abr.', 'mai.', 'jun.', 'jul.', 'ago.', 'set.', 'out.', 'nov.', 'dez.', ], WEEKDAYS: const <String>[ 'domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado', ], SHORTWEEKDAYS: const <String>[ 'dom.', 'seg.', 'ter.', 'qua.', 'qui.', 'sex.', 'sáb.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dom.', 'seg.', 'ter.', 'qua.', 'qui.', 'sex.', 'sáb.', ], NARROWWEEKDAYS: const <String>[ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", "d 'de' MMM 'de' y", 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'pt_PT': intl.DateSymbols( NAME: 'pt_PT', ERAS: const <String>[ 'a.C.', 'd.C.', ], ERANAMES: const <String>[ 'antes de Cristo', 'depois de Cristo', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro', ], STANDALONEMONTHS: const <String>[ 'janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro', ], SHORTMONTHS: const <String>[ 'jan.', 'fev.', 'mar.', 'abr.', 'mai.', 'jun.', 'jul.', 'ago.', 'set.', 'out.', 'nov.', 'dez.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'fev.', 'mar.', 'abr.', 'mai.', 'jun.', 'jul.', 'ago.', 'set.', 'out.', 'nov.', 'dez.', ], WEEKDAYS: const <String>[ 'domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado', ], STANDALONEWEEKDAYS: const <String>[ 'domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado', ], SHORTWEEKDAYS: const <String>[ 'domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado', ], STANDALONESHORTWEEKDAYS: const <String>[ 'domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado', ], NARROWWEEKDAYS: const <String>[ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S', ], SHORTQUARTERS: const <String>[ 'T1', 'T2', 'T3', 'T4', ], QUARTERS: const <String>[ '1.º trimestre', '2.º trimestre', '3.º trimestre', '4.º trimestre', ], AMPMS: const <String>[ 'da manhã', 'da tarde', ], DATEFORMATS: const <String>[ "EEEE, d 'de' MMMM 'de' y", "d 'de' MMMM 'de' y", 'dd/MM/y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 2, DATETIMEFORMATS: const <String>[ "{1} 'às' {0}", "{1} 'às' {0}", '{1}, {0}', '{1}, {0}', ], ), 'ro': intl.DateSymbols( NAME: 'ro', ERAS: const <String>[ 'î.Hr.', 'd.Hr.', ], ERANAMES: const <String>[ 'înainte de Hristos', 'după Hristos', ], NARROWMONTHS: const <String>[ 'I', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'I', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie', ], STANDALONEMONTHS: const <String>[ 'ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie', ], SHORTMONTHS: const <String>[ 'ian.', 'feb.', 'mar.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'ian.', 'feb.', 'mar.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă', ], STANDALONEWEEKDAYS: const <String>[ 'duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă', ], SHORTWEEKDAYS: const <String>[ 'dum.', 'lun.', 'mar.', 'mie.', 'joi', 'vin.', 'sâm.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'dum.', 'lun.', 'mar.', 'mie.', 'joi', 'vin.', 'sâm.', ], NARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'D', 'L', 'M', 'M', 'J', 'V', 'S', ], SHORTQUARTERS: const <String>[ 'trim. I', 'trim. II', 'trim. III', 'trim. IV', ], QUARTERS: const <String>[ 'trimestrul I', 'trimestrul al II-lea', 'trimestrul al III-lea', 'trimestrul al IV-lea', ], AMPMS: const <String>[ 'a.m.', 'p.m.', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'dd.MM.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'ru': intl.DateSymbols( NAME: 'ru', ERAS: const <String>[ 'до н. э.', 'н. э.', ], ERANAMES: const <String>[ 'до Рождества Христова', 'от Рождества Христова', ], NARROWMONTHS: const <String>[ 'Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д', ], STANDALONENARROWMONTHS: const <String>[ 'Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д', ], MONTHS: const <String>[ 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря', ], STANDALONEMONTHS: const <String>[ 'январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь', ], SHORTMONTHS: const <String>[ 'янв.', 'февр.', 'мар.', 'апр.', 'мая', 'июн.', 'июл.', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.', ], STANDALONESHORTMONTHS: const <String>[ 'янв.', 'февр.', 'март', 'апр.', 'май', 'июнь', 'июль', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.', ], WEEKDAYS: const <String>[ 'воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота', ], STANDALONEWEEKDAYS: const <String>[ 'воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота', ], SHORTWEEKDAYS: const <String>[ 'вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', ], STANDALONESHORTWEEKDAYS: const <String>[ 'вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', ], NARROWWEEKDAYS: const <String>[ 'В', 'П', 'В', 'С', 'Ч', 'П', 'С', ], STANDALONENARROWWEEKDAYS: const <String>[ 'В', 'П', 'В', 'С', 'Ч', 'П', 'С', ], SHORTQUARTERS: const <String>[ '1-й кв.', '2-й кв.', '3-й кв.', '4-й кв.', ], QUARTERS: const <String>[ '1-й квартал', '2-й квартал', '3-й квартал', '4-й квартал', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ "EEEE, d MMMM y 'г'.", "d MMMM y 'г'.", "d MMM y 'г'.", 'dd.MM.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'si': intl.DateSymbols( NAME: 'si', ERAS: const <String>[ 'ක්‍රි.පූ.', 'ක්‍රි.ව.', ], ERANAMES: const <String>[ 'ක්‍රිස්තු පූර්ව', 'ක්‍රිස්තු වර්ෂ', ], NARROWMONTHS: const <String>[ 'ජ', 'පෙ', 'මා', 'අ', 'මැ', 'ජූ', 'ජූ', 'අ', 'සැ', 'ඔ', 'නෙ', 'දෙ', ], STANDALONENARROWMONTHS: const <String>[ 'ජ', 'පෙ', 'මා', 'අ', 'මැ', 'ජූ', 'ජූ', 'අ', 'සැ', 'ඔ', 'නෙ', 'දෙ', ], MONTHS: const <String>[ 'ජනවාරි', 'පෙබරවාරි', 'මාර්තු', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝස්තු', 'සැප්තැම්බර්', 'ඔක්තෝබර්', 'නොවැම්බර්', 'දෙසැම්බර්', ], STANDALONEMONTHS: const <String>[ 'ජනවාරි', 'පෙබරවාරි', 'මාර්තු', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝස්තු', 'සැප්තැම්බර්', 'ඔක්තෝබර්', 'නොවැම්බර්', 'දෙසැම්බර්', ], SHORTMONTHS: const <String>[ 'ජන', 'පෙබ', 'මාර්තු', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝ', 'සැප්', 'ඔක්', 'නොවැ', 'දෙසැ', ], STANDALONESHORTMONTHS: const <String>[ 'ජන', 'පෙබ', 'මාර්', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝ', 'සැප්', 'ඔක්', 'නොවැ', 'දෙසැ', ], WEEKDAYS: const <String>[ 'ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්‍රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා', ], STANDALONEWEEKDAYS: const <String>[ 'ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්‍රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා', ], SHORTWEEKDAYS: const <String>[ 'ඉරිදා', 'සඳුදා', 'අඟහ', 'බදාදා', 'බ්‍රහස්', 'සිකු', 'සෙන', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ඉරිදා', 'සඳුදා', 'අඟහ', 'බදාදා', 'බ්‍රහස්', 'සිකු', 'සෙන', ], NARROWWEEKDAYS: const <String>[ 'ඉ', 'ස', 'අ', 'බ', 'බ්‍ර', 'සි', 'සෙ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ඉ', 'ස', 'අ', 'බ', 'බ්‍ර', 'සි', 'සෙ', ], SHORTQUARTERS: const <String>[ 'කාර්:1', 'කාර්:2', 'කාර්:3', 'කාර්:4', ], QUARTERS: const <String>[ '1 වන කාර්තුව', '2 වන කාර්තුව', '3 වන කාර්තුව', '4 වන කාර්තුව', ], AMPMS: const <String>[ 'පෙ.ව.', 'ප.ව.', ], DATEFORMATS: const <String>[ 'y MMMM d, EEEE', 'y MMMM d', 'y MMM d', 'y-MM-dd', ], TIMEFORMATS: const <String>[ 'HH.mm.ss zzzz', 'HH.mm.ss z', 'HH.mm.ss', 'HH.mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'sk': intl.DateSymbols( NAME: 'sk', ERAS: const <String>[ 'pred Kr.', 'po Kr.', ], ERANAMES: const <String>[ 'pred Kristom', 'po Kristovi', ], NARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], STANDALONENARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], MONTHS: const <String>[ 'januára', 'februára', 'marca', 'apríla', 'mája', 'júna', 'júla', 'augusta', 'septembra', 'októbra', 'novembra', 'decembra', ], STANDALONEMONTHS: const <String>[ 'január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december', ], SHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec', ], STANDALONESHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec', ], WEEKDAYS: const <String>[ 'nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota', ], STANDALONEWEEKDAYS: const <String>[ 'nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota', ], SHORTWEEKDAYS: const <String>[ 'ne', 'po', 'ut', 'st', 'št', 'pi', 'so', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ne', 'po', 'ut', 'st', 'št', 'pi', 'so', ], NARROWWEEKDAYS: const <String>[ 'n', 'p', 'u', 's', 'š', 'p', 's', ], STANDALONENARROWWEEKDAYS: const <String>[ 'n', 'p', 'u', 's', 'š', 'p', 's', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '1. štvrťrok', '2. štvrťrok', '3. štvrťrok', '4. štvrťrok', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE d. MMMM y', 'd. MMMM y', 'd. M. y', 'd. M. y', ], TIMEFORMATS: const <String>[ 'H:mm:ss zzzz', 'H:mm:ss z', 'H:mm:ss', 'H:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1} {0}', ], ), 'sl': intl.DateSymbols( NAME: 'sl', ERAS: const <String>[ 'pr. Kr.', 'po Kr.', ], ERANAMES: const <String>[ 'pred Kristusom', 'po Kristusu', ], NARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], STANDALONENARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], MONTHS: const <String>[ 'januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december', ], STANDALONEMONTHS: const <String>[ 'januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota', ], STANDALONEWEEKDAYS: const <String>[ 'nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota', ], SHORTWEEKDAYS: const <String>[ 'ned.', 'pon.', 'tor.', 'sre.', 'čet.', 'pet.', 'sob.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ned.', 'pon.', 'tor.', 'sre.', 'čet.', 'pet.', 'sob.', ], NARROWWEEKDAYS: const <String>[ 'n', 'p', 't', 's', 'č', 'p', 's', ], STANDALONENARROWWEEKDAYS: const <String>[ 'n', 'p', 't', 's', 'č', 'p', 's', ], SHORTQUARTERS: const <String>[ '1. čet.', '2. čet.', '3. čet.', '4. čet.', ], QUARTERS: const <String>[ '1. četrtletje', '2. četrtletje', '3. četrtletje', '4. četrtletje', ], AMPMS: const <String>[ 'dop.', 'pop.', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y', 'd. MMMM y', 'd. MMM y', 'd. MM. yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1}, {0}', '{1}, {0}', ], ), 'sq': intl.DateSymbols( NAME: 'sq', ERAS: const <String>[ 'p.K.', 'mb.K.', ], ERANAMES: const <String>[ 'para Krishtit', 'mbas Krishtit', ], NARROWMONTHS: const <String>[ 'j', 'sh', 'm', 'p', 'm', 'q', 'k', 'g', 'sh', 't', 'n', 'dh', ], STANDALONENARROWMONTHS: const <String>[ 'j', 'sh', 'm', 'p', 'm', 'q', 'k', 'g', 'sh', 't', 'n', 'dh', ], MONTHS: const <String>[ 'janar', 'shkurt', 'mars', 'prill', 'maj', 'qershor', 'korrik', 'gusht', 'shtator', 'tetor', 'nëntor', 'dhjetor', ], STANDALONEMONTHS: const <String>[ 'janar', 'shkurt', 'mars', 'prill', 'maj', 'qershor', 'korrik', 'gusht', 'shtator', 'tetor', 'nëntor', 'dhjetor', ], SHORTMONTHS: const <String>[ 'jan', 'shk', 'mar', 'pri', 'maj', 'qer', 'korr', 'gush', 'sht', 'tet', 'nën', 'dhj', ], STANDALONESHORTMONTHS: const <String>[ 'jan', 'shk', 'mar', 'pri', 'maj', 'qer', 'korr', 'gush', 'sht', 'tet', 'nën', 'dhj', ], WEEKDAYS: const <String>[ 'e diel', 'e hënë', 'e martë', 'e mërkurë', 'e enjte', 'e premte', 'e shtunë', ], STANDALONEWEEKDAYS: const <String>[ 'e diel', 'e hënë', 'e martë', 'e mërkurë', 'e enjte', 'e premte', 'e shtunë', ], SHORTWEEKDAYS: const <String>[ 'Die', 'Hën', 'Mar', 'Mër', 'Enj', 'Pre', 'Sht', ], STANDALONESHORTWEEKDAYS: const <String>[ 'die', 'hën', 'mar', 'mër', 'enj', 'pre', 'sht', ], NARROWWEEKDAYS: const <String>[ 'd', 'h', 'm', 'm', 'e', 'p', 'sh', ], STANDALONENARROWWEEKDAYS: const <String>[ 'd', 'h', 'm', 'm', 'e', 'p', 'sh', ], SHORTQUARTERS: const <String>[ 'tremujori I', 'tremujori II', 'tremujori III', 'tremujori IV', ], QUARTERS: const <String>[ 'tremujori i parë', 'tremujori i dytë', 'tremujori i tretë', 'tremujori i katërt', ], AMPMS: const <String>[ 'e paradites', 'e pasdites', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'd.M.yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a, zzzz', 'h:mm:ss a, z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'në' {0}", "{1} 'në' {0}", '{1}, {0}', '{1}, {0}', ], ), 'sr': intl.DateSymbols( NAME: 'sr', ERAS: const <String>[ 'п. н. е.', 'н. е.', ], ERANAMES: const <String>[ 'пре нове ере', 'нове ере', ], NARROWMONTHS: const <String>[ 'ј', 'ф', 'м', 'а', 'м', 'ј', 'ј', 'а', 'с', 'о', 'н', 'д', ], STANDALONENARROWMONTHS: const <String>[ 'ј', 'ф', 'м', 'а', 'м', 'ј', 'ј', 'а', 'с', 'о', 'н', 'д', ], MONTHS: const <String>[ 'јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар', ], STANDALONEMONTHS: const <String>[ 'јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар', ], SHORTMONTHS: const <String>[ 'јан', 'феб', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'нов', 'дец', ], STANDALONESHORTMONTHS: const <String>[ 'јан', 'феб', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'нов', 'дец', ], WEEKDAYS: const <String>[ 'недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота', ], STANDALONEWEEKDAYS: const <String>[ 'недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота', ], SHORTWEEKDAYS: const <String>[ 'нед', 'пон', 'уто', 'сре', 'чет', 'пет', 'суб', ], STANDALONESHORTWEEKDAYS: const <String>[ 'нед', 'пон', 'уто', 'сре', 'чет', 'пет', 'суб', ], NARROWWEEKDAYS: const <String>[ 'н', 'п', 'у', 'с', 'ч', 'п', 'с', ], STANDALONENARROWWEEKDAYS: const <String>[ 'н', 'п', 'у', 'с', 'ч', 'п', 'с', ], SHORTQUARTERS: const <String>[ '1. кв.', '2. кв.', '3. кв.', '4. кв.', ], QUARTERS: const <String>[ 'први квартал', 'други квартал', 'трећи квартал', 'четврти квартал', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y.', 'd. MMMM y.', 'd. M. y.', 'd.M.yy.', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'sr_Latn': intl.DateSymbols( NAME: 'sr_Latn', ERAS: const <String>[ 'p. n. e.', 'n. e.', ], ERANAMES: const <String>[ 'pre nove ere', 'nove ere', ], NARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], STANDALONENARROWMONTHS: const <String>[ 'j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd', ], MONTHS: const <String>[ 'januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar', ], STANDALONEMONTHS: const <String>[ 'januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar', ], SHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec', ], STANDALONESHORTMONTHS: const <String>[ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec', ], WEEKDAYS: const <String>[ 'nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota', ], STANDALONEWEEKDAYS: const <String>[ 'nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota', ], SHORTWEEKDAYS: const <String>[ 'ned', 'pon', 'uto', 'sre', 'čet', 'pet', 'sub', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ned', 'pon', 'uto', 'sre', 'čet', 'pet', 'sub', ], NARROWWEEKDAYS: const <String>[ 'n', 'p', 'u', 's', 'č', 'p', 's', ], STANDALONENARROWWEEKDAYS: const <String>[ 'n', 'p', 'u', 's', 'č', 'p', 's', ], SHORTQUARTERS: const <String>[ '1. kv.', '2. kv.', '3. kv.', '4. kv.', ], QUARTERS: const <String>[ 'prvi kvartal', 'drugi kvartal', 'treći kvartal', 'četvrti kvartal', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d. MMMM y.', 'd. MMMM y.', 'd. M. y.', 'd.M.yy.', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'sv': intl.DateSymbols( NAME: 'sv', ERAS: const <String>[ 'f.Kr.', 'e.Kr.', ], ERANAMES: const <String>[ 'före Kristus', 'efter Kristus', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december', ], STANDALONEMONTHS: const <String>[ 'januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december', ], SHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mars', 'apr.', 'maj', 'juni', 'juli', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.', ], STANDALONESHORTMONTHS: const <String>[ 'jan.', 'feb.', 'mars', 'apr.', 'maj', 'juni', 'juli', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.', ], WEEKDAYS: const <String>[ 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag', ], STANDALONEWEEKDAYS: const <String>[ 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag', ], SHORTWEEKDAYS: const <String>[ 'sön', 'mån', 'tis', 'ons', 'tors', 'fre', 'lör', ], STANDALONESHORTWEEKDAYS: const <String>[ 'sön', 'mån', 'tis', 'ons', 'tors', 'fre', 'lör', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'O', 'T', 'F', 'L', ], SHORTQUARTERS: const <String>[ 'K1', 'K2', 'K3', 'K4', ], QUARTERS: const <String>[ '1:a kvartalet', '2:a kvartalet', '3:e kvartalet', '4:e kvartalet', ], AMPMS: const <String>[ 'fm', 'em', ], DATEFORMATS: const <String>[ 'EEEE d MMMM y', 'd MMMM y', 'd MMM y', 'y-MM-dd', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 3, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'sw': intl.DateSymbols( NAME: 'sw', ERAS: const <String>[ 'KK', 'BK', ], ERANAMES: const <String>[ 'Kabla ya Kristo', 'Baada ya Kristo', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba', ], STANDALONEMONTHS: const <String>[ 'Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des', ], WEEKDAYS: const <String>[ 'Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi', ], STANDALONEWEEKDAYS: const <String>[ 'Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi', ], SHORTWEEKDAYS: const <String>[ 'Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'Robo ya 1', 'Robo ya 2', 'Robo ya 3', 'Robo ya 4', ], QUARTERS: const <String>[ 'Robo ya 1', 'Robo ya 2', 'Robo ya 3', 'Robo ya 4', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM y', 'd MMMM y', 'd MMM y', 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'ta': intl.DateSymbols( NAME: 'ta', ERAS: const <String>[ 'கி.மு.', 'கி.பி.', ], ERANAMES: const <String>[ 'கிறிஸ்துவுக்கு முன்', 'அன்னோ டோமினி', ], NARROWMONTHS: const <String>[ 'ஜ', 'பி', 'மா', 'ஏ', 'மே', 'ஜூ', 'ஜூ', 'ஆ', 'செ', 'அ', 'ந', 'டி', ], STANDALONENARROWMONTHS: const <String>[ 'ஜ', 'பி', 'மா', 'ஏ', 'மே', 'ஜூ', 'ஜூ', 'ஆ', 'செ', 'அ', 'ந', 'டி', ], MONTHS: const <String>[ 'ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்', ], STANDALONEMONTHS: const <String>[ 'ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்', ], SHORTMONTHS: const <String>[ 'ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.', ], STANDALONESHORTMONTHS: const <String>[ 'ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.', ], WEEKDAYS: const <String>[ 'ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி', ], STANDALONEWEEKDAYS: const <String>[ 'ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி', ], SHORTWEEKDAYS: const <String>[ 'ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி', ], NARROWWEEKDAYS: const <String>[ 'ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச', ], SHORTQUARTERS: const <String>[ 'காலா.1', 'காலா.2', 'காலா.3', 'காலா.4', ], QUARTERS: const <String>[ 'ஒன்றாம் காலாண்டு', 'இரண்டாம் காலாண்டு', 'மூன்றாம் காலாண்டு', 'நான்காம் காலாண்டு', ], AMPMS: const <String>[ 'முற்பகல்', 'பிற்பகல்', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM, y', 'd MMM, y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'a h:mm:ss zzzz', 'a h:mm:ss z', 'a h:mm:ss', 'a h:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} அன்று {0}', '{1} அன்று {0}', '{1}, {0}', '{1}, {0}', ], ), 'te': intl.DateSymbols( NAME: 'te', ERAS: const <String>[ 'క్రీపూ', 'క్రీశ', ], ERANAMES: const <String>[ 'క్రీస్తు పూర్వం', 'క్రీస్తు శకం', ], NARROWMONTHS: const <String>[ 'జ', 'ఫి', 'మా', 'ఏ', 'మే', 'జూ', 'జు', 'ఆ', 'సె', 'అ', 'న', 'డి', ], STANDALONENARROWMONTHS: const <String>[ 'జ', 'ఫి', 'మా', 'ఏ', 'మే', 'జూ', 'జు', 'ఆ', 'సె', 'అ', 'న', 'డి', ], MONTHS: const <String>[ 'జనవరి', 'ఫిబ్రవరి', 'మార్చి', 'ఏప్రిల్', 'మే', 'జూన్', 'జులై', 'ఆగస్టు', 'సెప్టెంబర్', 'అక్టోబర్', 'నవంబర్', 'డిసెంబర్', ], STANDALONEMONTHS: const <String>[ 'జనవరి', 'ఫిబ్రవరి', 'మార్చి', 'ఏప్రిల్', 'మే', 'జూన్', 'జులై', 'ఆగస్టు', 'సెప్టెంబర్', 'అక్టోబర్', 'నవంబర్', 'డిసెంబర్', ], SHORTMONTHS: const <String>[ 'జన', 'ఫిబ్ర', 'మార్చి', 'ఏప్రి', 'మే', 'జూన్', 'జులై', 'ఆగ', 'సెప్టెం', 'అక్టో', 'నవం', 'డిసెం', ], STANDALONESHORTMONTHS: const <String>[ 'జన', 'ఫిబ్ర', 'మార్చి', 'ఏప్రి', 'మే', 'జూన్', 'జులై', 'ఆగ', 'సెప్టెం', 'అక్టో', 'నవం', 'డిసెం', ], WEEKDAYS: const <String>[ 'ఆదివారం', 'సోమవారం', 'మంగళవారం', 'బుధవారం', 'గురువారం', 'శుక్రవారం', 'శనివారం', ], STANDALONEWEEKDAYS: const <String>[ 'ఆదివారం', 'సోమవారం', 'మంగళవారం', 'బుధవారం', 'గురువారం', 'శుక్రవారం', 'శనివారం', ], SHORTWEEKDAYS: const <String>[ 'ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని', ], STANDALONESHORTWEEKDAYS: const <String>[ 'ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని', ], NARROWWEEKDAYS: const <String>[ 'ఆ', 'సో', 'మ', 'బు', 'గు', 'శు', 'శ', ], STANDALONENARROWWEEKDAYS: const <String>[ 'ఆ', 'సో', 'మ', 'బు', 'గు', 'శు', 'శ', ], SHORTQUARTERS: const <String>[ 'త్రై1', 'త్రై2', 'త్రై3', 'త్రై4', ], QUARTERS: const <String>[ '1వ త్రైమాసికం', '2వ త్రైమాసికం', '3వ త్రైమాసికం', '4వ త్రైమాసికం', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'd, MMMM y, EEEE', 'd MMMM, y', 'd MMM, y', 'dd-MM-yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 6, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}కి', '{1} {0}కి', '{1} {0}', '{1} {0}', ], ), 'th': intl.DateSymbols( NAME: 'th', ERAS: const <String>[ 'ก่อน ค.ศ.', 'ค.ศ.', ], ERANAMES: const <String>[ 'ปีก่อนคริสตกาล', 'คริสต์ศักราช', ], NARROWMONTHS: const <String>[ 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.', ], STANDALONENARROWMONTHS: const <String>[ 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.', ], MONTHS: const <String>[ 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม', ], STANDALONEMONTHS: const <String>[ 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม', ], SHORTMONTHS: const <String>[ 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.', ], STANDALONESHORTMONTHS: const <String>[ 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.', ], WEEKDAYS: const <String>[ 'วันอาทิตย์', 'วันจันทร์', 'วันอังคาร', 'วันพุธ', 'วันพฤหัสบดี', 'วันศุกร์', 'วันเสาร์', ], STANDALONEWEEKDAYS: const <String>[ 'วันอาทิตย์', 'วันจันทร์', 'วันอังคาร', 'วันพุธ', 'วันพฤหัสบดี', 'วันศุกร์', 'วันเสาร์', ], SHORTWEEKDAYS: const <String>[ 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.', ], STANDALONESHORTWEEKDAYS: const <String>[ 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.', ], NARROWWEEKDAYS: const <String>[ 'อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส', ], STANDALONENARROWWEEKDAYS: const <String>[ 'อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส', ], SHORTQUARTERS: const <String>[ 'ไตรมาส 1', 'ไตรมาส 2', 'ไตรมาส 3', 'ไตรมาส 4', ], QUARTERS: const <String>[ 'ไตรมาส 1', 'ไตรมาส 2', 'ไตรมาส 3', 'ไตรมาส 4', ], AMPMS: const <String>[ 'ก่อนเที่ยง', 'หลังเที่ยง', ], DATEFORMATS: const <String>[ 'EEEEที่ d MMMM G y', 'd MMMM G y', 'd MMM y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'H นาฬิกา mm นาที ss วินาที zzzz', 'H นาฬิกา mm นาที ss วินาที z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'tl': intl.DateSymbols( NAME: 'tl', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'Before Christ', 'Anno Domini', ], NARROWMONTHS: const <String>[ 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], STANDALONENARROWMONTHS: const <String>[ 'E', 'P', 'M', 'A', 'M', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], MONTHS: const <String>[ 'Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre', ], STANDALONEMONTHS: const <String>[ 'Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre', ], SHORTMONTHS: const <String>[ 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], STANDALONESHORTMONTHS: const <String>[ 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis', ], WEEKDAYS: const <String>[ 'Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado', ], STANDALONEWEEKDAYS: const <String>[ 'Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado', ], SHORTWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], NARROWWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ 'ika-1 quarter', 'ika-2 quarter', 'ika-3 quarter', 'ika-4 na quarter', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'M/d/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ "{1} 'nang' {0}", "{1} 'nang' {0}", '{1}, {0}', '{1}, {0}', ], ), 'tr': intl.DateSymbols( NAME: 'tr', ERAS: const <String>[ 'MÖ', 'MS', ], ERANAMES: const <String>[ 'Milattan Önce', 'Milattan Sonra', ], NARROWMONTHS: const <String>[ 'O', 'Ş', 'M', 'N', 'M', 'H', 'T', 'A', 'E', 'E', 'K', 'A', ], STANDALONENARROWMONTHS: const <String>[ 'O', 'Ş', 'M', 'N', 'M', 'H', 'T', 'A', 'E', 'E', 'K', 'A', ], MONTHS: const <String>[ 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık', ], STANDALONEMONTHS: const <String>[ 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık', ], SHORTMONTHS: const <String>[ 'Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara', ], STANDALONESHORTMONTHS: const <String>[ 'Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara', ], WEEKDAYS: const <String>[ 'Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi', ], STANDALONEWEEKDAYS: const <String>[ 'Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi', ], SHORTWEEKDAYS: const <String>[ 'Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt', ], NARROWWEEKDAYS: const <String>[ 'P', 'P', 'S', 'Ç', 'P', 'C', 'C', ], STANDALONENARROWWEEKDAYS: const <String>[ 'P', 'P', 'S', 'Ç', 'P', 'C', 'C', ], SHORTQUARTERS: const <String>[ 'Ç1', 'Ç2', 'Ç3', 'Ç4', ], QUARTERS: const <String>[ '1. çeyrek', '2. çeyrek', '3. çeyrek', '4. çeyrek', ], AMPMS: const <String>[ 'ÖÖ', 'ÖS', ], DATEFORMATS: const <String>[ 'd MMMM y EEEE', 'd MMMM y', 'd MMM y', 'd.MM.y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'uk': intl.DateSymbols( NAME: 'uk', ERAS: const <String>[ 'до н. е.', 'н. е.', ], ERANAMES: const <String>[ 'до нашої ери', 'нашої ери', ], NARROWMONTHS: const <String>[ 'с', 'л', 'б', 'к', 'т', 'ч', 'л', 'с', 'в', 'ж', 'л', 'г', ], STANDALONENARROWMONTHS: const <String>[ 'С', 'Л', 'Б', 'К', 'Т', 'Ч', 'Л', 'С', 'В', 'Ж', 'Л', 'Г', ], MONTHS: const <String>[ 'січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня', ], STANDALONEMONTHS: const <String>[ 'січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень', ], SHORTMONTHS: const <String>[ 'січ.', 'лют.', 'бер.', 'квіт.', 'трав.', 'черв.', 'лип.', 'серп.', 'вер.', 'жовт.', 'лист.', 'груд.', ], STANDALONESHORTMONTHS: const <String>[ 'січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру', ], WEEKDAYS: const <String>[ 'неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'пʼятниця', 'субота', ], STANDALONEWEEKDAYS: const <String>[ 'неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'пʼятниця', 'субота', ], SHORTWEEKDAYS: const <String>[ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', ], STANDALONESHORTWEEKDAYS: const <String>[ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', ], NARROWWEEKDAYS: const <String>[ 'Н', 'П', 'В', 'С', 'Ч', 'П', 'С', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Н', 'П', 'В', 'С', 'Ч', 'П', 'С', ], SHORTQUARTERS: const <String>[ '1-й кв.', '2-й кв.', '3-й кв.', '4-й кв.', ], QUARTERS: const <String>[ '1-й квартал', '2-й квартал', '3-й квартал', '4-й квартал', ], AMPMS: const <String>[ 'дп', 'пп', ], DATEFORMATS: const <String>[ "EEEE, d MMMM y 'р'.", "d MMMM y 'р'.", "d MMM y 'р'.", 'dd.MM.yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ "{1} 'о' {0}", "{1} 'о' {0}", '{1}, {0}', '{1}, {0}', ], ), 'ur': intl.DateSymbols( NAME: 'ur', ERAS: const <String>[ 'قبل مسیح', 'عیسوی', ], ERANAMES: const <String>[ 'قبل مسیح', 'عیسوی', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], STANDALONEMONTHS: const <String>[ 'جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], SHORTMONTHS: const <String>[ 'جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], STANDALONESHORTMONTHS: const <String>[ 'جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر', ], WEEKDAYS: const <String>[ 'اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ', ], STANDALONEWEEKDAYS: const <String>[ 'اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ', ], SHORTWEEKDAYS: const <String>[ 'اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ', ], STANDALONESHORTWEEKDAYS: const <String>[ 'اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'T', 'W', 'T', 'F', 'S', ], SHORTQUARTERS: const <String>[ 'پہلی سہ ماہی', 'دوسری سہ ماہی', 'تیسری سہ ماہی', 'چوتهی سہ ماہی', ], QUARTERS: const <String>[ 'پہلی سہ ماہی', 'دوسری سہ ماہی', 'تیسری سہ ماہی', 'چوتهی سہ ماہی', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE، d MMMM، y', 'd MMMM، y', 'd MMM، y', 'd/M/yy', ], TIMEFORMATS: const <String>[ 'h:mm:ss a zzzz', 'h:mm:ss a z', 'h:mm:ss a', 'h:mm a', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'uz': intl.DateSymbols( NAME: 'uz', ERAS: const <String>[ 'm.a.', 'milodiy', ], ERANAMES: const <String>[ 'miloddan avvalgi', 'milodiy', ], NARROWMONTHS: const <String>[ 'Y', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'Y', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avgust', 'sentabr', 'oktabr', 'noyabr', 'dekabr', ], STANDALONEMONTHS: const <String>[ 'Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr', ], SHORTMONTHS: const <String>[ 'yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avg', 'sen', 'okt', 'noy', 'dek', ], STANDALONESHORTMONTHS: const <String>[ 'Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyn', 'Iyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek', ], WEEKDAYS: const <String>[ 'yakshanba', 'dushanba', 'seshanba', 'chorshanba', 'payshanba', 'juma', 'shanba', ], STANDALONEWEEKDAYS: const <String>[ 'yakshanba', 'dushanba', 'seshanba', 'chorshanba', 'payshanba', 'juma', 'shanba', ], SHORTWEEKDAYS: const <String>[ 'Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan', ], NARROWWEEKDAYS: const <String>[ 'Y', 'D', 'S', 'C', 'P', 'J', 'S', ], STANDALONENARROWWEEKDAYS: const <String>[ 'Y', 'D', 'S', 'C', 'P', 'J', 'S', ], SHORTQUARTERS: const <String>[ '1-ch', '2-ch', '3-ch', '4-ch', ], QUARTERS: const <String>[ '1-chorak', '2-chorak', '3-chorak', '4-chorak', ], AMPMS: const <String>[ 'TO', 'TK', ], DATEFORMATS: const <String>[ 'EEEE, d-MMMM, y', 'd-MMMM, y', 'd-MMM, y', 'dd/MM/yy', ], TIMEFORMATS: const <String>[ 'H:mm:ss (zzzz)', 'H:mm:ss (z)', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{1}, {0}', '{1}, {0}', '{1}, {0}', '{1}, {0}', ], ), 'vi': intl.DateSymbols( NAME: 'vi', ERAS: const <String>[ 'Trước CN', 'Sau CN', ], ERANAMES: const <String>[ 'Trước Thiên Chúa', 'Sau Công Nguyên', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ 'tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12', ], STANDALONEMONTHS: const <String>[ 'Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12', ], SHORTMONTHS: const <String>[ 'thg 1', 'thg 2', 'thg 3', 'thg 4', 'thg 5', 'thg 6', 'thg 7', 'thg 8', 'thg 9', 'thg 10', 'thg 11', 'thg 12', ], STANDALONESHORTMONTHS: const <String>[ 'Thg 1', 'Thg 2', 'Thg 3', 'Thg 4', 'Thg 5', 'Thg 6', 'Thg 7', 'Thg 8', 'Thg 9', 'Thg 10', 'Thg 11', 'Thg 12', ], WEEKDAYS: const <String>[ 'Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy', ], STANDALONEWEEKDAYS: const <String>[ 'Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy', ], SHORTWEEKDAYS: const <String>[ 'CN', 'Th 2', 'Th 3', 'Th 4', 'Th 5', 'Th 6', 'Th 7', ], STANDALONESHORTWEEKDAYS: const <String>[ 'CN', 'Th 2', 'Th 3', 'Th 4', 'Th 5', 'Th 6', 'Th 7', ], NARROWWEEKDAYS: const <String>[ 'CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', ], STANDALONENARROWWEEKDAYS: const <String>[ 'CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ 'Quý 1', 'Quý 2', 'Quý 3', 'Quý 4', ], AMPMS: const <String>[ 'SA', 'CH', ], DATEFORMATS: const <String>[ 'EEEE, d MMMM, y', 'd MMMM, y', 'd MMM, y', 'dd/MM/y', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 0, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 6, DATETIMEFORMATS: const <String>[ '{0} {1}', '{0} {1}', '{0}, {1}', '{0}, {1}', ], ), 'zh': intl.DateSymbols( NAME: 'zh', ERAS: const <String>[ '公元前', '公元', ], ERANAMES: const <String>[ '公元前', '公元', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月', ], STANDALONEMONTHS: const <String>[ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月', ], SHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONESHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], WEEKDAYS: const <String>[ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', ], STANDALONEWEEKDAYS: const <String>[ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', ], SHORTWEEKDAYS: const <String>[ '周日', '周一', '周二', '周三', '周四', '周五', '周六', ], STANDALONESHORTWEEKDAYS: const <String>[ '周日', '周一', '周二', '周三', '周四', '周五', '周六', ], NARROWWEEKDAYS: const <String>[ '日', '一', '二', '三', '四', '五', '六', ], STANDALONENARROWWEEKDAYS: const <String>[ '日', '一', '二', '三', '四', '五', '六', ], SHORTQUARTERS: const <String>[ '1季度', '2季度', '3季度', '4季度', ], QUARTERS: const <String>[ '第一季度', '第二季度', '第三季度', '第四季度', ], AMPMS: const <String>[ '上午', '下午', ], DATEFORMATS: const <String>[ 'y年M月d日EEEE', 'y年M月d日', 'y年M月d日', 'y/M/d', ], TIMEFORMATS: const <String>[ 'zzzz HH:mm:ss', 'z HH:mm:ss', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'zh_HK': intl.DateSymbols( NAME: 'zh_HK', ERAS: const <String>[ '公元前', '公元', ], ERANAMES: const <String>[ '公元前', '公元', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONEMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], SHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONESHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], WEEKDAYS: const <String>[ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', ], STANDALONEWEEKDAYS: const <String>[ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', ], SHORTWEEKDAYS: const <String>[ '週日', '週一', '週二', '週三', '週四', '週五', '週六', ], STANDALONESHORTWEEKDAYS: const <String>[ '週日', '週一', '週二', '週三', '週四', '週五', '週六', ], NARROWWEEKDAYS: const <String>[ '日', '一', '二', '三', '四', '五', '六', ], STANDALONENARROWWEEKDAYS: const <String>[ '日', '一', '二', '三', '四', '五', '六', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ '第1季', '第2季', '第3季', '第4季', ], AMPMS: const <String>[ '上午', '下午', ], DATEFORMATS: const <String>[ 'y年M月d日EEEE', 'y年M月d日', 'y年M月d日', 'd/M/y', ], TIMEFORMATS: const <String>[ 'ah:mm:ss [zzzz]', 'ah:mm:ss [z]', 'ah:mm:ss', 'ah:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'zh_TW': intl.DateSymbols( NAME: 'zh_TW', ERAS: const <String>[ '西元前', '西元', ], ERANAMES: const <String>[ '西元前', '西元', ], NARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], STANDALONENARROWMONTHS: const <String>[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ], MONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONEMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], SHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], STANDALONESHORTMONTHS: const <String>[ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ], WEEKDAYS: const <String>[ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', ], STANDALONEWEEKDAYS: const <String>[ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', ], SHORTWEEKDAYS: const <String>[ '週日', '週一', '週二', '週三', '週四', '週五', '週六', ], STANDALONESHORTWEEKDAYS: const <String>[ '週日', '週一', '週二', '週三', '週四', '週五', '週六', ], NARROWWEEKDAYS: const <String>[ '日', '一', '二', '三', '四', '五', '六', ], STANDALONENARROWWEEKDAYS: const <String>[ '日', '一', '二', '三', '四', '五', '六', ], SHORTQUARTERS: const <String>[ '第1季', '第2季', '第3季', '第4季', ], QUARTERS: const <String>[ '第1季', '第2季', '第3季', '第4季', ], AMPMS: const <String>[ '上午', '下午', ], DATEFORMATS: const <String>[ 'y年M月d日 EEEE', 'y年M月d日', 'y年M月d日', 'y/M/d', ], TIMEFORMATS: const <String>[ 'Bh:mm:ss [zzzz]', 'Bh:mm:ss [z]', 'Bh:mm:ss', 'Bh:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), 'zu': intl.DateSymbols( NAME: 'zu', ERAS: const <String>[ 'BC', 'AD', ], ERANAMES: const <String>[ 'BC', 'AD', ], NARROWMONTHS: const <String>[ 'J', 'F', 'M', 'E', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], STANDALONENARROWMONTHS: const <String>[ 'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D', ], MONTHS: const <String>[ 'Januwari', 'Februwari', 'Mashi', 'Ephreli', 'Meyi', 'Juni', 'Julayi', 'Agasti', 'Septhemba', 'Okthoba', 'Novemba', 'Disemba', ], STANDALONEMONTHS: const <String>[ 'Januwari', 'Februwari', 'Mashi', 'Ephreli', 'Meyi', 'Juni', 'Julayi', 'Agasti', 'Septhemba', 'Okthoba', 'Novemba', 'Disemba', ], SHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mas', 'Eph', 'Mey', 'Jun', 'Jul', 'Aga', 'Sep', 'Okt', 'Nov', 'Dis', ], STANDALONESHORTMONTHS: const <String>[ 'Jan', 'Feb', 'Mas', 'Eph', 'Mey', 'Jun', 'Jul', 'Aga', 'Sep', 'Okt', 'Nov', 'Dis', ], WEEKDAYS: const <String>[ 'ISonto', 'UMsombuluko', 'ULwesibili', 'ULwesithathu', 'ULwesine', 'ULwesihlanu', 'UMgqibelo', ], STANDALONEWEEKDAYS: const <String>[ 'ISonto', 'UMsombuluko', 'ULwesibili', 'ULwesithathu', 'ULwesine', 'ULwesihlanu', 'UMgqibelo', ], SHORTWEEKDAYS: const <String>[ 'Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq', ], STANDALONESHORTWEEKDAYS: const <String>[ 'Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq', ], NARROWWEEKDAYS: const <String>[ 'S', 'M', 'B', 'T', 'S', 'H', 'M', ], STANDALONENARROWWEEKDAYS: const <String>[ 'S', 'M', 'B', 'T', 'S', 'H', 'M', ], SHORTQUARTERS: const <String>[ 'Q1', 'Q2', 'Q3', 'Q4', ], QUARTERS: const <String>[ 'ikota yesi-1', 'ikota yesi-2', 'ikota yesi-3', 'ikota yesi-4', ], AMPMS: const <String>[ 'AM', 'PM', ], DATEFORMATS: const <String>[ 'EEEE, MMMM d, y', 'MMMM d, y', 'MMM d, y', 'M/d/yy', ], TIMEFORMATS: const <String>[ 'HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm', ], FIRSTDAYOFWEEK: 6, WEEKENDRANGE: const <int>[ 5, 6, ], FIRSTWEEKCUTOFFDAY: 5, DATETIMEFORMATS: const <String>[ '{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}', ], ), }; /// The subset of date patterns supported by the intl package which are also /// supported by flutter_localizations. const Map<String, Map<String, String>> datePatterns = <String, Map<String, String>>{ 'af': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd-MM', 'MEd': 'EEE d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM-y', 'yMd': 'y-MM-dd', 'yMEd': 'EEE y-MM-dd', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'am': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE፣ M/d', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE፣ MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE፣ MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE፣ d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE፣ MMM d y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'y MMMM d, EEEE', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ar': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/‏M', 'MEd': 'EEE، d/‏M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE، d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE، d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M‏/y', 'yMd': 'd‏/M‏/y', 'yMEd': 'EEE، d/‏M/‏y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE، d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE، d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'as': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd-MM', 'MEd': 'EEE, dd-MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM-y', 'yMd': 'dd-MM-y', 'yMEd': 'EEE, dd-MM-y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'a h', 'jm': 'a h:mm', 'jms': 'a h:mm:ss', 'jmv': 'a h:mm v', 'jmz': 'a h:mm z', 'jz': 'a h z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'az': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd.MM', 'MEd': 'dd.MM, EEE', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'd MMM, EEE', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'd MMMM, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd.MM.y', 'yMEd': 'dd.MM.y, EEE', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'd MMM y, EEE', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'd MMMM y, EEEE', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'be': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M', 'MEd': 'EEE, d.M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'LLL y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'LLLL y', 'yMMMMd': "d MMMM y 'г'.", 'yMMMMEEEEd': "EEEE, d MMMM y 'г'.", 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm.ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'bg': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.MM', 'MEd': 'EEE, d.MM', 'MMM': 'MM', 'MMMd': 'd.MM', 'MMMEd': 'EEE, d.MM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': "y 'г'.", 'yM': "MM.y 'г'.", 'yMd': "d.MM.y 'г'.", 'yMEd': "EEE, d.MM.y 'г'.", 'yMMM': "MM.y 'г'.", 'yMMMd': "d.MM.y 'г'.", 'yMMMEd': "EEE, d.MM.y 'г'.", 'yMMMM': "MMMM y 'г'.", 'yMMMMd': "d MMMM y 'г'.", 'yMMMMEEEEd': "EEEE, d MMMM y 'г'.", 'yQQQ': "QQQ y 'г'.", 'yQQQQ': "QQQQ y 'г'.", 'H': "HH 'ч'.", 'Hm': "HH:mm 'ч'.", 'Hms': "HH:mm:ss 'ч'.", 'j': "HH 'ч'.", 'jm': "HH:mm 'ч'.", 'jms': "HH:mm:ss 'ч'.", 'jmv': "HH:mm 'ч'. v", 'jmz': "HH:mm 'ч'. z", 'jz': "HH 'ч'. z", 'm': 'm', 'ms': 'm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'bn': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d-M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM, y', 'yMMMEd': 'EEE, d MMM, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'bs': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y.', 'yM': 'MM/y', 'yMd': 'd.M.y.', 'yMEd': 'EEE, d.M.y.', 'yMMM': 'MMM y.', 'yMMMd': 'd. MMM y.', 'yMMMEd': 'EEE, d. MMM y.', 'yMMMM': 'LLLL y.', 'yMMMMd': 'd. MMMM y.', 'yMMMMEEEEd': 'EEEE, d. MMMM y.', 'yQQQ': 'QQQ y.', 'yQQQQ': 'QQQQ y.', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm (v)', 'jmz': 'HH:mm (z)', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ca': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': "LLL 'de' y", 'yMMMd': "d MMM 'de' y", 'yMMMEd': 'EEE, d MMM y', 'yMMMM': "LLLL 'de' y", 'yMMMMd': "d MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d MMMM 'de' y", 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'H:mm v', 'jmz': 'H:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'cs': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd. M.', 'MEd': 'EEE d. M.', 'MMM': 'LLL', 'MMMd': 'd. M.', 'MMMEd': 'EEE d. M.', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd. M. y', 'yMEd': 'EEE d. M. y', 'yMMM': 'LLLL y', 'yMMMd': 'd. M. y', 'yMMMEd': 'EEE d. M. y', 'yMMMM': 'LLLL y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'H:mm v', 'jmz': 'H:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'cy': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'da': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'MMM', 'LLLL': 'MMMM', 'M': 'M', 'Md': 'd.M', 'MEd': 'EEE d.M', 'MMM': 'MMM', 'MMMd': 'd. MMM', 'MMMEd': 'EEE d. MMM', 'MMMM': 'MMMM', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': "EEEE 'den' d. MMMM y", 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH.mm', 'Hms': 'HH.mm.ss', 'j': 'HH', 'jm': 'HH.mm', 'jms': 'HH.mm.ss', 'jmv': 'HH.mm v', 'jmz': 'HH.mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm.ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'de': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE, d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE, d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': "HH 'Uhr'", 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': "HH 'Uhr'", 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': "HH 'Uhr' z", 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'de_CH': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE, d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE, d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': "HH 'Uhr'", 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': "HH 'Uhr'", 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': "HH 'Uhr' z", 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'el': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'MMM', 'LLLL': 'MMMM', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE d/M', 'MMM': 'MMM', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'MMMM', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'LLLL y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE, M/d', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'M/d/y', 'yMEd': 'EEE, M/d/y', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_AU': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_CA': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'MM-dd', 'MEd': 'EEE, MM-dd', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'y-MM-dd', 'yMEd': 'EEE, y-MM-dd', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_GB': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd/MM', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_IE': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_IN': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd/MM', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_NZ': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_SG': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd/MM', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_US': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE, M/d', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'M/d/y', 'yMEd': 'EEE, M/d/y', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'en_ZA': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'MM/dd', 'MEd': 'EEE, MM/dd', 'MMM': 'LLL', 'MMMd': 'dd MMM', 'MMMEd': 'EEE, dd MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, dd MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'y/MM/dd', 'yMEd': 'EEE, y/MM/dd', 'yMMM': 'MMM y', 'yMMMd': 'dd MMM y', 'yMMMEd': 'EEE, dd MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'es': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "EEEE, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': 'QQQ y', 'yQQQQ': "QQQQ 'de' y", 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'H:mm v', 'jmz': 'H:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'es_419': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "EEEE, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': "QQQ 'de' y", 'yQQQQ': "QQQQ 'de' y", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'es_MX': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': "EEE d 'de' MMM", 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "EEEE, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': "EEE, d 'de' MMM 'de' y", 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': 'QQQ y', 'yQQQQ': "QQQQ 'de' y", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'es_US': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': "EEE, d 'de' MMM", 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "EEEE, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': "EEE, d 'de' MMM 'de' y", 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': 'QQQ y', 'yQQQQ': "QQQQ 'de' y", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'et': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'MMMM', 'LLLL': 'MMMM', 'M': 'M', 'Md': 'd.M', 'MEd': 'EEE, d.M', 'MMM': 'MMMM', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'MMMM', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE, d. MMMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE, d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'eu': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'M/d, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'MMM d, EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'MMMM d, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y/M', 'yMd': 'y/M/d', 'yMEd': 'y/M/d, EEE', 'yMMM': 'y MMM', 'yMMMd': 'y MMM d', 'yMMMEd': 'y MMM d, EEE', 'yMMMM': "y('e')'ko' MMMM", 'yMMMMd': "y('e')'ko' MMMM'ren' d", 'yMMMMEEEEd': "y('e')'ko' MMMM'ren' d('a'), EEEE", 'yQQQ': "y('e')'ko' QQQ", 'yQQQQ': "y('e')'ko' QQQQ", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH (z)', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'fa': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE M/d', 'MMM': 'LLL', 'MMMd': 'd LLL', 'MMMEd': 'EEE d LLL', 'MMMM': 'LLLL', 'MMMMd': 'd LLLL', 'MMMMEEEEd': 'EEEE d LLLL', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y/M', 'yMd': 'y/M/d', 'yMEd': 'EEE y/M/d', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'H:mm v', 'jmz': 'HH:mm (z)', 'jz': 'H (z)', 'm': 'm', 'ms': 'm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'fi': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'ccc d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'cccc d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'L.y', 'yMd': 'd.M.y', 'yMEd': 'EEE d.M.y', 'yMMM': 'LLL y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE d. MMM y', 'yMMMM': 'LLLL y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'H.mm', 'Hms': 'H.mm.ss', 'j': 'H', 'jm': 'H.mm', 'jms': 'H.mm.ss', 'jmv': 'H.mm v', 'jmz': 'H.mm z', 'jz': 'H z', 'm': 'm', 'ms': 'm.ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'fil': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE, M/d', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'M/d/y', 'yMEd': 'EEE, M/d/y', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'fr': <String, String>{ 'd': 'd', 'E': 'EEE', 'EEEE': 'EEEE', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd/MM', 'MEd': 'EEE dd/MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE dd/MM/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': "HH 'h'", 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': "HH 'h'", 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': "HH 'h' z", 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'fr_CA': <String, String>{ 'd': 'd', 'E': 'EEE', 'EEEE': 'EEEE', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M-d', 'MEd': 'EEE M-d', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-MM-dd', 'yMEd': 'EEE y-MM-dd', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': "HH 'h'", 'Hm': "HH 'h' mm", 'Hms': "HH 'h' mm 'min' ss 's'", 'j': "HH 'h'", 'jm': "HH 'h' mm", 'jms': "HH 'h' mm 'min' ss 's'", 'jmv': "HH 'h' mm v", 'jmz': "HH 'h' mm z", 'jz': "HH 'h' z", 'm': 'm', 'ms': "mm 'min' ss 's'", 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'gl': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': "d 'de' MMM", 'MMMEd': "EEE, d 'de' MMM", 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "EEEE, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': "MMM 'de' y", 'yMMMd': "d 'de' MMM 'de' y", 'yMMMEd': "EEE, d 'de' MMM 'de' y", 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': 'QQQ y', 'yQQQQ': "QQQQ 'de' y", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'gsw': <String, String>{ 'd': 'd', 'E': 'EEE', 'EEEE': 'EEEE', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-M', 'yMd': 'd.M.y', 'yMEd': 'EEE, y-M-d', 'yMMM': 'MMM y', 'yMMMd': 'y MMM d', 'yMMMEd': 'EEE, d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE, d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'H', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'gu': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM, y', 'yMMMEd': 'EEE, d MMM, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'he': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M', 'MEd': 'EEE, d.M', 'MMM': 'LLL', 'MMMd': 'd בMMM', 'MMMEd': 'EEE, d בMMM', 'MMMM': 'LLLL', 'MMMMd': 'd בMMMM', 'MMMMEEEEd': 'EEEE, d בMMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd בMMM y', 'yMMMEd': 'EEE, d בMMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd בMMMM y', 'yMMMMEEEEd': 'EEEE, d בMMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'hi': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'hr': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L.', 'Md': 'dd. MM.', 'MEd': 'EEE, dd. MM.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y.', 'yM': 'MM. y.', 'yMd': 'dd. MM. y.', 'yMEd': 'EEE, dd. MM. y.', 'yMMM': 'LLL y.', 'yMMMd': 'd. MMM y.', 'yMMMEd': 'EEE, d. MMM y.', 'yMMMM': 'LLLL y.', 'yMMMMd': 'd. MMMM y.', 'yMMMMEEEEd': 'EEEE, d. MMMM y.', 'yQQQ': 'QQQ y.', 'yQQQQ': 'QQQQ y.', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH (z)', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'hu': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M. d.', 'MEd': 'M. d., EEE', 'MMM': 'LLL', 'MMMd': 'MMM d.', 'MMMEd': 'MMM d., EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d.', 'MMMMEEEEd': 'MMMM d., EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y.', 'yM': 'y. M.', 'yMd': 'y. MM. dd.', 'yMEd': 'y. MM. dd., EEE', 'yMMM': 'y. MMM', 'yMMMd': 'y. MMM d.', 'yMMMEd': 'y. MMM d., EEE', 'yMMMM': 'y. MMMM', 'yMMMMd': 'y. MMMM d.', 'yMMMMEEEEd': 'y. MMMM d., EEEE', 'yQQQ': 'y. QQQ', 'yQQQQ': 'y. QQQQ', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'hy': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd.MM', 'MEd': 'dd.MM, EEE', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'd MMM, EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'd MMMM, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd.MM.y', 'yMEd': 'd.MM.y թ., EEE', 'yMMM': 'y թ. LLL', 'yMMMd': 'd MMM, y թ.', 'yMMMEd': 'y թ. MMM d, EEE', 'yMMMM': 'y թ․ LLLL', 'yMMMMd': 'd MMMM, y թ.', 'yMMMMEEEEd': 'y թ. MMMM d, EEEE', 'yQQQ': 'y թ. QQQ', 'yQQQQ': 'y թ. QQQQ', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'id': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH.mm', 'Hms': 'HH.mm.ss', 'j': 'HH', 'jm': 'HH.mm', 'jms': 'HH.mm.ss', 'jmv': 'HH.mm v', 'jmz': 'HH.mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm.ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'is': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M. y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE, d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE, d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'v – HH:mm', 'jmz': 'z – HH:mm', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'it': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ja': <String, String>{ 'd': 'd日', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'M月', 'LLLL': 'M月', 'M': 'M月', 'Md': 'M/d', 'MEd': 'M/d(EEE)', 'MMM': 'M月', 'MMMd': 'M月d日', 'MMMEd': 'M月d日(EEE)', 'MMMM': 'M月', 'MMMMd': 'M月d日', 'MMMMEEEEd': 'M月d日EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y年', 'yM': 'y/M', 'yMd': 'y/M/d', 'yMEd': 'y/M/d(EEE)', 'yMMM': 'y年M月', 'yMMMd': 'y年M月d日', 'yMMMEd': 'y年M月d日(EEE)', 'yMMMM': 'y年M月', 'yMMMMd': 'y年M月d日', 'yMMMMEEEEd': 'y年M月d日EEEE', 'yQQQ': 'y/QQQ', 'yQQQQ': 'y年QQQQ', 'H': 'H時', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H時', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'H:mm v', 'jmz': 'H:mm z', 'jz': 'H時 z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ka': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M', 'MEd': 'EEE, d.M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM. y', 'yMMMd': 'd MMM. y', 'yMMMEd': 'EEE, d MMM. y', 'yMMMM': 'MMMM, y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ, y', 'yQQQQ': 'QQQQ, y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'kk': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd.MM', 'MEd': 'dd.MM, EEE', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'd MMM, EEE', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'd MMMM, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd.MM.y', 'yMEd': 'dd.MM.y, EEE', 'yMMM': "y 'ж'. MMM", 'yMMMd': "y 'ж'. d MMM", 'yMMMEd': "y 'ж'. d MMM, EEE", 'yMMMM': "y 'ж'. MMMM", 'yMMMMd': "y 'ж'. d MMMM", 'yMMMMEEEEd': "y 'ж'. d MMMM, EEEE", 'yQQQ': "y 'ж'. QQQ", 'yQQQQ': "y 'ж'. QQQQ", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'km': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'kn': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'd/M, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, M/d/y', 'yMMM': 'MMM y', 'yMMMd': 'MMM d,y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ko': <String, String>{ 'd': 'd일', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'M월', 'Md': 'M. d.', 'MEd': 'M. d. (EEE)', 'MMM': 'LLL', 'MMMd': 'MMM d일', 'MMMEd': 'MMM d일 (EEE)', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d일', 'MMMMEEEEd': 'MMMM d일 EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y년', 'yM': 'y. M.', 'yMd': 'y. M. d.', 'yMEd': 'y. M. d. (EEE)', 'yMMM': 'y년 MMM', 'yMMMd': 'y년 MMM d일', 'yMMMEd': 'y년 MMM d일 (EEE)', 'yMMMM': 'y년 MMMM', 'yMMMMd': 'y년 MMMM d일', 'yMMMMEEEEd': 'y년 MMMM d일 EEEE', 'yQQQ': 'y년 QQQ', 'yQQQQ': 'y년 QQQQ', 'H': 'H시', 'Hm': 'HH:mm', 'Hms': 'H시 m분 s초', 'j': 'a h시', 'jm': 'a h:mm', 'jms': 'a h:mm:ss', 'jmv': 'a h:mm v', 'jmz': 'a h:mm z', 'jz': 'a h시 z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ky': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd-MM', 'MEd': 'dd-MM, EEE', 'MMM': 'LLL', 'MMMd': 'd-MMM', 'MMMEd': 'd-MMM, EEE', 'MMMM': 'LLLL', 'MMMMd': 'd-MMMM', 'MMMMEEEEd': 'd-MMMM, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-dd-MM', 'yMEd': 'y-dd-MM, EEE', 'yMMM': "y-'ж'. MMM", 'yMMMd': "y-'ж'. d-MMM", 'yMMMEd': "y-'ж'. d-MMM, EEE", 'yMMMM': "y-'ж'., MMMM", 'yMMMMd': "y-'ж'., d-MMMM", 'yMMMMEEEEd': "y-'ж'., d-MMMM, EEEE", 'yQQQ': "y-'ж'., QQQ", 'yQQQQ': "y-'ж'., QQQQ", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'lo': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'lt': <String, String>{ 'd': 'dd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'MM', 'Md': 'MM-d', 'MEd': 'MM-dd, EEE', 'MMM': 'MM', 'MMMd': 'MM-dd', 'MMMEd': 'MM-dd, EEE', 'MMMM': 'LLLL', 'MMMMd': "MMMM d 'd'.", 'MMMMEEEEd': "MMMM d 'd'., EEEE", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-MM-dd', 'yMEd': 'y-MM-dd, EEE', 'yMMM': 'y-MM', 'yMMMd': 'y-MM-dd', 'yMMMEd': 'y-MM-dd, EEE', 'yMMMM': "y 'm'. LLLL", 'yMMMMd': "y 'm'. MMMM d 'd'.", 'yMMMMEEEEd': "y 'm'. MMMM d 'd'., EEEE", 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm; v', 'jmz': 'HH:mm; z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'lv': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd.MM.', 'MEd': 'EEE, dd.MM.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': "y. 'g'.", 'yM': 'MM.y.', 'yMd': 'd.MM.y.', 'yMEd': 'EEE, d.M.y.', 'yMMM': "y. 'g'. MMM", 'yMMMd': "y. 'g'. d. MMM", 'yMMMEd': "EEE, y. 'g'. d. MMM", 'yMMMM': "y. 'g'. MMMM", 'yMMMMd': "y. 'gada' d. MMMM", 'yMMMMEEEEd': "EEEE, y. 'gada' d. MMMM", 'yQQQ': "y. 'g'. QQQ", 'yQQQQ': "y. 'g'. QQQQ", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'mk': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M', 'MEd': 'EEE, d.M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': "MMM y 'г'.", 'yMMMd': "d MMM y 'г'.", 'yMMMEd': "EEE, d MMM y 'г'.", 'yMMMM': "MMMM y 'г'.", 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': "QQQ y 'г'.", 'yQQQQ': "QQQQ y 'г'.", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ml': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'd/M, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'MMM d, EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'MMMM d, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'd/M/y', 'yMEd': 'd-M-y, EEE', 'yMMM': 'y MMM', 'yMMMd': 'y MMM d', 'yMMMEd': 'y MMM d, EEE', 'yMMMM': 'y MMMM', 'yMMMMd': 'y, MMMM d', 'yMMMMEEEEd': 'y, MMMM d, EEEE', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'mn': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'LLLLL', 'Md': 'MMMMM/dd', 'MEd': 'MMMMM/dd. EEE', 'MMM': 'LLL', 'MMMd': "MMM'ын' d", 'MMMEd': "MMM'ын' d. EEE", 'MMMM': 'LLLL', 'MMMMd': "MMMM'ын' d", 'MMMMEEEEd': "MMMM'ын' d. EEEE", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y MMMMM', 'yMd': 'y.MM.dd', 'yMEd': 'y.MM.dd. EEE', 'yMMM': "y 'оны' MMM", 'yMMMd': "y 'оны' MMM'ын' d", 'yMMMEd': "y 'оны' MMM'ын' d. EEE", 'yMMMM': "y 'оны' MMMM", 'yMMMMd': "y 'оны' MMMM'ын' d", 'yMMMMEEEEd': "y 'оны' MMMM'ын' d, EEEE 'гараг'", 'yQQQ': "y 'оны' QQQ", 'yQQQQ': "y 'оны' QQQQ", 'H': "HH 'ц'", 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': "HH 'ц'", 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm (v)', 'jmz': 'HH:mm (z)', 'jz': "HH 'ц' (z)", 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'mr': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM, y', 'yMMMEd': 'EEE, d, MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ms': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd-M', 'MEd': 'EEE, d-M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M-y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'my': <String, String>{ 'd': 'd', 'E': 'cccနေ့', 'EEEE': 'ccccနေ့', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'd-M- EEE', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'MMM d- EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'MMMM d ရက် EEEEနေ့', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'dd-MM-y', 'yMEd': 'd/M/y- EEE', 'yMMM': 'MMM y', 'yMMMd': 'y- MMM d', 'yMMMEd': 'y- MMM d- EEE', 'yMMMM': 'y MMMM', 'yMMMMd': 'y- MMMM d', 'yMMMMEEEEd': 'y- MMMM d- EEEE', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'v HH:mm', 'jmz': 'z HH:mm', 'jz': 'z HH', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'nb': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L.', 'Md': 'd.M.', 'MEd': 'EEE d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ne': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'MM-dd', 'MEd': 'MM-dd, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'MMM d, EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'MMMM d, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-MM-dd', 'yMEd': 'y-MM-dd, EEE', 'yMMM': 'y MMM', 'yMMMd': 'y MMM d', 'yMMMEd': 'y MMM d, EEE', 'yMMMM': 'y MMMM', 'yMMMMd': 'y MMMM d', 'yMMMMEEEEd': 'y MMMM d, EEEE', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'nl': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd-M', 'MEd': 'EEE d-M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M-y', 'yMd': 'd-M-y', 'yMEd': 'EEE d-M-y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'no': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L.', 'Md': 'd.M.', 'MEd': 'EEE d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'or': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE, M/d', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'M/d/y', 'yMEd': 'EEE, M/d/y', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'pa': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, dd-MM.', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'pl': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.MM', 'MEd': 'EEE, d.MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'd.MM.y', 'yMEd': 'EEE, d.MM.y', 'yMMM': 'LLL y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'LLLL y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ps': <String, String>{ 'd': 'd', 'E': 'EEE', 'EEEE': 'EEEE', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'MM-dd', 'MEd': 'MM-dd, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-MM-dd', 'yMEd': 'y-MM-dd, EEE', 'yMMM': 'y MMM', 'yMMMd': 'y MMM d', 'yMMMEd': 'y MMM d, EEE', 'yMMMM': 'y MMMM', 'yMMMMd': 'د y د MMMM d', 'yMMMMEEEEd': 'EEEE د y د MMMM d', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH (z)', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'pt': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': "d 'de' MMM", 'MMMEd': "EEE, d 'de' MMM", 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "EEEE, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': "MMM 'de' y", 'yMMMd': "d 'de' MMM 'de' y", 'yMMMEd': "EEE, d 'de' MMM 'de' y", 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': "QQQ 'de' y", 'yQQQQ': "QQQQ 'de' y", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'pt_PT': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd/MM', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': 'd/MM', 'MMMEd': 'EEE, d/MM', 'MMMM': 'LLLL', 'MMMMd': "d 'de' MMMM", 'MMMMEEEEd': "cccc, d 'de' MMMM", 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': 'MM/y', 'yMMMd': 'd/MM/y', 'yMMMEd': 'EEE, d/MM/y', 'yMMMM': "MMMM 'de' y", 'yMMMMd': "d 'de' MMMM 'de' y", 'yMMMMEEEEd': "EEEE, d 'de' MMMM 'de' y", 'yQQQ': "QQQQ 'de' y", 'yQQQQ': "QQQQ 'de' y", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ro': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd.MM', 'MEd': 'EEE, dd.MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd.MM.y', 'yMEd': 'EEE, dd.MM.y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ru': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd.MM', 'MEd': 'EEE, dd.MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'ccc, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'cccc, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd.MM.y', 'yMEd': "ccc, dd.MM.y 'г'.", 'yMMM': "LLL y 'г'.", 'yMMMd': "d MMM y 'г'.", 'yMMMEd': "EEE, d MMM y 'г'.", 'yMMMM': "LLLL y 'г'.", 'yMMMMd': "d MMMM y 'г'.", 'yMMMMEEEEd': "EEEE, d MMMM y 'г'.", 'yQQQ': "QQQ y 'г'.", 'yQQQQ': "QQQQ y 'г'.", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'si': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M-d', 'MEd': 'M-d, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'MMM d EEE', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'MMMM d EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-M', 'yMd': 'y-M-d', 'yMEd': 'y-M-d, EEE', 'yMMM': 'y MMM', 'yMMMd': 'y MMM d', 'yMMMEd': 'y MMM d, EEE', 'yMMMM': 'y MMMM', 'yMMMMd': 'y MMMM d', 'yMMMMEEEEd': 'y MMMM d, EEEE', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH.mm', 'Hms': 'HH.mm.ss', 'j': 'HH', 'jm': 'HH.mm', 'jms': 'HH.mm.ss', 'jmv': 'HH.mm v', 'jmz': 'HH.mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm.ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sk': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L.', 'Md': 'd. M.', 'MEd': 'EEE d. M.', 'MMM': 'LLL', 'MMMd': 'd. M.', 'MMMEd': 'EEE d. M.', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd. M. y', 'yMEd': 'EEE d. M. y', 'yMMM': 'M/y', 'yMMMd': 'd. M. y', 'yMMMEd': 'EEE d. M. y', 'yMMMM': 'LLLL y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'H', 'Hm': 'H:mm', 'Hms': 'H:mm:ss', 'j': 'H', 'jm': 'H:mm', 'jms': 'H:mm:ss', 'jmv': 'H:mm v', 'jmz': 'H:mm z', 'jz': 'H z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sl': <String, String>{ 'd': 'd.', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd. M.', 'MEd': 'EEE, d. M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE, d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd. M. y', 'yMEd': 'EEE, d. M. y', 'yMMM': 'MMM y', 'yMMMd': 'd. MMM y', 'yMMMEd': 'EEE, d. MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd. MMMM y', 'yMMMMEEEEd': 'EEEE, d. MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': "HH'h'", 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': "HH'h'", 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': "HH'h' z", 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sq': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M', 'MEd': 'EEE, d.M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M.y', 'yMd': 'd.M.y', 'yMEd': 'EEE, d.M.y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'QQQ, y', 'yQQQQ': 'QQQQ, y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a, v', 'jmz': 'h:mm a, z', 'jz': 'h a, z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sr': <String, String>{ 'd': 'd', 'E': 'EEE', 'EEEE': 'EEEE', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y.', 'yM': 'M.y.', 'yMd': 'd.M.y.', 'yMEd': 'EEE, d.M.y.', 'yMMM': 'MMM y.', 'yMMMd': 'd. MMM y.', 'yMMMEd': 'EEE, d. MMM y.', 'yMMMM': 'MMMM y.', 'yMMMMd': 'd. MMMM y.', 'yMMMMEEEEd': 'EEEE, d. MMMM y.', 'yQQQ': 'QQQ y.', 'yQQQQ': 'QQQQ y.', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sr_Latn': <String, String>{ 'd': 'd', 'E': 'EEE', 'EEEE': 'EEEE', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd.M.', 'MEd': 'EEE, d.M.', 'MMM': 'LLL', 'MMMd': 'd. MMM', 'MMMEd': 'EEE d. MMM', 'MMMM': 'LLLL', 'MMMMd': 'd. MMMM', 'MMMMEEEEd': 'EEEE, d. MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y.', 'yM': 'M.y.', 'yMd': 'd.M.y.', 'yMEd': 'EEE, d.M.y.', 'yMMM': 'MMM y.', 'yMMMd': 'd. MMM y.', 'yMMMEd': 'EEE, d. MMM y.', 'yMMMM': 'MMMM y.', 'yMMMMd': 'd. MMMM y.', 'yMMMMEEEEd': 'EEEE, d. MMMM y.', 'yQQQ': 'QQQ y.', 'yQQQQ': 'QQQQ y.', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sv': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-MM-dd', 'yMEd': 'EEE, y-MM-dd', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE d MMMM y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'sw': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE, d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE, d MMM y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'EEEE, d MMMM y', 'yQQQ': 'y QQQ', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ta': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'dd-MM, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'MMM d, EEE', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'MMMM d, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM, y', 'yMMMEd': 'EEE, d MMM, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'a h', 'jm': 'a h:mm', 'jms': 'a h:mm:ss', 'jmv': 'a h:mm v', 'jmz': 'a h:mm z', 'jz': 'a h z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'te': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'd/M, EEE', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'd MMM, EEE', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'd MMMM, EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'd/M/y, EEE', 'yMMM': 'MMM y', 'yMMMd': 'd, MMM y', 'yMMMEd': 'd MMM, y, EEE', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'd, MMMM y, EEEE', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'th': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEEที่ d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'EEE d MMM y', 'yMMMM': 'MMMM G y', 'yMMMMd': 'd MMMM G y', 'yMMMMEEEEd': 'EEEEที่ d MMMM G y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ G y', 'H': 'HH', 'Hm': 'HH:mm น.', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm น.', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'tl': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'M/d', 'MEd': 'EEE, M/d', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'M/d/y', 'yMEd': 'EEE, M/d/y', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'tr': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'd/MM EEE', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'd MMMM EEE', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'd MMMM EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM/y', 'yMd': 'dd.MM.y', 'yMEd': 'd.M.y EEE', 'yMMM': 'MMM y', 'yMMMd': 'd MMM y', 'yMMMEd': 'd MMM y EEE', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM y', 'yMMMMEEEEd': 'd MMMM y EEEE', 'yQQQ': 'y QQQ', 'yQQQQ': 'y QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'uk': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'LL', 'Md': 'dd.MM', 'MEd': 'EEE, dd.MM', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd.MM.y', 'yMEd': 'EEE, dd.MM.y', 'yMMM': "LLL y 'р'.", 'yMMMd': "d MMM y 'р'.", 'yMMMEd': "EEE, d MMM y 'р'.", 'yMMMM': "LLLL y 'р'.", 'yMMMMd': "d MMMM y 'р'.", 'yMMMMEEEEd': "EEEE, d MMMM y 'р'.", 'yQQQ': 'QQQ y', 'yQQQQ': "QQQQ y 'р'.", 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'ur': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'd/M', 'MEd': 'EEE، d/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE، d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE، d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE، d/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM، y', 'yMMMEd': 'EEE، d MMM، y', 'yMMMM': 'MMMM y', 'yMMMMd': 'd MMMM، y', 'yMMMMEEEEd': 'EEEE، d MMMM، y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'h a', 'jm': 'h:mm a', 'jms': 'h:mm:ss a', 'jmv': 'h:mm a v', 'jmz': 'h:mm a z', 'jz': 'h a z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'uz': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'LL', 'Md': 'dd/MM', 'MEd': 'EEE, dd/MM', 'MMM': 'LLL', 'MMMd': 'd-MMM', 'MMMEd': 'EEE, d-MMM', 'MMMM': 'LLLL', 'MMMMd': 'd-MMMM', 'MMMMEEEEd': 'EEEE, d-MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'MM.y', 'yMd': 'dd/MM/y', 'yMEd': 'EEE, dd/MM/y', 'yMMM': 'MMM, y', 'yMMMd': 'd-MMM, y', 'yMMMEd': 'EEE, d-MMM, y', 'yMMMM': 'MMMM, y', 'yMMMMd': 'd-MMMM, y', 'yMMMMEEEEd': 'EEEE, d-MMMM, y', 'yQQQ': 'y, QQQ', 'yQQQQ': 'y, QQQQ', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm (v)', 'jmz': 'HH:mm (z)', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'vi': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'dd/M', 'MEd': 'EEE, dd/M', 'MMM': 'LLL', 'MMMd': 'd MMM', 'MMMEd': 'EEE, d MMM', 'MMMM': 'LLLL', 'MMMMd': 'd MMMM', 'MMMMEEEEd': 'EEEE, d MMMM', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'EEE, dd/M/y', 'yMMM': 'MMM y', 'yMMMd': 'd MMM, y', 'yMMMEd': 'EEE, d MMM, y', 'yMMMM': "MMMM 'năm' y", 'yMMMMd': 'd MMMM, y', 'yMMMMEEEEd': 'EEEE, d MMMM, y', 'yQQQ': 'QQQ y', 'yQQQQ': "QQQQ 'năm' y", 'H': 'HH', 'Hm': 'H:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'H:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'zh': <String, String>{ 'd': 'd日', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'M月', 'Md': 'M/d', 'MEd': 'M/dEEE', 'MMM': 'LLL', 'MMMd': 'M月d日', 'MMMEd': 'M月d日EEE', 'MMMM': 'LLLL', 'MMMMd': 'M月d日', 'MMMMEEEEd': 'M月d日EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y年', 'yM': 'y年M月', 'yMd': 'y/M/d', 'yMEd': 'y/M/dEEE', 'yMMM': 'y年M月', 'yMMMd': 'y年M月d日', 'yMMMEd': 'y年M月d日EEE', 'yMMMM': 'y年M月', 'yMMMMd': 'y年M月d日', 'yMMMMEEEEd': 'y年M月d日EEEE', 'yQQQ': 'y年第Q季度', 'yQQQQ': 'y年第Q季度', 'H': 'H时', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'H时', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'v HH:mm', 'jmz': 'z HH:mm', 'jz': 'zH时', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'zh_HK': <String, String>{ 'd': 'd日', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'M月', 'Md': 'd/M', 'MEd': 'd/M(EEE)', 'MMM': 'LLL', 'MMMd': 'M月d日', 'MMMEd': 'M月d日EEE', 'MMMM': 'LLLL', 'MMMMd': 'M月d日', 'MMMMEEEEd': 'M月d日EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y年', 'yM': 'M/y', 'yMd': 'd/M/y', 'yMEd': 'd/M/y(EEE)', 'yMMM': 'y年M月', 'yMMMd': 'y年M月d日', 'yMMMEd': 'y年M月d日EEE', 'yMMMM': 'y年M月', 'yMMMMd': 'y年M月d日', 'yMMMMEEEEd': 'y年M月d日EEEE', 'yQQQ': 'y年QQQ', 'yQQQQ': 'y年QQQQ', 'H': 'H時', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'ah時', 'jm': 'ah:mm', 'jms': 'ah:mm:ss', 'jmv': 'ah:mm [v]', 'jmz': 'ah:mm [z]', 'jz': 'ah時 z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'zh_TW': <String, String>{ 'd': 'd日', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'M月', 'Md': 'M/d', 'MEd': 'M/d(EEE)', 'MMM': 'LLL', 'MMMd': 'M月d日', 'MMMEd': 'M月d日 EEE', 'MMMM': 'LLLL', 'MMMMd': 'M月d日', 'MMMMEEEEd': 'M月d日 EEEE', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y年', 'yM': 'y/M', 'yMd': 'y/M/d', 'yMEd': 'y/M/d(EEE)', 'yMMM': 'y年M月', 'yMMMd': 'y年M月d日', 'yMMMEd': 'y年M月d日 EEE', 'yMMMM': 'y年M月', 'yMMMMd': 'y年M月d日', 'yMMMMEEEEd': 'y年M月d日 EEEE', 'yQQQ': 'y年QQQ', 'yQQQQ': 'y年QQQQ', 'H': 'H時', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'ah時', 'jm': 'ah:mm', 'jms': 'ah:mm:ss', 'jmv': 'ah:mm [v]', 'jmz': 'ah:mm [z]', 'jz': 'ah時 z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, 'zu': <String, String>{ 'd': 'd', 'E': 'ccc', 'EEEE': 'cccc', 'LLL': 'LLL', 'LLLL': 'LLLL', 'M': 'L', 'Md': 'MM-dd', 'MEd': 'MM-dd, EEE', 'MMM': 'LLL', 'MMMd': 'MMM d', 'MMMEd': 'EEE, MMM d', 'MMMM': 'LLLL', 'MMMMd': 'MMMM d', 'MMMMEEEEd': 'EEEE, MMMM d', 'QQQ': 'QQQ', 'QQQQ': 'QQQQ', 'y': 'y', 'yM': 'y-MM', 'yMd': 'y-MM-dd', 'yMEd': 'y-MM-dd, EEE', 'yMMM': 'MMM y', 'yMMMd': 'MMM d, y', 'yMMMEd': 'EEE, MMM d, y', 'yMMMM': 'MMMM y', 'yMMMMd': 'MMMM d, y', 'yMMMMEEEEd': 'EEEE, MMMM d, y', 'yQQQ': 'QQQ y', 'yQQQQ': 'QQQQ y', 'H': 'HH', 'Hm': 'HH:mm', 'Hms': 'HH:mm:ss', 'j': 'HH', 'jm': 'HH:mm', 'jms': 'HH:mm:ss', 'jmv': 'HH:mm v', 'jmz': 'HH:mm z', 'jz': 'HH z', 'm': 'm', 'ms': 'mm:ss', 's': 's', 'v': 'v', 'z': 'z', 'zzzz': 'zzzz', 'ZZZZ': 'ZZZZ', }, };
flutter/packages/flutter_localizations/lib/src/l10n/generated_date_localizations.dart/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/generated_date_localizations.dart", "repo_id": "flutter", "token_count": 282219 }
792
{ "scriptCategory": "English-like", "timeOfDayFormat": "HH:mm", "openAppDrawerTooltip": "Navigationsmenü öffnen", "backButtonTooltip": "Zurück", "closeButtonTooltip": "Schließen", "deleteButtonTooltip": "Löschen", "nextMonthTooltip": "Nächster Monat", "previousMonthTooltip": "Vorheriger Monat", "nextPageTooltip": "Nächste Seite", "previousPageTooltip": "Vorherige Seite", "firstPageTooltip": "Erste Seite", "lastPageTooltip": "Letzte Seite", "showMenuTooltip": "Menü anzeigen", "aboutListTileTitle": "Über $applicationName", "licensesPageTitle": "Lizenzen", "pageRowsInfoTitle": "$firstRow–$lastRow von $rowCount", "pageRowsInfoTitleApproximate": "$firstRow–$lastRow von etwa $rowCount", "rowsPerPageTitle": "Zeilen pro Seite:", "tabLabel": "Tab $tabIndex von $tabCount", "selectedRowCountTitleZero": "Keine Objekte ausgewählt", "selectedRowCountTitleOne": "1 Element ausgewählt", "selectedRowCountTitleOther": "$selectedRowCount Elemente ausgewählt", "cancelButtonLabel": "Abbrechen", "closeButtonLabel": "Schließen", "continueButtonLabel": "Weiter", "copyButtonLabel": "Kopieren", "cutButtonLabel": "Ausschneiden", "scanTextButtonLabel": "Text scannen", "okButtonLabel": "OK", "pasteButtonLabel": "Einsetzen", "selectAllButtonLabel": "Alle auswählen", "viewLicensesButtonLabel": "Lizenzen ansehen", "anteMeridiemAbbreviation": "AM", "postMeridiemAbbreviation": "PM", "timePickerHourModeAnnouncement": "Stunden auswählen", "timePickerMinuteModeAnnouncement": "Minuten auswählen", "signedInLabel": "Angemeldet", "hideAccountsLabel": "Konten ausblenden", "showAccountsLabel": "Konten anzeigen", "modalBarrierDismissLabel": "Schließen", "drawerLabel": "Navigationsmenü", "popupMenuLabel": "Pop-up-Menü", "dialogLabel": "Dialogfeld", "alertDialogLabel": "Benachrichtigung", "searchFieldLabel": "Suchen", "reorderItemToStart": "An den Anfang verschieben", "reorderItemToEnd": "An das Ende verschieben", "reorderItemUp": "Nach oben verschieben", "reorderItemDown": "Nach unten verschieben", "reorderItemLeft": "Nach links verschieben", "reorderItemRight": "Nach rechts verschieben", "expandedIconTapHint": "Minimieren", "collapsedIconTapHint": "Maximieren", "remainingTextFieldCharacterCountOne": "Noch 1 Zeichen", "remainingTextFieldCharacterCountOther": "Noch $remainingCount Zeichen", "refreshIndicatorSemanticLabel": "Aktualisieren", "moreButtonTooltip": "Mehr", "dateSeparator": ".", "dateHelpText": "tt.mm.jjjj", "selectYearSemanticsLabel": "Jahr auswählen", "unspecifiedDate": "Datum", "unspecifiedDateRange": "Zeitraum", "dateInputLabel": "Datum eingeben", "dateRangeStartLabel": "Startdatum", "dateRangeEndLabel": "Enddatum", "dateRangeStartDateSemanticLabel": "Startdatum $fullDate", "dateRangeEndDateSemanticLabel": "Enddatum $fullDate", "invalidDateFormatLabel": "Ungültiges Format.", "invalidDateRangeLabel": "Ungültiger Zeitraum.", "dateOutOfRangeLabel": "Außerhalb des Zeitraums.", "saveButtonLabel": "Speichern", "datePickerHelpText": "Datum auswählen", "dateRangePickerHelpText": "Zeitraum auswählen", "calendarModeButtonLabel": "Zum Kalender wechseln", "inputDateModeButtonLabel": "Zur Texteingabe wechseln", "timePickerDialHelpText": "Uhrzeit auswählen", "timePickerInputHelpText": "Uhrzeit eingeben", "timePickerHourLabel": "Stunde", "timePickerMinuteLabel": "Minute", "invalidTimeLabel": "Geben Sie eine gültige Uhrzeit ein", "dialModeButtonLabel": "Zur Uhrzeitauswahl wechseln", "inputTimeModeButtonLabel": "Zum Texteingabemodus wechseln", "licensesPackageDetailTextZero": "No licenses", "licensesPackageDetailTextOne": "1 Lizenz", "licensesPackageDetailTextOther": "$licenseCount Lizenzen", "keyboardKeyAlt": "Alt", "keyboardKeyAltGraph": "AltGr", "keyboardKeyBackspace": "Rücktaste", "keyboardKeyCapsLock": "Feststelltaste", "keyboardKeyChannelDown": "Vorheriger Kanal", "keyboardKeyChannelUp": "Nächster Kanal", "keyboardKeyControl": "Strg", "keyboardKeyDelete": "Entf", "keyboardKeyEject": "Auswerfen", "keyboardKeyEnd": "Ende", "keyboardKeyEscape": "Esc", "keyboardKeyFn": "Fn", "keyboardKeyHome": "Pos1", "keyboardKeyInsert": "Einfg", "keyboardKeyMeta": "Meta", "keyboardKeyNumLock": "Num", "keyboardKeyNumpad1": "Num 1", "keyboardKeyNumpad2": "Num 2", "keyboardKeyNumpad3": "Num 3", "keyboardKeyNumpad4": "Num 4", "keyboardKeyNumpad5": "Num 5", "keyboardKeyNumpad6": "Num 6", "keyboardKeyNumpad7": "Num 7", "keyboardKeyNumpad8": "Num 8", "keyboardKeyNumpad9": "Num 9", "keyboardKeyNumpad0": "Num 0", "keyboardKeyNumpadAdd": "Num +", "keyboardKeyNumpadComma": "Num ,", "keyboardKeyNumpadDecimal": "Num .", "keyboardKeyNumpadDivide": "Num /", "keyboardKeyNumpadEnter": "Num Eingabetaste", "keyboardKeyNumpadEqual": "Num =", "keyboardKeyNumpadMultiply": "Num *", "keyboardKeyNumpadParenLeft": "Num (", "keyboardKeyNumpadParenRight": "Num )", "keyboardKeyNumpadSubtract": "Num -", "keyboardKeyPageDown": "Bild ab", "keyboardKeyPageUp": "Bild auf", "keyboardKeyPower": "Ein/Aus", "keyboardKeyPowerOff": "Aus", "keyboardKeyPrintScreen": "Druck", "keyboardKeyScrollLock": "Rollen", "keyboardKeySelect": "Auswählen", "keyboardKeySpace": "Leertaste", "keyboardKeyMetaMacOs": "Befehl", "keyboardKeyMetaWindows": "Win", "menuBarMenuLabel": "Menü in der Menüleiste", "currentDateLabel": "Heute", "scrimLabel": "Gitter", "bottomSheetLabel": "Ansicht am unteren Rand", "scrimOnTapHint": "$modalRouteContentName schließen", "keyboardKeyShift": "Umschalttaste", "expansionTileExpandedHint": "Zum Minimieren doppeltippen", "expansionTileCollapsedHint": "Zum Maximieren doppeltippen", "expansionTileExpandedTapHint": "Minimieren", "expansionTileCollapsedTapHint": "Für weitere Details maximieren", "expandedHint": "Minimiert", "collapsedHint": "Maximiert", "menuDismissLabel": "Menü schließen", "lookUpButtonLabel": "Nachschlagen", "searchWebButtonLabel": "Im Web suchen", "shareButtonLabel": "Teilen…", "clearButtonTooltip": "Clear text", "selectedDateLabel": "Selected" }
flutter/packages/flutter_localizations/lib/src/l10n/material_de.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/material_de.arb", "repo_id": "flutter", "token_count": 2398 }
793
{ "scriptCategory": "English-like", "timeOfDayFormat": "HH.mm", "openAppDrawerTooltip": "Buka menu navigasi", "backButtonTooltip": "Kembali", "closeButtonTooltip": "Tutup", "deleteButtonTooltip": "Hapus", "nextMonthTooltip": "Bulan berikutnya", "previousMonthTooltip": "Bulan sebelumnya", "nextPageTooltip": "Halaman berikutnya", "previousPageTooltip": "Halaman sebelumnya", "firstPageTooltip": "Halaman pertama", "lastPageTooltip": "Halaman terakhir", "showMenuTooltip": "Tampilkan menu", "aboutListTileTitle": "Tentang $applicationName", "licensesPageTitle": "Lisensi", "pageRowsInfoTitle": "$firstRow–$lastRow dari $rowCount", "pageRowsInfoTitleApproximate": "$firstRow–$lastRow dari kira-kira $rowCount", "rowsPerPageTitle": "Baris per halaman:", "tabLabel": "Tab $tabIndex dari $tabCount", "selectedRowCountTitleOne": "1 item dipilih", "selectedRowCountTitleOther": "$selectedRowCount item dipilih", "cancelButtonLabel": "Batal", "closeButtonLabel": "Tutup", "continueButtonLabel": "Lanjutkan", "copyButtonLabel": "Salin", "cutButtonLabel": "Potong", "scanTextButtonLabel": "Pindai teks", "okButtonLabel": "OKE", "pasteButtonLabel": "Tempel", "selectAllButtonLabel": "Pilih semua", "viewLicensesButtonLabel": "Lihat lisensi", "anteMeridiemAbbreviation": "AM", "postMeridiemAbbreviation": "PM", "timePickerHourModeAnnouncement": "Pilih jam", "timePickerMinuteModeAnnouncement": "Pilih menit", "modalBarrierDismissLabel": "Tutup", "signedInLabel": "Telah login", "hideAccountsLabel": "Sembunyikan akun", "showAccountsLabel": "Tampilkan akun", "drawerLabel": "Menu navigasi", "popupMenuLabel": "Menu pop-up", "dialogLabel": "Dialog", "alertDialogLabel": "Notifikasi", "searchFieldLabel": "Telusuri", "reorderItemToStart": "Pindahkan ke awal", "reorderItemToEnd": "Pindahkan ke akhir", "reorderItemUp": "Naikkan", "reorderItemDown": "Turunkan", "reorderItemLeft": "Pindahkan ke kiri", "reorderItemRight": "Pindahkan ke kanan", "expandedIconTapHint": "Ciutkan", "collapsedIconTapHint": "Luaskan", "remainingTextFieldCharacterCountOne": "Sisa 1 karakter", "remainingTextFieldCharacterCountOther": "Sisa $remainingCount karakter", "refreshIndicatorSemanticLabel": "Memuat ulang", "moreButtonTooltip": "Lainnya", "dateSeparator": "/", "dateHelpText": "hh/bb/tttt", "selectYearSemanticsLabel": "Pilih tahun", "unspecifiedDate": "Tanggal", "unspecifiedDateRange": "Rentang tanggal", "dateInputLabel": "Masukkan Tanggal", "dateRangeStartLabel": "Tanggal Mulai", "dateRangeEndLabel": "Tanggal Akhir", "dateRangeStartDateSemanticLabel": "Tanggal mulai $fullDate", "dateRangeEndDateSemanticLabel": "Tanggal akhir $fullDate", "invalidDateFormatLabel": "Format tidak valid.", "invalidDateRangeLabel": "Rentang tidak valid.", "dateOutOfRangeLabel": "Di luar rentang.", "saveButtonLabel": "Simpan", "datePickerHelpText": "Pilih tanggal", "dateRangePickerHelpText": "Pilih rentang", "calendarModeButtonLabel": "Beralih ke kalender", "inputDateModeButtonLabel": "Beralih ke masukan", "timePickerDialHelpText": "Pilih waktu", "timePickerInputHelpText": "Masukkan waktu", "timePickerHourLabel": "Jam", "timePickerMinuteLabel": "Menit", "invalidTimeLabel": "Masukkan waktu yang valid", "dialModeButtonLabel": "Beralih ke mode tampilan jam", "inputTimeModeButtonLabel": "Beralih ke mode input teks", "licensesPackageDetailTextZero": "No licenses", "licensesPackageDetailTextOne": "1 lisensi", "licensesPackageDetailTextOther": "$licenseCount lisensi", "keyboardKeyAlt": "Alt", "keyboardKeyAltGraph": "AltGr", "keyboardKeyBackspace": "Backspace", "keyboardKeyCapsLock": "Caps Lock", "keyboardKeyChannelDown": "Channel Down", "keyboardKeyChannelUp": "Channel Up", "keyboardKeyControl": "Ctrl", "keyboardKeyDelete": "Del", "keyboardKeyEject": "Eject", "keyboardKeyEnd": "End", "keyboardKeyEscape": "Esc", "keyboardKeyFn": "Fn", "keyboardKeyHome": "Home", "keyboardKeyInsert": "Insert", "keyboardKeyMeta": "Meta", "keyboardKeyNumLock": "Num Lock", "keyboardKeyNumpad1": "Num 1", "keyboardKeyNumpad2": "Num 2", "keyboardKeyNumpad3": "Num 3", "keyboardKeyNumpad4": "Num 4", "keyboardKeyNumpad5": "Num 5", "keyboardKeyNumpad6": "Num 6", "keyboardKeyNumpad7": "Num 7", "keyboardKeyNumpad8": "Num 8", "keyboardKeyNumpad9": "Num 9", "keyboardKeyNumpad0": "Num 0", "keyboardKeyNumpadAdd": "Num +", "keyboardKeyNumpadComma": "Num ,", "keyboardKeyNumpadDecimal": "Num .", "keyboardKeyNumpadDivide": "Num /", "keyboardKeyNumpadEnter": "Num Enter", "keyboardKeyNumpadEqual": "Num =", "keyboardKeyNumpadMultiply": "Num *", "keyboardKeyNumpadParenLeft": "Num (", "keyboardKeyNumpadParenRight": "Num )", "keyboardKeyNumpadSubtract": "Num -", "keyboardKeyPageDown": "PgDown", "keyboardKeyPageUp": "PgUp", "keyboardKeyPower": "Power", "keyboardKeyPowerOff": "Power Off", "keyboardKeyPrintScreen": "Print Screen", "keyboardKeyScrollLock": "Scroll Lock", "keyboardKeySelect": "Select", "keyboardKeySpace": "Space", "keyboardKeyMetaMacOs": "Command", "keyboardKeyMetaWindows": "Win", "menuBarMenuLabel": "Menu panel menu", "currentDateLabel": "Hari ini", "scrimLabel": "Scrim", "bottomSheetLabel": "Sheet Bawah", "scrimOnTapHint": "Tutup $modalRouteContentName", "keyboardKeyShift": "Shift", "expansionTileExpandedHint": "ketuk dua kali untuk menciutkan", "expansionTileCollapsedHint": "ketuk dua kali untuk meluaskan", "expansionTileExpandedTapHint": "Ciutkan", "expansionTileCollapsedTapHint": "Luaskan untuk mengetahui detail selengkapnya", "expandedHint": "Diciutkan", "collapsedHint": "Diluaskan", "menuDismissLabel": "Tutup menu", "lookUpButtonLabel": "Cari", "searchWebButtonLabel": "Telusuri di Web", "shareButtonLabel": "Bagikan...", "clearButtonTooltip": "Clear text", "selectedDateLabel": "Selected" }
flutter/packages/flutter_localizations/lib/src/l10n/material_id.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/material_id.arb", "repo_id": "flutter", "token_count": 2239 }
794
{ "scriptCategory": "dense", "timeOfDayFormat": "h:mm a", "openAppDrawerTooltip": "नेव्हिगेशन मेनू उघडा", "backButtonTooltip": "मागे", "closeButtonTooltip": "बंद करा", "deleteButtonTooltip": "हटवा", "nextMonthTooltip": "पुढील महिना", "previousMonthTooltip": "मागील महिना", "nextPageTooltip": "पुढील पेज", "previousPageTooltip": "मागील पेज", "firstPageTooltip": "पहिले पेज", "lastPageTooltip": "शेवटचे पेज", "showMenuTooltip": "मेनू दाखवा", "aboutListTileTitle": "$applicationName बद्दल", "licensesPageTitle": "परवाने", "pageRowsInfoTitle": "$rowCount पैकी $firstRow–$lastRow", "pageRowsInfoTitleApproximate": "$rowCount च्या बद्दल $firstRow–$lastRow", "rowsPerPageTitle": "प्रति पेज पंक्ती:", "tabLabel": "$tabCount पैकी $tabIndex टॅब", "selectedRowCountTitleZero": "कोणतेही आयटम निवडलेले नाहीत", "selectedRowCountTitleOne": "एक आयटम निवडला", "selectedRowCountTitleOther": "$selectedRowCount आयटम निवडले", "cancelButtonLabel": "रद्द करा", "closeButtonLabel": "बंद करा", "continueButtonLabel": "पुढे सुरू ठेवा", "copyButtonLabel": "कॉपी करा", "cutButtonLabel": "कट करा", "scanTextButtonLabel": "मजकूर स्कॅन करा", "okButtonLabel": "ओके", "pasteButtonLabel": "पेस्ट करा", "selectAllButtonLabel": "सर्व निवडा", "viewLicensesButtonLabel": "परवाने पहा", "anteMeridiemAbbreviation": "AM", "postMeridiemAbbreviation": "PM", "timePickerHourModeAnnouncement": "तास निवडा", "timePickerMinuteModeAnnouncement": "मिनिटे निवडा", "modalBarrierDismissLabel": "डिसमिस करा", "signedInLabel": "साइन इन केले आहे", "hideAccountsLabel": "खाती लपवा", "showAccountsLabel": "खाती दर्शवा", "drawerLabel": "नेव्हिगेशन मेनू", "popupMenuLabel": "पॉपअप मेनू", "dialogLabel": "डायलॉग", "alertDialogLabel": "सूचना", "searchFieldLabel": "शोध", "reorderItemToStart": "सुरुवातीला हलवा", "reorderItemToEnd": "शेवटाकडे हलवा", "reorderItemUp": "वर हलवा", "reorderItemDown": "खाली हलवा", "reorderItemLeft": "डावीकडे हलवा", "reorderItemRight": "उजवीकडे हलवा", "expandedIconTapHint": "कोलॅप्स करा", "collapsedIconTapHint": "विस्तार करा", "remainingTextFieldCharacterCountZero": "कोणतेही वर्ण शिल्लक नाहीत", "remainingTextFieldCharacterCountOne": "एक वर्ण शिल्लक", "remainingTextFieldCharacterCountOther": "$remainingCount वर्ण शिल्लक", "refreshIndicatorSemanticLabel": "रिफ्रेश करा", "moreButtonTooltip": "आणखी", "dateSeparator": "/", "dateHelpText": "dd/mm/yyyy", "selectYearSemanticsLabel": "वर्ष निवडा", "unspecifiedDate": "तारीख", "unspecifiedDateRange": "तारीख श्रेणी", "dateInputLabel": "तारीख एंटर करा", "dateRangeStartLabel": "सुरू होण्याची तारीख", "dateRangeEndLabel": "संपण्याची तारीख", "dateRangeStartDateSemanticLabel": "सुरू होण्याची तारीख $fullDate", "dateRangeEndDateSemanticLabel": "संपण्याची तारीख $fullDate", "invalidDateFormatLabel": "फॉरमॅट चुकीचा आहे.", "invalidDateRangeLabel": "श्रेणी चुकीची आहे.", "dateOutOfRangeLabel": "श्रेणीच्या बाहेर आहे.", "saveButtonLabel": "सेव्ह करा", "datePickerHelpText": "तारीख निवडा", "dateRangePickerHelpText": "रेंज निवडा", "calendarModeButtonLabel": "कॅलेंडरवर स्विच करा", "inputDateModeButtonLabel": "इनपुटवर स्विच करा", "timePickerDialHelpText": "वेळ निवडा", "timePickerInputHelpText": "वेळ एंटर करा", "timePickerHourLabel": "तास", "timePickerMinuteLabel": "मिनिट", "invalidTimeLabel": "योग्य वेळ एंटर करा", "dialModeButtonLabel": "डायल पिकर मोडवर स्विच करा", "inputTimeModeButtonLabel": "मजकूर इनपुट मोडवर स्विच करा", "licensesPackageDetailTextZero": "No licenses", "licensesPackageDetailTextOne": "एक परवाना", "licensesPackageDetailTextOther": "$licenseCount परवाने", "keyboardKeyAlt": "Alt", "keyboardKeyAltGraph": "AltGr", "keyboardKeyBackspace": "बॅकस्पेस", "keyboardKeyCapsLock": "कॅप्स लॉक", "keyboardKeyChannelDown": "चॅनल डाउन", "keyboardKeyChannelUp": "चॅनल अप", "keyboardKeyControl": "Ctrl", "keyboardKeyDelete": "Del", "keyboardKeyEject": "इजेक्ट", "keyboardKeyEnd": "एंड", "keyboardKeyEscape": "Esc", "keyboardKeyFn": "Fn", "keyboardKeyHome": "होम", "keyboardKeyInsert": "इन्सर्ट", "keyboardKeyMeta": "मेटा", "keyboardKeyNumLock": "Num Lock", "keyboardKeyNumpad1": "Num 1", "keyboardKeyNumpad2": "Num 2", "keyboardKeyNumpad3": "Num 3", "keyboardKeyNumpad4": "Num 4", "keyboardKeyNumpad5": "Num 5", "keyboardKeyNumpad6": "Num 6", "keyboardKeyNumpad7": "Num 7", "keyboardKeyNumpad8": "Num 8", "keyboardKeyNumpad9": "Num 9", "keyboardKeyNumpad0": "Num 0", "keyboardKeyNumpadAdd": "Num +", "keyboardKeyNumpadComma": "Num ,", "keyboardKeyNumpadDecimal": "Num .", "keyboardKeyNumpadDivide": "Num /", "keyboardKeyNumpadEnter": "Num Enter", "keyboardKeyNumpadEqual": "Num =", "keyboardKeyNumpadMultiply": "Num *", "keyboardKeyNumpadParenLeft": "Num (", "keyboardKeyNumpadParenRight": "Num )", "keyboardKeyNumpadSubtract": "Num -", "keyboardKeyPageDown": "PgDown", "keyboardKeyPageUp": "PgUp", "keyboardKeyPower": "पॉवर", "keyboardKeyPowerOff": "पॉवर ऑफ", "keyboardKeyPrintScreen": "प्रिंट स्क्रीन", "keyboardKeyScrollLock": "स्क्रोल लॉक", "keyboardKeySelect": "निवडा", "keyboardKeySpace": "स्पेस", "keyboardKeyMetaMacOs": "कमांड", "keyboardKeyMetaWindows": "Win", "menuBarMenuLabel": "मेनू बार मेनू", "currentDateLabel": "आज", "scrimLabel": "स्क्रिम", "bottomSheetLabel": "तळाशी असलेली शीट", "scrimOnTapHint": "$modalRouteContentName बंद करा", "keyboardKeyShift": "शिफ्ट", "expansionTileExpandedHint": "कोलॅप्स करण्यासाठी दोनदा टॅप करा", "expansionTileCollapsedHint": "विस्तार करण्‍यासाठी दोनदा टॅप करा", "expansionTileExpandedTapHint": "कोलॅप्स करा", "expansionTileCollapsedTapHint": "आणखी तपशिलांसाठी विस्तार करा", "expandedHint": "कोलॅप्स केले", "collapsedHint": "विस्तार केले", "menuDismissLabel": "मेनू डिसमिस करा", "lookUpButtonLabel": "शोध घ्या", "searchWebButtonLabel": "वेबवर शोधा", "shareButtonLabel": "शेअर करा...", "clearButtonTooltip": "Clear text", "selectedDateLabel": "Selected" }
flutter/packages/flutter_localizations/lib/src/l10n/material_mr.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/material_mr.arb", "repo_id": "flutter", "token_count": 3884 }
795
{ "licensesPackageDetailTextFew": "$licenseCount licencie", "licensesPackageDetailTextMany": "$licenseCount licenses", "remainingTextFieldCharacterCountFew": "Zostávajú $remainingCount znaky", "remainingTextFieldCharacterCountMany": "$remainingCount characters remaining", "scriptCategory": "English-like", "timeOfDayFormat": "HH:mm", "selectedRowCountTitleFew": "$selectedRowCount vybraté položky", "selectedRowCountTitleMany": "$selectedRowCount items selected", "openAppDrawerTooltip": "Otvoriť navigačnú ponuku", "backButtonTooltip": "Späť", "closeButtonTooltip": "Zavrieť", "deleteButtonTooltip": "Odstrániť", "nextMonthTooltip": "Budúci mesiac", "previousMonthTooltip": "Predošlý mesiac", "nextPageTooltip": "Ďalšia strana", "previousPageTooltip": "Predchádzajúca stránka", "firstPageTooltip": "Prvá strana", "lastPageTooltip": "Posledná strana", "showMenuTooltip": "Zobraziť ponuku", "aboutListTileTitle": "$applicationName – informácie", "licensesPageTitle": "Licencie", "pageRowsInfoTitle": "$firstRow – $lastRow z $rowCount", "pageRowsInfoTitleApproximate": "$firstRow – $lastRow z približne $rowCount", "rowsPerPageTitle": "Počet riadkov na stránku:", "tabLabel": "Karta $tabIndex z $tabCount", "selectedRowCountTitleOne": "1 vybratá položka", "selectedRowCountTitleOther": "$selectedRowCount vybratých položiek", "cancelButtonLabel": "Zrušiť", "closeButtonLabel": "Zavrieť", "continueButtonLabel": "Pokračovať", "copyButtonLabel": "Kopírovať", "cutButtonLabel": "Vystrihnúť", "scanTextButtonLabel": "Naskenovať text", "okButtonLabel": "OK", "pasteButtonLabel": "Prilepiť", "selectAllButtonLabel": "Vybrať všetko", "viewLicensesButtonLabel": "Zobraziť licencie", "anteMeridiemAbbreviation": "AM", "postMeridiemAbbreviation": "PM", "timePickerHourModeAnnouncement": "Vybrať hodiny", "timePickerMinuteModeAnnouncement": "Vybrať minúty", "modalBarrierDismissLabel": "Odmietnuť", "signedInLabel": "Prihlásili ste sa", "hideAccountsLabel": "Skryť účty", "showAccountsLabel": "Zobraziť účty", "drawerLabel": "Navigačná ponuka", "popupMenuLabel": "Kontextová ponuka", "dialogLabel": "Dialógové okno", "alertDialogLabel": "Upozornenie", "searchFieldLabel": "Hľadať", "reorderItemToStart": "Presunúť na začiatok", "reorderItemToEnd": "Presunúť na koniec", "reorderItemUp": "Presunúť nahor", "reorderItemDown": "Presunúť nadol", "reorderItemLeft": "Presunúť doľava", "reorderItemRight": "Presunúť doprava", "expandedIconTapHint": "Zbaliť", "collapsedIconTapHint": "Rozbaliť", "remainingTextFieldCharacterCountOne": "Zostáva 1 znak", "remainingTextFieldCharacterCountOther": "Zostáva $remainingCount znakov", "refreshIndicatorSemanticLabel": "Obnoviť", "moreButtonTooltip": "Viac", "dateSeparator": ".", "dateHelpText": "mm.dd.yyyy", "selectYearSemanticsLabel": "Vyberte rok", "unspecifiedDate": "Dátum", "unspecifiedDateRange": "Obdobie", "dateInputLabel": "Zadajte dátum", "dateRangeStartLabel": "Dátum začatia", "dateRangeEndLabel": "Dátum ukončenia", "dateRangeStartDateSemanticLabel": "Dátum začatia $fullDate", "dateRangeEndDateSemanticLabel": "Dátum ukončenia $fullDate", "invalidDateFormatLabel": "Neplatný formát.", "invalidDateRangeLabel": "Neplatný rozsah.", "dateOutOfRangeLabel": "Mimo rozsahu.", "saveButtonLabel": "Uložiť", "datePickerHelpText": "Vybrať dátum", "dateRangePickerHelpText": "Vybrať rozsah", "calendarModeButtonLabel": "Prepnúť na kalendár", "inputDateModeButtonLabel": "Prepnúť na zadávanie", "timePickerDialHelpText": "Vybrať čas", "timePickerInputHelpText": "Zadať čas", "timePickerHourLabel": "Hodina", "timePickerMinuteLabel": "Minúta", "invalidTimeLabel": "Zadajte platný čas", "dialModeButtonLabel": "Prepnúť na režim výberu času", "inputTimeModeButtonLabel": "Prepnúť na textový režim vstupu", "licensesPackageDetailTextZero": "No licenses", "licensesPackageDetailTextOne": "1 licencia", "licensesPackageDetailTextOther": "$licenseCount licencií", "keyboardKeyAlt": "Alt", "keyboardKeyAltGraph": "AltGr", "keyboardKeyBackspace": "Backspace", "keyboardKeyCapsLock": "Caps Lock", "keyboardKeyChannelDown": "O kanál nižšie", "keyboardKeyChannelUp": "O kanál vyššie", "keyboardKeyControl": "Ctrl", "keyboardKeyDelete": "Del", "keyboardKeyEject": "Odpojiť", "keyboardKeyEnd": "End", "keyboardKeyEscape": "Esc", "keyboardKeyFn": "Fn", "keyboardKeyHome": "Home", "keyboardKeyInsert": "Insert", "keyboardKeyMeta": "Meta", "keyboardKeyNumLock": "Num Lock", "keyboardKeyNumpad1": "Num 1", "keyboardKeyNumpad2": "Num 2", "keyboardKeyNumpad3": "Num 3", "keyboardKeyNumpad4": "Num 4", "keyboardKeyNumpad5": "Num 5", "keyboardKeyNumpad6": "Num 6", "keyboardKeyNumpad7": "Num 7", "keyboardKeyNumpad8": "Num 8", "keyboardKeyNumpad9": "Num 9", "keyboardKeyNumpad0": "Num 0", "keyboardKeyNumpadAdd": "Num +", "keyboardKeyNumpadComma": "Num ,", "keyboardKeyNumpadDecimal": "Num .", "keyboardKeyNumpadDivide": "Num /", "keyboardKeyNumpadEnter": "Num Enter", "keyboardKeyNumpadEqual": "Num =", "keyboardKeyNumpadMultiply": "Num *", "keyboardKeyNumpadParenLeft": "Num (", "keyboardKeyNumpadParenRight": "Num )", "keyboardKeyNumpadSubtract": "Num -", "keyboardKeyPageDown": "PgDown", "keyboardKeyPageUp": "PgUp", "keyboardKeyPower": "Vypínač", "keyboardKeyPowerOff": "Vypnúť", "keyboardKeyPrintScreen": "Print Screen", "keyboardKeyScrollLock": "Scroll Lock", "keyboardKeySelect": "Select", "keyboardKeySpace": "Medzerník", "keyboardKeyMetaMacOs": "Command", "keyboardKeyMetaWindows": "Win", "menuBarMenuLabel": "Ponuka panela s ponukami", "currentDateLabel": "Dnes", "scrimLabel": "Scrim", "bottomSheetLabel": "Dolný hárok", "scrimOnTapHint": "Zavrieť $modalRouteContentName", "keyboardKeyShift": "Shift", "expansionTileExpandedHint": "zbalíte dvojitým klepnutím", "expansionTileCollapsedHint": "rozbalíte dvojitým klepnutím", "expansionTileExpandedTapHint": "Zbaliť", "expansionTileCollapsedTapHint": "Rozbaliť a zobraziť ďalšie podrobnosti", "expandedHint": "Zbalené", "collapsedHint": "Rozbalené", "menuDismissLabel": "Zavrieť ponuku", "lookUpButtonLabel": "Pohľad nahor", "searchWebButtonLabel": "Hľadať na webe", "shareButtonLabel": "Zdieľať…", "clearButtonTooltip": "Clear text", "selectedDateLabel": "Selected" }
flutter/packages/flutter_localizations/lib/src/l10n/material_sk.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/material_sk.arb", "repo_id": "flutter", "token_count": 2658 }
796
{ "scriptCategory": "dense", "timeOfDayFormat": "ah:mm", "selectedRowCountTitleOne": "已选择 1 项内容", "openAppDrawerTooltip": "打开导航菜单", "backButtonTooltip": "返回", "nextPageTooltip": "下一页", "previousPageTooltip": "上一页", "firstPageTooltip": "第一页", "lastPageTooltip": "最后一页", "showMenuTooltip": "显示菜单", "aboutListTileTitle": "关于$applicationName", "licensesPageTitle": "许可", "pageRowsInfoTitle": "第 $firstRow-$lastRow 行(共 $rowCount 行)", "pageRowsInfoTitleApproximate": "第 $firstRow-$lastRow 行(共约 $rowCount 行)", "rowsPerPageTitle": "每页行数:", "tabLabel": "第 $tabIndex 个标签,共 $tabCount 个", "selectedRowCountTitleOther": "已选择 $selectedRowCount 项内容", "cancelButtonLabel": "取消", "continueButtonLabel": "继续", "closeButtonLabel": "关闭", "copyButtonLabel": "复制", "cutButtonLabel": "剪切", "scanTextButtonLabel": "扫描文字", "okButtonLabel": "确定", "pasteButtonLabel": "粘贴", "selectAllButtonLabel": "全选", "viewLicensesButtonLabel": "查看许可", "closeButtonTooltip": "关闭", "deleteButtonTooltip": "删除", "nextMonthTooltip": "下个月", "previousMonthTooltip": "上个月", "anteMeridiemAbbreviation": "上午", "postMeridiemAbbreviation": "下午", "timePickerHourModeAnnouncement": "选择小时", "timePickerMinuteModeAnnouncement": "选择分钟", "signedInLabel": "已登录", "hideAccountsLabel": "隐藏账号", "showAccountsLabel": "显示账号", "modalBarrierDismissLabel": "关闭", "drawerLabel": "导航菜单", "popupMenuLabel": "弹出菜单", "dialogLabel": "对话框", "alertDialogLabel": "提醒", "searchFieldLabel": "搜索", "reorderItemToStart": "移到开头", "reorderItemToEnd": "移到末尾", "reorderItemUp": "上移", "reorderItemDown": "下移", "reorderItemLeft": "左移", "reorderItemRight": "右移", "expandedIconTapHint": "收起", "collapsedIconTapHint": "展开", "remainingTextFieldCharacterCountOne": "还可输入 1 个字符", "remainingTextFieldCharacterCountOther": "还可输入 $remainingCount 个字符", "refreshIndicatorSemanticLabel": "刷新", "moreButtonTooltip": "更多", "dateSeparator": "/", "dateHelpText": "yyyy/mm/dd", "selectYearSemanticsLabel": "选择年份", "unspecifiedDate": "日期", "unspecifiedDateRange": "日期范围", "dateInputLabel": "输入日期", "dateRangeStartLabel": "开始日期", "dateRangeEndLabel": "结束日期", "dateRangeStartDateSemanticLabel": "开始日期为 $fullDate", "dateRangeEndDateSemanticLabel": "结束日期为 $fullDate", "invalidDateFormatLabel": "格式无效。", "invalidDateRangeLabel": "范围无效。", "dateOutOfRangeLabel": "超出范围。", "saveButtonLabel": "保存", "datePickerHelpText": "选择日期", "dateRangePickerHelpText": "选择范围", "calendarModeButtonLabel": "切换到日历模式", "inputDateModeButtonLabel": "切换到输入模式", "timePickerDialHelpText": "选择时间", "timePickerInputHelpText": "输入时间", "timePickerHourLabel": "小时", "timePickerMinuteLabel": "分钟", "invalidTimeLabel": "请输入有效的时间", "dialModeButtonLabel": "切换到表盘选择器模式", "inputTimeModeButtonLabel": "切换到文本输入模式", "licensesPackageDetailTextZero": "No licenses", "licensesPackageDetailTextOne": "1 份许可", "licensesPackageDetailTextOther": "$licenseCount 份许可", "keyboardKeyAlt": "Alt", "keyboardKeyAltGraph": "AltGr", "keyboardKeyBackspace": "退格键", "keyboardKeyCapsLock": "Caps Lock", "keyboardKeyChannelDown": "Channel Down", "keyboardKeyChannelUp": "Channel Up", "keyboardKeyControl": "Ctrl", "keyboardKeyDelete": "Del", "keyboardKeyEject": "弹出", "keyboardKeyEnd": "End", "keyboardKeyEscape": "Esc", "keyboardKeyFn": "Fn", "keyboardKeyHome": "Home", "keyboardKeyInsert": "Insert", "keyboardKeyMeta": "Meta", "keyboardKeyNumLock": "Num Lock", "keyboardKeyNumpad1": "数字键盘 1", "keyboardKeyNumpad2": "数字键盘 2", "keyboardKeyNumpad3": "数字键盘 3", "keyboardKeyNumpad4": "数字键盘 4", "keyboardKeyNumpad5": "数字键盘 5", "keyboardKeyNumpad6": "数字键盘 6", "keyboardKeyNumpad7": "数字键盘 7", "keyboardKeyNumpad8": "数字键盘 8", "keyboardKeyNumpad9": "数字键盘 9", "keyboardKeyNumpad0": "数字键盘 0", "keyboardKeyNumpadAdd": "数字键盘 +", "keyboardKeyNumpadComma": "数字键盘 ,", "keyboardKeyNumpadDecimal": "数字键盘 .", "keyboardKeyNumpadDivide": "数字键盘 /", "keyboardKeyNumpadEnter": "数字键盘 Enter", "keyboardKeyNumpadEqual": "数字键盘 =", "keyboardKeyNumpadMultiply": "数字键盘 *", "keyboardKeyNumpadParenLeft": "数字键盘 (", "keyboardKeyNumpadParenRight": "数字键盘 )", "keyboardKeyNumpadSubtract": "数字键盘 -", "keyboardKeyPageDown": "PgDn", "keyboardKeyPageUp": "PgUp", "keyboardKeyPower": "电源", "keyboardKeyPowerOff": "关机", "keyboardKeyPrintScreen": "Print Screen", "keyboardKeyScrollLock": "Scroll Lock", "keyboardKeySelect": "选择", "keyboardKeySpace": "空格键", "keyboardKeyMetaMacOs": "⌘", "keyboardKeyMetaWindows": "Win", "menuBarMenuLabel": "菜单栏的菜单", "currentDateLabel": "今天", "scrimLabel": "纱罩", "bottomSheetLabel": "底部动作条", "scrimOnTapHint": "关闭 $modalRouteContentName", "keyboardKeyShift": "Shift", "expansionTileExpandedHint": "点按两次即可收起", "expansionTileCollapsedHint": "点按两次即可展开", "expansionTileExpandedTapHint": "收起", "expansionTileCollapsedTapHint": "展开查看更多详情", "expandedHint": "已收起", "collapsedHint": "已展开", "menuDismissLabel": "关闭菜单", "lookUpButtonLabel": "查询", "searchWebButtonLabel": "搜索", "shareButtonLabel": "共享…", "clearButtonTooltip": "Clear text", "selectedDateLabel": "Selected" }
flutter/packages/flutter_localizations/lib/src/l10n/material_zh.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/material_zh.arb", "repo_id": "flutter", "token_count": 2802 }
797
{ "reorderItemToStart": "Flyt til først på listen", "reorderItemToEnd": "Flyt til sidst på listen", "reorderItemUp": "Flyt op", "reorderItemDown": "Flyt ned", "reorderItemLeft": "Flyt til venstre", "reorderItemRight": "Flyt til højre" }
flutter/packages/flutter_localizations/lib/src/l10n/widgets_da.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/widgets_da.arb", "repo_id": "flutter", "token_count": 103 }
798
{ "reorderItemToStart": "Տեղափոխել սկիզբ", "reorderItemToEnd": "Տեղափոխել վերջ", "reorderItemUp": "Տեղափոխել վերև", "reorderItemDown": "Տեղափոխել ներքև", "reorderItemLeft": "Տեղափոխել ձախ", "reorderItemRight": "Տեղափոխել աջ" }
flutter/packages/flutter_localizations/lib/src/l10n/widgets_hy.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/widgets_hy.arb", "repo_id": "flutter", "token_count": 226 }
799
{ "reorderItemToStart": "Эхлэл рүү зөөх", "reorderItemToEnd": "Төгсгөл рүү зөөх", "reorderItemUp": "Дээш зөөх", "reorderItemDown": "Доош зөөх", "reorderItemLeft": "Зүүн тийш зөөх", "reorderItemRight": "Баруун тийш зөөх" }
flutter/packages/flutter_localizations/lib/src/l10n/widgets_mn.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/widgets_mn.arb", "repo_id": "flutter", "token_count": 188 }
800
{ "reorderItemToStart": "ආරම්භය වෙත යන්න", "reorderItemToEnd": "අවසානයට යන්න", "reorderItemUp": "ඉහළට ගෙන යන්න", "reorderItemDown": "පහළට ගෙන යන්න", "reorderItemLeft": "වමට ගෙන යන්න", "reorderItemRight": "දකුණට ගෙන යන්න" }
flutter/packages/flutter_localizations/lib/src/l10n/widgets_si.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/widgets_si.arb", "repo_id": "flutter", "token_count": 280 }
801
{ "reorderItemToStart": "Di chuyển lên đầu danh sách", "reorderItemToEnd": "Di chuyển xuống cuối danh sách", "reorderItemUp": "Di chuyển lên", "reorderItemDown": "Di chuyển xuống", "reorderItemLeft": "Di chuyển sang trái", "reorderItemRight": "Di chuyển sang phải" }
flutter/packages/flutter_localizations/lib/src/l10n/widgets_vi.arb/0
{ "file_path": "flutter/packages/flutter_localizations/lib/src/l10n/widgets_vi.arb", "repo_id": "flutter", "token_count": 157 }
802
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:convert'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:path/path.dart' as path; import '../test_utils.dart'; final String rootDirectoryPath = Directory.current.path; void main() { for (final String language in kMaterialSupportedLanguages) { testWidgets('translations exist for $language', (WidgetTester tester) async { final Locale locale = Locale(language); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations.openAppDrawerTooltip, isNotNull); expect(localizations.backButtonTooltip, isNotNull); expect(localizations.closeButtonTooltip, isNotNull); expect(localizations.nextMonthTooltip, isNotNull); expect(localizations.previousMonthTooltip, isNotNull); expect(localizations.nextPageTooltip, isNotNull); expect(localizations.previousPageTooltip, isNotNull); expect(localizations.firstPageTooltip, isNotNull); expect(localizations.lastPageTooltip, isNotNull); expect(localizations.showMenuTooltip, isNotNull); expect(localizations.licensesPageTitle, isNotNull); expect(localizations.rowsPerPageTitle, isNotNull); expect(localizations.cancelButtonLabel, isNotNull); expect(localizations.closeButtonLabel, isNotNull); expect(localizations.continueButtonLabel, isNotNull); expect(localizations.copyButtonLabel, isNotNull); expect(localizations.cutButtonLabel, isNotNull); expect(localizations.okButtonLabel, isNotNull); expect(localizations.pasteButtonLabel, isNotNull); expect(localizations.selectAllButtonLabel, isNotNull); expect(localizations.viewLicensesButtonLabel, isNotNull); expect(localizations.drawerLabel, isNotNull); expect(localizations.popupMenuLabel, isNotNull); expect(localizations.dialogLabel, isNotNull); expect(localizations.alertDialogLabel, isNotNull); expect(localizations.collapsedIconTapHint, isNotNull); expect(localizations.expandedIconTapHint, isNotNull); expect(localizations.expansionTileExpandedHint, isNotNull); expect(localizations.expansionTileCollapsedHint, isNotNull); expect(localizations.collapsedHint, isNotNull); expect(localizations.expandedHint, isNotNull); expect(localizations.refreshIndicatorSemanticLabel, isNotNull); expect(localizations.selectedDateLabel, isNotNull); // Regression test for https://github.com/flutter/flutter/issues/136090 expect(localizations.remainingTextFieldCharacterCount(0), isNot(contains('TBD'))); expect(localizations.remainingTextFieldCharacterCount(0), isNotNull); expect(localizations.remainingTextFieldCharacterCount(1), isNotNull); expect(localizations.remainingTextFieldCharacterCount(10), isNotNull); expect(localizations.remainingTextFieldCharacterCount(0), isNot(contains(r'$remainingCount'))); expect(localizations.remainingTextFieldCharacterCount(1), isNot(contains(r'$remainingCount'))); expect(localizations.remainingTextFieldCharacterCount(10), isNot(contains(r'$remainingCount'))); expect(localizations.aboutListTileTitle('FOO'), isNotNull); expect(localizations.aboutListTileTitle('FOO'), contains('FOO')); expect(localizations.selectedRowCountTitle(0), isNotNull); expect(localizations.selectedRowCountTitle(1), isNotNull); expect(localizations.selectedRowCountTitle(2), isNotNull); expect(localizations.selectedRowCountTitle(100), isNotNull); expect(localizations.selectedRowCountTitle(0), isNot(contains(r'$selectedRowCount'))); expect(localizations.selectedRowCountTitle(1), isNot(contains(r'$selectedRowCount'))); expect(localizations.selectedRowCountTitle(2), isNot(contains(r'$selectedRowCount'))); expect(localizations.selectedRowCountTitle(100), isNot(contains(r'$selectedRowCount'))); expect(localizations.pageRowsInfoTitle(1, 10, 100, true), isNotNull); expect(localizations.pageRowsInfoTitle(1, 10, 100, false), isNotNull); expect(localizations.pageRowsInfoTitle(1, 10, 100, true), isNot(contains(r'$firstRow'))); expect(localizations.pageRowsInfoTitle(1, 10, 100, true), isNot(contains(r'$lastRow'))); expect(localizations.pageRowsInfoTitle(1, 10, 100, true), isNot(contains(r'$rowCount'))); expect(localizations.pageRowsInfoTitle(1, 10, 100, false), isNot(contains(r'$firstRow'))); expect(localizations.pageRowsInfoTitle(1, 10, 100, false), isNot(contains(r'$lastRow'))); expect(localizations.pageRowsInfoTitle(1, 10, 100, false), isNot(contains(r'$rowCount'))); expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNotNull); expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNot(contains(r'$tabIndex'))); expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNot(contains(r'$tabCount'))); expect(() => localizations.tabLabel(tabIndex: 0, tabCount: 5), throwsAssertionError); expect(() => localizations.tabLabel(tabIndex: 2, tabCount: 0), throwsAssertionError); expect(localizations.formatHour(const TimeOfDay(hour: 10, minute: 0)), isNotNull); expect(localizations.formatMinute(const TimeOfDay(hour: 10, minute: 0)), isNotNull); expect(localizations.formatYear(DateTime(2018, 8)), isNotNull); expect(localizations.formatMediumDate(DateTime(2018, 8)), isNotNull); expect(localizations.formatFullDate(DateTime(2018, 8)), isNotNull); expect(localizations.formatMonthYear(DateTime(2018, 8)), isNotNull); expect(localizations.narrowWeekdays, isNotNull); expect(localizations.narrowWeekdays.length, 7); expect(localizations.formatDecimal(123), isNotNull); expect(localizations.formatTimeOfDay(const TimeOfDay(hour: 10, minute: 0)), isNotNull); }); } testWidgets('translations spot check', (WidgetTester tester) async { Locale locale = const Locale.fromSubtags(languageCode: 'zh'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); expect(localizations.firstPageTooltip, '第一页'); expect(localizations.lastPageTooltip, '最后一页'); locale = const Locale.fromSubtags(languageCode: 'zu'); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); expect(localizations.firstPageTooltip, 'Ikhasi lokuqala'); expect(localizations.lastPageTooltip, 'Ikhasi lokugcina'); }); testWidgets('translations spot check expansionTileExpandedHint', (WidgetTester tester) async { const Locale locale = Locale.fromSubtags(languageCode: 'en'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); expect(localizations.expansionTileExpandedHint, 'double tap to collapse'); }); testWidgets('spot check selectedRowCount translations', (WidgetTester tester) async { MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('en')); expect(localizations.selectedRowCountTitle(0), 'No items selected'); expect(localizations.selectedRowCountTitle(1), '1 item selected'); expect(localizations.selectedRowCountTitle(2), '2 items selected'); expect(localizations.selectedRowCountTitle(3), '3 items selected'); expect(localizations.selectedRowCountTitle(5), '5 items selected'); expect(localizations.selectedRowCountTitle(10), '10 items selected'); expect(localizations.selectedRowCountTitle(15), '15 items selected'); expect(localizations.selectedRowCountTitle(29), '29 items selected'); expect(localizations.selectedRowCountTitle(10000), '10,000 items selected'); expect(localizations.selectedRowCountTitle(10019), '10,019 items selected'); expect(localizations.selectedRowCountTitle(123456789), '123,456,789 items selected'); localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('es')); expect(localizations.selectedRowCountTitle(0), 'No se han seleccionado elementos'); expect(localizations.selectedRowCountTitle(1), '1 elemento seleccionado'); expect(localizations.selectedRowCountTitle(2), '2 elementos seleccionados'); expect(localizations.selectedRowCountTitle(3), '3 elementos seleccionados'); expect(localizations.selectedRowCountTitle(5), '5 elementos seleccionados'); expect(localizations.selectedRowCountTitle(10), '10 elementos seleccionados'); expect(localizations.selectedRowCountTitle(15), '15 elementos seleccionados'); expect(localizations.selectedRowCountTitle(29), '29 elementos seleccionados'); expect(localizations.selectedRowCountTitle(10000), '10.000 elementos seleccionados'); expect(localizations.selectedRowCountTitle(10019), '10.019 elementos seleccionados'); expect(localizations.selectedRowCountTitle(123456789), '123.456.789 elementos seleccionados'); localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('ro')); expect(localizations.selectedRowCountTitle(0), 'Nu există elemente selectate'); expect(localizations.selectedRowCountTitle(1), 'Un articol selectat'); expect(localizations.selectedRowCountTitle(2), '2 articole selectate'); expect(localizations.selectedRowCountTitle(3), '3 articole selectate'); expect(localizations.selectedRowCountTitle(5), '5 articole selectate'); expect(localizations.selectedRowCountTitle(10), '10 articole selectate'); expect(localizations.selectedRowCountTitle(15), '15 articole selectate'); expect(localizations.selectedRowCountTitle(29), '29 de articole selectate'); expect(localizations.selectedRowCountTitle(10000), '10.000 de articole selectate'); expect(localizations.selectedRowCountTitle(10019), '10.019 articole selectate'); expect(localizations.selectedRowCountTitle(123456789), '123.456.789 de articole selectate'); localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('km')); expect(localizations.selectedRowCountTitle(0), 'បាន​ជ្រើស​រើស​ធាតុ 0'); expect(localizations.selectedRowCountTitle(1), 'បាន​ជ្រើស​រើស​ធាតុ 1'); expect(localizations.selectedRowCountTitle(2), 'បាន​ជ្រើស​រើស​ធាតុ 2'); expect(localizations.selectedRowCountTitle(10000), 'បាន​ជ្រើស​រើស​ធាតុ 10,000'); expect(localizations.selectedRowCountTitle(123456789), 'បាន​ជ្រើស​រើស​ធាតុ 123,456,789'); }); testWidgets('spot check formatMediumDate(), formatFullDate() translations', (WidgetTester tester) async { MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('en')); expect(localizations.formatMediumDate(DateTime(2015, 7, 23)), 'Thu, Jul 23'); expect(localizations.formatFullDate(DateTime(2015, 7, 23)), 'Thursday, July 23, 2015'); localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('en', 'GB')); expect(localizations.formatMediumDate(DateTime(2015, 7, 23)), 'Thu, 23 Jul'); expect(localizations.formatFullDate(DateTime(2015, 7, 23)), 'Thursday, 23 July 2015'); localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('es')); expect(localizations.formatMediumDate(DateTime(2015, 7, 23)), 'jue, 23 jul'); expect(localizations.formatFullDate(DateTime(2015, 7, 23)), 'jueves, 23 de julio de 2015'); localizations = await GlobalMaterialLocalizations.delegate.load(const Locale('de')); expect(localizations.formatMediumDate(DateTime(2015, 7, 23)), 'Do., 23. Juli'); expect(localizations.formatFullDate(DateTime(2015, 7, 23)), 'Donnerstag, 23. Juli 2015'); }); testWidgets('Chinese resolution', (WidgetTester tester) async { Locale locale = const Locale.fromSubtags(languageCode: 'zh'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); locale = const Locale('zh', 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHantTw>()); locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'HK'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHantHk>()); locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHantTw>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHans>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHant>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHans>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHans>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHans>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHant>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHant>()); locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Latn', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Latn', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Cyrl', countryCode: 'RU'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'RU'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Cyrl'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); }); testWidgets('Serbian resolution', (WidgetTester tester) async { Locale locale = const Locale.fromSubtags(languageCode: 'sr'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSr>()); locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSrCyrl>()); locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSrLatn>()); locale = const Locale.fromSubtags(languageCode: 'sr', countryCode: 'SR'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSr>()); locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl', countryCode: 'SR'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSrCyrl>()); locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn', countryCode: 'SR'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSrLatn>()); locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSrCyrl>()); locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSrLatn>()); locale = const Locale.fromSubtags(languageCode: 'sr', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationSr>()); }); testWidgets('Misc resolution', (WidgetTester tester) async { Locale locale = const Locale.fromSubtags(languageCode: 'en'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Cyrl'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'AU'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEnAu>()); locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'GB'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEnGb>()); locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'SG'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEnSg>()); locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'MX'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hant'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hant', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hans', countryCode: 'CN'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); locale = const Locale.fromSubtags(languageCode: 'es'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEs>()); locale = const Locale.fromSubtags(languageCode: 'es', countryCode: '419'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEs419>()); locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'MX'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEsMx>()); locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEsUs>()); locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'AR'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEsAr>()); locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'ES'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEs>()); locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: 'Latn'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEs>()); locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: 'Latn', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEsUs>()); locale = const Locale.fromSubtags(languageCode: 'fr'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationFr>()); locale = const Locale.fromSubtags(languageCode: 'fr', countryCode: 'CA'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationFrCa>()); locale = const Locale.fromSubtags(languageCode: 'de'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationDe>()); locale = const Locale.fromSubtags(languageCode: 'de', countryCode: 'CH'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationDeCh>()); locale = const Locale.fromSubtags(languageCode: 'th'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationTh>()); locale = const Locale.fromSubtags(languageCode: 'ru'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationRu>()); }); testWidgets('Chinese translations spot check', (WidgetTester tester) async { Locale locale = const Locale.fromSubtags(languageCode: 'zh'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); expect(localizations.alertDialogLabel, '提醒'); expect(localizations.anteMeridiemAbbreviation, '上午'); expect(localizations.closeButtonLabel, '关闭'); expect(localizations.okButtonLabel, '确定'); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHans>()); expect(localizations.alertDialogLabel, '提醒'); expect(localizations.anteMeridiemAbbreviation, '上午'); expect(localizations.closeButtonLabel, '关闭'); expect(localizations.okButtonLabel, '确定'); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHant>()); expect(localizations.alertDialogLabel, '通知'); expect(localizations.anteMeridiemAbbreviation, '上午'); expect(localizations.closeButtonLabel, '關閉'); expect(localizations.okButtonLabel, '確定'); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHantTw>()); expect(localizations.alertDialogLabel, '快訊'); expect(localizations.anteMeridiemAbbreviation, '上午'); expect(localizations.closeButtonLabel, '關閉'); expect(localizations.okButtonLabel, '確定'); locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'HK'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZhHantHk>()); expect(localizations.alertDialogLabel, '通知'); expect(localizations.anteMeridiemAbbreviation, '上午'); expect(localizations.closeButtonLabel, '關閉'); expect(localizations.okButtonLabel, '確定'); }); // Regression test for https://github.com/flutter/flutter/issues/36704. testWidgets('kn arb file should be properly Unicode escaped', (WidgetTester tester) async { final File file = File( path.join(rootDirectoryPath, 'lib', 'src', 'l10n', 'material_kn.arb'), ); final Map<String, dynamic> bundle = json.decode( file.readAsStringSync(), ) as Map<String, dynamic>; // Encodes the arb resource values if they have not already been // encoded. encodeBundleTranslations(bundle); // Generates the encoded arb output file in as a string. final String encodedArbFile = generateArbString(bundle); // After encoding the bundles, the generated string should match // the existing material_kn.arb. if (Platform.isWindows) { // On Windows, the character '\n' can output the two-character sequence // '\r\n' (and when reading the file back, '\r\n' is translated back // into a single '\n' character). expect(file.readAsStringSync().replaceAll('\r\n', '\n'), encodedArbFile); } else { expect(file.readAsStringSync(), encodedArbFile); } }); // Regression test for https://github.com/flutter/flutter/issues/110451. testWidgets('Finnish translation for tab label', (WidgetTester tester) async { const Locale locale = Locale('fi'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationFi>()); expect(localizations.tabLabel(tabIndex: 1, tabCount: 2), 'Välilehti 1 kautta 2'); }); // Regression test for https://github.com/flutter/flutter/issues/138728. testWidgets('Share button label on Material', (WidgetTester tester) async { const Locale locale = Locale('en'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationEn>()); expect(localizations.shareButtonLabel, 'Share'); }); // Regression test for https://github.com/flutter/flutter/issues/141764 testWidgets('zh-CN translation for look up label', (WidgetTester tester) async { const Locale locale = Locale('zh'); expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA<MaterialLocalizationZh>()); expect(localizations.lookUpButtonLabel, '查询'); }); }
flutter/packages/flutter_localizations/test/material/translations_test.dart/0
{ "file_path": "flutter/packages/flutter_localizations/test/material/translations_test.dart", "repo_id": "flutter", "token_count": 10732 }
803
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /// Testing library for flutter, built on top of `package:test`. /// /// ## Test Configuration /// /// The testing library exposes a few constructs by which projects may configure /// their tests. /// /// ### Per test or per file /// /// Due to its use of `package:test` as a foundation, the testing library /// allows for tests to be initialized using the existing constructs found in /// `package:test`. These include the [setUp] and [setUpAll] methods. /// /// ### Per directory hierarchy /// /// In addition to the constructs provided by `package:test`, this library /// supports the configuration of tests at the directory level. /// /// Before a test file is executed, the Flutter test framework will scan up the /// directory hierarchy, starting from the directory in which the test file /// resides, looking for a file named `flutter_test_config.dart`. If it finds /// such a configuration file, the file will be assumed to have a `main` method /// with the following signature: /// /// ```dart /// Future<void> testExecutable(FutureOr<void> Function() testMain) async { } /// ``` /// /// The test framework will execute that method and pass it the `main()` method /// of the test. It is then the responsibility of the configuration file's /// `main()` method to invoke the test's `main()` method. /// /// After the test framework finds a configuration file, it will stop scanning /// the directory hierarchy. In other words, the test configuration file that /// lives closest to the test file will be selected, and all other test /// configuration files will be ignored. Likewise, it will stop scanning the /// directory hierarchy when it finds a `pubspec.yaml`, since that signals the /// root of the project. /// /// If no configuration file is located, the test will be executed like normal. /// /// See also: /// /// * [WidgetController.hitTestWarningShouldBeFatal], which can be set /// in a `flutter_test_config.dart` file to turn warnings printed by /// [WidgetTester.tap] and similar APIs into fatal errors. /// * [debugCheckIntrinsicSizes], which can be set in a /// `flutter_test_config.dart` file to enable deeper [RenderBox] /// tests of the intrinsic APIs automatically while laying out widgets. library flutter_test; export 'dart:async' show Future; export 'src/_goldens_io.dart' if (dart.library.html) 'src/_goldens_web.dart'; export 'src/_matchers_io.dart' if (dart.library.html) 'src/_matchers_web.dart'; export 'src/accessibility.dart'; export 'src/animation_sheet.dart'; export 'src/binding.dart'; export 'src/controller.dart'; export 'src/deprecated.dart'; export 'src/event_simulation.dart'; export 'src/finders.dart'; export 'src/frame_timing_summarizer.dart'; export 'src/goldens.dart'; export 'src/image.dart'; export 'src/matchers.dart'; export 'src/mock_canvas.dart'; export 'src/mock_event_channel.dart'; export 'src/nonconst.dart'; export 'src/platform.dart'; export 'src/recording_canvas.dart'; export 'src/restoration.dart'; export 'src/stack_manipulation.dart'; export 'src/test_async_utils.dart'; export 'src/test_compat.dart'; export 'src/test_default_binary_messenger.dart'; export 'src/test_exception_reporter.dart'; export 'src/test_pointer.dart'; export 'src/test_text_input.dart'; export 'src/test_vsync.dart'; export 'src/tree_traversal.dart'; export 'src/widget_tester.dart'; export 'src/window.dart';
flutter/packages/flutter_test/lib/flutter_test.dart/0
{ "file_path": "flutter/packages/flutter_test/lib/flutter_test.dart", "repo_id": "flutter", "token_count": 1045 }
804
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:typed_data'; import 'dart:ui' as ui; import 'test_async_utils.dart'; final Map<int, ui.Image> _cache = <int, ui.Image>{}; /// Creates an arbitrarily sized image for testing. /// /// If the [cache] parameter is set to true, the image will be cached for the /// rest of this suite. This is normally desirable, assuming a test suite uses /// images with the same dimensions in most tests, as it will save on memory /// usage and CPU time over the course of the suite. However, it should be /// avoided for images that are used only once in a test suite, especially if /// the image is large, as it will require holding on to the memory for that /// image for the duration of the suite. /// /// This method requires real async work, and will not work properly in the /// [FakeAsync] zones set up by [testWidgets]. Typically, it should be invoked /// as a setup step before [testWidgets] are run, such as [setUp] or [setUpAll]. /// If needed, it can be invoked using [WidgetTester.runAsync]. Future<ui.Image> createTestImage({ int width = 1, int height = 1, bool cache = true, }) => TestAsyncUtils.guard(() async { assert(width > 0); assert(height > 0); final int cacheKey = Object.hash(width, height); if (cache && _cache.containsKey(cacheKey)) { return _cache[cacheKey]!.clone(); } final ui.Image image = await _createImage(width, height); if (cache) { _cache[cacheKey] = image.clone(); } return image; }); Future<ui.Image> _createImage(int width, int height) async { final Completer<ui.Image> completer = Completer<ui.Image>(); ui.decodeImageFromPixels( Uint8List.fromList(List<int>.filled(width * height * 4, 0)), width, height, ui.PixelFormat.rgba8888, (ui.Image image) { completer.complete(image); }, ); return completer.future; }
flutter/packages/flutter_test/lib/src/image.dart/0
{ "file_path": "flutter/packages/flutter_test/lib/src/image.dart", "repo_id": "flutter", "token_count": 640 }
805
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/scheduler.dart'; /// A [TickerProvider] that creates a standalone ticker. /// /// Useful in tests that create an [AnimationController] outside of the widget /// tree. class TestVSync implements TickerProvider { /// Creates a ticker provider that creates standalone tickers. const TestVSync(); @override Ticker createTicker(TickerCallback onTick) => Ticker(onTick); }
flutter/packages/flutter_test/lib/src/test_vsync.dart/0
{ "file_path": "flutter/packages/flutter_test/lib/src/test_vsync.dart", "repo_id": "flutter", "token_count": 157 }
806
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // TODO(gspencergoog): Remove this tag once this test's state leaks/test // dependencies have been fixed. // https://github.com/flutter/flutter/issues/85160 // Fails with "flutter test --test-randomize-ordering-seed=20210721" @Tags(<String>['no-shuffle']) library; import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { final AutomatedTestWidgetsFlutterBinding binding = AutomatedTestWidgetsFlutterBinding(); group(TestViewConfiguration, () { test('is initialized with top-level window if one is not provided', () { // The code below will throw without the default. TestViewConfiguration(size: const Size(1280.0, 800.0)); }); }); group(AutomatedTestWidgetsFlutterBinding, () { test('allows setting defaultTestTimeout to 5 minutes', () { binding.defaultTestTimeout = const Timeout(Duration(minutes: 5)); expect(binding.defaultTestTimeout.duration, const Duration(minutes: 5)); }); }); // The next three tests must run in order -- first using `test`, then `testWidgets`, then `test` again. int order = 0; test('Initializes httpOverrides and testTextInput', () async { assert(order == 0); expect(binding.testTextInput, isNotNull); expect(binding.testTextInput.isRegistered, isFalse); expect(HttpOverrides.current, isNotNull); order += 1; }); testWidgets('Registers testTextInput', (WidgetTester tester) async { assert(order == 1); expect(tester.testTextInput.isRegistered, isTrue); order += 1; }); test('Unregisters testTextInput', () async { assert(order == 2); expect(binding.testTextInput.isRegistered, isFalse); order += 1; }); testWidgets('timeStamp should be accurate to microsecond precision', (WidgetTester tester) async { final WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); await tester.pumpWidget(const CircularProgressIndicator()); final Duration timeStampBefore = widgetsBinding.currentSystemFrameTimeStamp; await tester.pump(const Duration(microseconds: 12345)); final Duration timeStampAfter = widgetsBinding.currentSystemFrameTimeStamp; expect(timeStampAfter - timeStampBefore, const Duration(microseconds: 12345)); }); group('elapseBlocking', () { testWidgets('timer is not called', (WidgetTester tester) async { bool timerCalled = false; Timer.run(() => timerCalled = true); binding.elapseBlocking(const Duration(seconds: 1)); expect(timerCalled, false); binding.idle(); }); testWidgets('can use to simulate slow build', (WidgetTester tester) async { final DateTime beforeTime = binding.clock.now(); await tester.pumpWidget(Builder(builder: (_) { bool timerCalled = false; Timer.run(() => timerCalled = true); binding.elapseBlocking(const Duration(seconds: 1)); // if we use `delayed` instead of `elapseBlocking`, such as // binding.delayed(const Duration(seconds: 1)); // the timer will be called here. Surely, that violates how // a flutter widget build works expect(timerCalled, false); return Container(); })); expect(binding.clock.now(), beforeTime.add(const Duration(seconds: 1))); binding.idle(); }); }); testWidgets('Assets in the tester can be loaded without turning event loop', (WidgetTester tester) async { bool responded = false; // The particular asset does not matter, as long as it exists. rootBundle.load('AssetManifest.json').then((ByteData data) { responded = true; }); expect(responded, true); }); }
flutter/packages/flutter_test/test/bindings_test.dart/0
{ "file_path": "flutter/packages/flutter_test/test/bindings_test.dart", "repo_id": "flutter", "token_count": 1309 }
807
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; class MyPainter extends CustomPainter { const MyPainter({ required this.color, }); final Color color; @override void paint(Canvas canvas, Size size) { canvas.drawColor(color, BlendMode.color); } @override bool shouldRepaint(MyPainter oldDelegate) { return true; } } @immutable class MethodAndArguments { const MethodAndArguments(this.method, this.arguments); final Symbol method; final List<dynamic> arguments; @override bool operator ==(Object other) { if (!(other is MethodAndArguments && other.method == method)) { return false; } for (int i = 0; i < arguments.length; i++) { if (arguments[i] != other.arguments[i]) { return false; } } return true; } @override int get hashCode => method.hashCode; @override String toString() => '$method, $arguments'; } void main() { group('something', () { testWidgets('matches when the predicate returns true', (WidgetTester tester) async { await tester.pumpWidget( const CustomPaint( painter: MyPainter(color: Colors.transparent), child: SizedBox(width: 50, height: 50), ), ); final List<MethodAndArguments> methodsAndArguments = <MethodAndArguments>[]; expect( tester.renderObject(find.byType(CustomPaint)), paints..something((Symbol method, List<dynamic> arguments) { methodsAndArguments.add(MethodAndArguments(method, arguments)); return method == #drawColor; }), ); expect( methodsAndArguments, <MethodAndArguments>[ const MethodAndArguments(#save, <dynamic>[]), const MethodAndArguments(#drawColor, <dynamic>[Colors.transparent, BlendMode.color]), // The #restore call is never evaluated ], ); }); testWidgets('fails when the predicate always returns false', (WidgetTester tester) async { await tester.pumpWidget( const CustomPaint( painter: MyPainter(color: Colors.transparent), child: SizedBox(width: 50, height: 50), ), ); final List<MethodAndArguments> methodsAndArguments = <MethodAndArguments>[]; expect( tester.renderObject(find.byType(CustomPaint)), isNot( paints..something((Symbol method, List<dynamic> arguments) { methodsAndArguments.add(MethodAndArguments(method, arguments)); return false; }), ), ); expect( methodsAndArguments, <MethodAndArguments>[ const MethodAndArguments(#save, <dynamic>[]), const MethodAndArguments(#drawColor, <dynamic>[Colors.transparent, BlendMode.color]), const MethodAndArguments(#restore, <dynamic>[]), ], ); }); testWidgets('fails when the predicate throws', (WidgetTester tester) async { await tester.pumpWidget( const CustomPaint( painter: MyPainter(color: Colors.transparent), child: SizedBox(width: 50, height: 50), ), ); final List<MethodAndArguments> methodsAndArguments = <MethodAndArguments>[]; expect( tester.renderObject(find.byType(CustomPaint)), isNot( paints..something((Symbol method, List<dynamic> arguments) { methodsAndArguments.add(MethodAndArguments(method, arguments)); if (method == #save) { return false; } if (method == #drawColor) { fail('fail'); } return true; }), ), ); expect( methodsAndArguments, <MethodAndArguments>[ const MethodAndArguments(#save, <dynamic>[]), const MethodAndArguments(#drawColor, <dynamic>[Colors.transparent, BlendMode.color]), // The #restore call is never evaluated ], ); }); }); group('everything', () { testWidgets('matches when the predicate always returns true', (WidgetTester tester) async { await tester.pumpWidget( const CustomPaint( painter: MyPainter(color: Colors.transparent), child: SizedBox(width: 50, height: 50), ), ); final List<MethodAndArguments> methodsAndArguments = <MethodAndArguments>[]; expect( tester.renderObject(find.byType(CustomPaint)), paints..everything((Symbol method, List<dynamic> arguments) { methodsAndArguments.add(MethodAndArguments(method, arguments)); return true; }), ); expect( methodsAndArguments, <MethodAndArguments>[ const MethodAndArguments(#save, <dynamic>[]), const MethodAndArguments(#drawColor, <dynamic>[Colors.transparent, BlendMode.color]), const MethodAndArguments(#restore, <dynamic>[]), ], ); }); testWidgets('fails when the predicate returns false', (WidgetTester tester) async { await tester.pumpWidget( const CustomPaint( painter: MyPainter(color: Colors.transparent), child: SizedBox(width: 50, height: 50), ), ); final List<MethodAndArguments> methodsAndArguments = <MethodAndArguments>[]; expect( tester.renderObject(find.byType(CustomPaint)), isNot( paints..everything((Symbol method, List<dynamic> arguments) { methodsAndArguments.add(MethodAndArguments(method, arguments)); // returns false on #drawColor return method == #restore || method == #save; }), ), ); expect( methodsAndArguments, <MethodAndArguments>[ const MethodAndArguments(#save, <dynamic>[]), const MethodAndArguments(#drawColor, <dynamic>[Colors.transparent, BlendMode.color]), // The #restore call is never evaluated ], ); }); testWidgets('fails if the predicate ever throws', (WidgetTester tester) async { await tester.pumpWidget( const CustomPaint( painter: MyPainter(color: Colors.transparent), child: SizedBox(width: 50, height: 50), ), ); final List<MethodAndArguments> methodsAndArguments = <MethodAndArguments>[]; expect( tester.renderObject(find.byType(CustomPaint)), isNot( paints..everything((Symbol method, List<dynamic> arguments) { methodsAndArguments.add(MethodAndArguments(method, arguments)); if (method == #drawColor) { fail('failed '); } return true; }), ), ); expect( methodsAndArguments, <MethodAndArguments>[ const MethodAndArguments(#save, <dynamic>[]), const MethodAndArguments(#drawColor, <dynamic>[Colors.transparent, BlendMode.color]), // The #restore call is never evaluated ], ); }); }); }
flutter/packages/flutter_test/test/mock_canvas_test.dart/0
{ "file_path": "flutter/packages/flutter_test/test/mock_canvas_test.dart", "repo_id": "flutter", "token_count": 3059 }
808
include: ../analysis_options.yaml linter: rules: avoid_print: false # These are CLI tools which print as a matter of course.
flutter/packages/flutter_tools/bin/analysis_options.yaml/0
{ "file_path": "flutter/packages/flutter_tools/bin/analysis_options.yaml", "repo_id": "flutter", "token_count": 42 }
809
// This script is used to initialize the build in a module or plugin project. // During this phase, the script applies the Maven plugin and configures the // destination of the local repository. // The local repository will contain the AAR and POM files. import java.nio.file.Paths import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.publish.maven.MavenPublication void configureProject(Project project, String outputDir) { if (!project.hasProperty("android")) { throw new GradleException("Android property not found.") } if (!project.android.hasProperty("libraryVariants")) { throw new GradleException("Can't generate AAR on a non Android library project."); } // Snapshot versions include the timestamp in the artifact name. // Therefore, remove the snapshot part, so new runs of `flutter build aar` overrides existing artifacts. // This version isn't relevant in Flutter since the pub version is used // to resolve dependencies. project.version = project.version.replace("-SNAPSHOT", "") if (project.hasProperty("buildNumber")) { project.version = project.property("buildNumber") } project.components.forEach { component -> if (component.name != "all") { addAarTask(project, component) } } project.publishing { repositories { maven { url = uri("file://${outputDir}/outputs/repo") } } } if (!project.property("is-plugin").toBoolean()) { return } String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://storage.googleapis.com" String engineRealm = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.realm") .toFile().text.trim() if (engineRealm) { engineRealm = engineRealm + "/" } // This is a Flutter plugin project. Plugin projects don't apply the Flutter Gradle plugin, // as a result, add the dependency on the embedding. project.repositories { maven { url "$storageUrl/${engineRealm}download.flutter.io" } } String engineVersion = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.version") .toFile().text.trim() project.dependencies { // Add the embedding dependency. compileOnly ("io.flutter:flutter_embedding_release:1.0.0-$engineVersion") { // We only need to expose io.flutter.plugin.* // No need for the embedding transitive dependencies. transitive = false } } } void configurePlugin(Project project, String outputDir) { if (!project.hasProperty("android")) { // A plugin doesn't support the Android platform when this property isn't defined in the plugin. return } configureProject(project, outputDir) } String getFlutterRoot(Project project) { if (!project.hasProperty("flutter-root")) { throw new GradleException("The `-Pflutter-root` flag must be specified.") } return project.property("flutter-root") } void addAarTask(Project project, component) { String variantName = component.name.capitalize() String taskName = "assembleAar$variantName" project.tasks.create(name: taskName) { // This check is required to be able to configure the archives before `publish` runs. if (!project.gradle.startParameter.taskNames.contains(taskName)) { return } // Create a default MavenPublication for the variant (except "all" since that is used to publish artifacts in the new way) project.publishing.publications.create(component.name, MavenPublication) { pub -> groupId = "${pub.groupId}" artifactId = "${pub.artifactId}_${pub.name}" version = "${pub.version}" from component } // Generate the Maven artifacts. finalizedBy "publish" } } // maven-publish has to be applied _before_ the project gets evaluated, but some of the code in // `configureProject` requires the project to be evaluated. Apply the maven plugin to all projects, but // only configure it if it matches the conditions in `projectsEvaluated` allprojects { apply plugin: "maven-publish" } projectsEvaluated { assert rootProject.hasProperty("is-plugin") if (rootProject.property("is-plugin").toBoolean()) { assert rootProject.hasProperty("output-dir") // In plugin projects, the root project is the plugin. configureProject(rootProject, rootProject.property("output-dir")) return } // The module project is the `:flutter` subproject. Project moduleProject = rootProject.subprojects.find { it.name == "flutter" } assert moduleProject != null assert moduleProject.hasProperty("output-dir") configureProject(moduleProject, moduleProject.property("output-dir")) // Gets the plugin subprojects. Set<Project> modulePlugins = rootProject.subprojects.findAll { it.name != "flutter" && it.name != "app" } // When a module is built as a Maven artifacts, plugins must also be built this way // because the module POM's file will include a dependency on the plugin Maven artifact. // This is due to the Android Gradle Plugin expecting all library subprojects to be published // as Maven artifacts. modulePlugins.each { pluginProject -> configurePlugin(pluginProject, moduleProject.property("output-dir")) moduleProject.android.libraryVariants.all { variant -> // Configure the `assembleAar<variantName>` task for each plugin's projects and make // the module's equivalent task depend on the plugin's task. String variantName = variant.name.capitalize() moduleProject.tasks.findByPath("assembleAar$variantName") .dependsOn(pluginProject.tasks.findByPath("assembleAar$variantName")) } } }
flutter/packages/flutter_tools/gradle/aar_init_script.gradle/0
{ "file_path": "flutter/packages/flutter_tools/gradle/aar_init_script.gradle", "repo_id": "flutter", "token_count": 2112 }
810
flutter
flutter/packages/flutter_tools/ide_templates/intellij/.idea/.name.copy.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/ide_templates/intellij/.idea/.name.copy.tmpl", "repo_id": "flutter", "token_count": 2 }
811
<component name="ProjectRunConfigurationManager"> <configuration default="false" name="layers - hello_world" type="FlutterRunConfigurationType" factoryName="Flutter"> <option name="filePath" value="$PROJECT_DIR$/examples/layers/widgets/hello_world.dart" /> <method /> </configuration> </component>
flutter/packages/flutter_tools/ide_templates/intellij/.idea/runConfigurations/layers___hello_world.xml.copy.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/ide_templates/intellij/.idea/runConfigurations/layers___hello_world.xml.copy.tmpl", "repo_id": "flutter", "token_count": 95 }
812
<component name="ProjectRunConfigurationManager"> <configuration default="false" name="manual_tests - raw_keyboard" type="FlutterRunConfigurationType" factoryName="Flutter"> <option name="filePath" value="$PROJECT_DIR$/dev/manual_tests/lib/raw_keyboard.dart" /> <method /> </configuration> </component>
flutter/packages/flutter_tools/ide_templates/intellij/.idea/runConfigurations/manual_tests___raw_keyboard.xml.copy.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/ide_templates/intellij/.idea/runConfigurations/manual_tests___raw_keyboard.xml.copy.tmpl", "repo_id": "flutter", "token_count": 99 }
813
<?xml version="1.0" encoding="UTF-8"?> <module type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$/android"> <sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" /> </content> <orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="Flutter for Android" level="project" /> </component> </module>
flutter/packages/flutter_tools/ide_templates/intellij/examples/hello_world/android.iml.copy.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/ide_templates/intellij/examples/hello_world/android.iml.copy.tmpl", "repo_id": "flutter", "token_count": 205 }
814
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'runner.dart' as runner; import 'src/artifacts.dart'; import 'src/base/context.dart'; import 'src/base/io.dart'; import 'src/base/logger.dart'; import 'src/base/platform.dart'; import 'src/base/template.dart'; import 'src/base/terminal.dart'; import 'src/base/user_messages.dart'; import 'src/build_system/build_targets.dart'; import 'src/cache.dart'; import 'src/commands/analyze.dart'; import 'src/commands/assemble.dart'; import 'src/commands/attach.dart'; import 'src/commands/build.dart'; import 'src/commands/channel.dart'; import 'src/commands/clean.dart'; import 'src/commands/config.dart'; import 'src/commands/create.dart'; import 'src/commands/custom_devices.dart'; import 'src/commands/daemon.dart'; import 'src/commands/debug_adapter.dart'; import 'src/commands/devices.dart'; import 'src/commands/doctor.dart'; import 'src/commands/downgrade.dart'; import 'src/commands/drive.dart'; import 'src/commands/emulators.dart'; import 'src/commands/generate.dart'; import 'src/commands/generate_localizations.dart'; import 'src/commands/ide_config.dart'; import 'src/commands/install.dart'; import 'src/commands/logs.dart'; import 'src/commands/make_host_app_editable.dart'; import 'src/commands/packages.dart'; import 'src/commands/precache.dart'; import 'src/commands/run.dart'; import 'src/commands/screenshot.dart'; import 'src/commands/shell_completion.dart'; import 'src/commands/symbolize.dart'; import 'src/commands/test.dart'; import 'src/commands/update_packages.dart'; import 'src/commands/upgrade.dart'; import 'src/devtools_launcher.dart'; import 'src/features.dart'; import 'src/globals.dart' as globals; // Files in `isolated` are intentionally excluded from google3 tooling. import 'src/isolated/build_targets.dart'; import 'src/isolated/mustache_template.dart'; import 'src/isolated/native_assets/native_assets.dart'; import 'src/isolated/native_assets/test/native_assets.dart'; import 'src/isolated/resident_web_runner.dart'; import 'src/pre_run_validator.dart'; import 'src/project_validator.dart'; import 'src/resident_runner.dart'; import 'src/runner/flutter_command.dart'; import 'src/web/web_runner.dart'; /// Main entry point for commands. /// /// This function is intended to be used from the `flutter` command line tool. Future<void> main(List<String> args) async { final bool veryVerbose = args.contains('-vv'); final bool verbose = args.contains('-v') || args.contains('--verbose') || veryVerbose; final bool prefixedErrors = args.contains('--prefixed-errors'); // Support the -? Powershell help idiom. final int powershellHelpIndex = args.indexOf('-?'); if (powershellHelpIndex != -1) { args[powershellHelpIndex] = '-h'; } final bool doctor = (args.isNotEmpty && args.first == 'doctor') || (args.length == 2 && verbose && args.last == 'doctor'); final bool help = args.contains('-h') || args.contains('--help') || (args.isNotEmpty && args.first == 'help') || (args.length == 1 && verbose); final bool muteCommandLogging = (help || doctor) && !veryVerbose; final bool verboseHelp = help && verbose; final bool daemon = args.contains('daemon'); final bool runMachine = (args.contains('--machine') && args.contains('run')) || (args.contains('--machine') && args.contains('attach')); // Cache.flutterRoot must be set early because other features use it (e.g. // enginePath's initializer uses it). This can only work with the real // instances of the platform or filesystem, so just use those. Cache.flutterRoot = Cache.defaultFlutterRoot( platform: const LocalPlatform(), fileSystem: globals.localFileSystem, userMessages: UserMessages(), ); await runner.run( args, () => generateCommands( verboseHelp: verboseHelp, verbose: verbose, ), verbose: verbose, muteCommandLogging: muteCommandLogging, verboseHelp: verboseHelp, overrides: <Type, Generator>{ // The web runner is not supported in google3 because it depends // on dwds. WebRunnerFactory: () => DwdsWebRunnerFactory(), // The mustache dependency is different in google3 TemplateRenderer: () => const MustacheTemplateRenderer(), // The devtools launcher is not supported in google3 because it depends on // devtools source code. DevtoolsLauncher: () => DevtoolsServerLauncher( processManager: globals.processManager, dartExecutable: globals.artifacts!.getArtifactPath(Artifact.engineDartBinary), logger: globals.logger, botDetector: globals.botDetector, ), BuildTargets: () => const BuildTargetsImpl(), Logger: () { final LoggerFactory loggerFactory = LoggerFactory( outputPreferences: globals.outputPreferences, terminal: globals.terminal, stdio: globals.stdio, ); return loggerFactory.createLogger( daemon: daemon, machine: runMachine, verbose: verbose && !muteCommandLogging, prefixedErrors: prefixedErrors, windows: globals.platform.isWindows, ); }, AnsiTerminal: () { return AnsiTerminal( stdio: globals.stdio, platform: globals.platform, now: DateTime.now(), // So that we don't animate anything before calling applyFeatureFlags, default // the animations to disabled in real apps. defaultCliAnimationEnabled: false, ); // runner.run calls "terminal.applyFeatureFlags()" }, PreRunValidator: () => PreRunValidator(fileSystem: globals.fs), }, shutdownHooks: globals.shutdownHooks, ); } List<FlutterCommand> generateCommands({ required bool verboseHelp, required bool verbose, }) => <FlutterCommand>[ AnalyzeCommand( verboseHelp: verboseHelp, fileSystem: globals.fs, platform: globals.platform, processManager: globals.processManager, logger: globals.logger, terminal: globals.terminal, artifacts: globals.artifacts!, // new ProjectValidators should be added here for the --suggestions to run allProjectValidators: <ProjectValidator>[ GeneralInfoProjectValidator(), VariableDumpMachineProjectValidator( logger: globals.logger, fileSystem: globals.fs, platform: globals.platform, ), ], suppressAnalytics: globals.flutterUsage.suppressAnalytics, ), AssembleCommand(verboseHelp: verboseHelp, buildSystem: globals.buildSystem), AttachCommand( verboseHelp: verboseHelp, stdio: globals.stdio, logger: globals.logger, terminal: globals.terminal, signals: globals.signals, platform: globals.platform, processInfo: globals.processInfo, fileSystem: globals.fs, nativeAssetsBuilder: const HotRunnerNativeAssetsBuilderImpl(), ), BuildCommand( artifacts: globals.artifacts!, fileSystem: globals.fs, buildSystem: globals.buildSystem, osUtils: globals.os, processUtils: globals.processUtils, verboseHelp: verboseHelp, androidSdk: globals.androidSdk, logger: globals.logger, ), ChannelCommand(verboseHelp: verboseHelp), CleanCommand(verbose: verbose), ConfigCommand(verboseHelp: verboseHelp), CustomDevicesCommand( customDevicesConfig: globals.customDevicesConfig, operatingSystemUtils: globals.os, terminal: globals.terminal, platform: globals.platform, featureFlags: featureFlags, processManager: globals.processManager, fileSystem: globals.fs, logger: globals.logger ), CreateCommand(verboseHelp: verboseHelp), DaemonCommand(hidden: !verboseHelp), DebugAdapterCommand(verboseHelp: verboseHelp), DevicesCommand(verboseHelp: verboseHelp), DoctorCommand(verbose: verbose), DowngradeCommand(verboseHelp: verboseHelp, logger: globals.logger), DriveCommand(verboseHelp: verboseHelp, fileSystem: globals.fs, logger: globals.logger, platform: globals.platform, signals: globals.signals, ), EmulatorsCommand(), GenerateCommand(), GenerateLocalizationsCommand( fileSystem: globals.fs, logger: globals.logger, artifacts: globals.artifacts!, processManager: globals.processManager, ), InstallCommand( verboseHelp: verboseHelp, ), LogsCommand( sigint: ProcessSignal.sigint, sigterm: ProcessSignal.sigterm, ), MakeHostAppEditableCommand(), PackagesCommand(), PrecacheCommand( verboseHelp: verboseHelp, cache: globals.cache, logger: globals.logger, platform: globals.platform, featureFlags: featureFlags, ), RunCommand( verboseHelp: verboseHelp, nativeAssetsBuilder: const HotRunnerNativeAssetsBuilderImpl(), ), ScreenshotCommand(fs: globals.fs), ShellCompletionCommand(), TestCommand( verboseHelp: verboseHelp, verbose: verbose, nativeAssetsBuilder: const TestCompilerNativeAssetsBuilderImpl(), ), UpgradeCommand(verboseHelp: verboseHelp), SymbolizeCommand( stdio: globals.stdio, fileSystem: globals.fs, ), // Development-only commands. These are always hidden, IdeConfigCommand(), UpdatePackagesCommand(), ]; /// An abstraction for instantiation of the correct logger type. /// /// Our logger class hierarchy and runtime requirements are overly complicated. class LoggerFactory { LoggerFactory({ required Terminal terminal, required Stdio stdio, required OutputPreferences outputPreferences, StopwatchFactory stopwatchFactory = const StopwatchFactory(), }) : _terminal = terminal, _stdio = stdio, _stopwatchFactory = stopwatchFactory, _outputPreferences = outputPreferences; final Terminal _terminal; final Stdio _stdio; final StopwatchFactory _stopwatchFactory; final OutputPreferences _outputPreferences; /// Create the appropriate logger for the current platform and configuration. Logger createLogger({ required bool verbose, required bool prefixedErrors, required bool machine, required bool daemon, required bool windows, }) { Logger logger; if (windows) { logger = WindowsStdoutLogger( terminal: _terminal, stdio: _stdio, outputPreferences: _outputPreferences, stopwatchFactory: _stopwatchFactory, ); } else { logger = StdoutLogger( terminal: _terminal, stdio: _stdio, outputPreferences: _outputPreferences, stopwatchFactory: _stopwatchFactory ); } if (verbose) { logger = VerboseLogger(logger, stopwatchFactory: _stopwatchFactory); } if (prefixedErrors) { logger = PrefixedErrorLogger(logger); } if (daemon) { return NotifyingLogger(verbose: verbose, parent: logger); } if (machine) { return AppRunLogger(parent: logger); } return logger; } }
flutter/packages/flutter_tools/lib/executable.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/executable.dart", "repo_id": "flutter", "token_count": 3953 }
815
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:xml/xml.dart'; import 'package:yaml/yaml.dart'; import '../base/deferred_component.dart'; import '../base/error_handling_io.dart'; import '../base/file_system.dart'; import '../build_system/build_system.dart'; import 'deferred_components_validator.dart'; /// A class to configure and run deferred component setup verification checks /// and tasks. /// /// Once constructed, checks and tasks can be executed by calling the respective /// methods. The results of the checks are stored internally and can be /// displayed to the user by calling [displayResults]. class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator { /// Constructs a validator instance. /// /// The [env] property is used to locate the project files that are checked. /// /// The [templatesDir] parameter is optional. If null, the tool's default /// templates directory will be used. /// /// When [exitOnFail] is set to true, the [handleResults] and [attemptToolExit] /// methods will exit the tool when this validator detects a recommended /// change. This defaults to true. DeferredComponentsGenSnapshotValidator(this.env, { bool exitOnFail = true, String? title, }) : super(env.projectDir, env.logger, env.platform, exitOnFail: exitOnFail, title: title); /// The build environment that should be used to find the input files to run /// checks against. /// /// The checks in this class are meant to be used as part of a build process, /// so an environment should be available. final Environment env; // The key used to identify the metadata element as the loading unit id to // deferred component mapping. static const String _mappingKey = 'io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping'; /// Checks if the base module `app`'s `AndroidManifest.xml` contains the /// required meta-data that maps loading units to deferred components. /// /// Returns true if the check passed with no recommended changes, and false /// otherwise. /// /// Flutter engine uses a manifest meta-data mapping to determine which /// deferred component includes a particular loading unit id. This method /// checks if `app`'s `AndroidManifest.xml` contains this metadata. If not, it /// will generate a modified AndroidManifest.xml with the correct metadata /// entry. /// /// An example mapping: /// /// 2:componentA,3:componentB,4:componentC /// /// Where loading unit 2 is included in componentA, loading unit 3 is included /// in componentB, and loading unit 4 is included in componentC. bool checkAppAndroidManifestComponentLoadingUnitMapping(List<DeferredComponent> components, List<LoadingUnit> generatedLoadingUnits) { final Directory androidDir = projectDir.childDirectory('android'); inputs.add(projectDir.childFile('pubspec.yaml')); // We do not use the Xml package to handle the writing, as we do not want to // erase any user applied formatting and comments. The changes can be // applied with dart io and custom parsing. final File appManifestFile = androidDir .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); inputs.add(appManifestFile); if (!appManifestFile.existsSync()) { invalidFiles[appManifestFile.path] = 'Error: $appManifestFile does not ' 'exist or could not be found. Please ensure an AndroidManifest.xml ' "exists for the app's base module."; return false; } XmlDocument document; try { document = XmlDocument.parse(appManifestFile.readAsStringSync()); } on XmlException { invalidFiles[appManifestFile.path] = 'Error parsing $appManifestFile ' 'Please ensure that the android manifest is a valid XML document and ' 'try again.'; return false; } on FileSystemException { invalidFiles[appManifestFile.path] = 'Error reading $appManifestFile ' 'even though it exists. Please ensure that you have read permission for ' 'this file and try again.'; return false; } // Create loading unit mapping. final Map<int, String> mapping = <int, String>{}; for (final DeferredComponent component in components) { component.assignLoadingUnits(generatedLoadingUnits); final Set<LoadingUnit>? loadingUnits = component.loadingUnits; if (loadingUnits == null) { continue; } for (final LoadingUnit unit in loadingUnits) { if (!mapping.containsKey(unit.id)) { mapping[unit.id] = component.name; } } } for (final LoadingUnit unit in generatedLoadingUnits) { if (!mapping.containsKey(unit.id)) { // Store an empty string for unassigned loading units, // indicating that it is in the base component. mapping[unit.id] = ''; } } // Encode the mapping as a string. final StringBuffer mappingBuffer = StringBuffer(); for (final int key in mapping.keys) { mappingBuffer.write('$key:${mapping[key]},'); } String encodedMapping = mappingBuffer.toString(); // remove trailing comma if any if (encodedMapping.endsWith(',')) { encodedMapping = encodedMapping.substring(0, encodedMapping.length - 1); } // Check for existing metadata entry and see if needs changes. bool exists = false; bool modified = false; for (final XmlElement application in document.findAllElements('application')) { for (final XmlElement metaData in application.findElements('meta-data')) { final String? name = metaData.getAttribute('android:name'); if (name == _mappingKey) { exists = true; final String? storedMappingString = metaData.getAttribute('android:value'); if (storedMappingString != encodedMapping) { metaData.setAttribute('android:value', encodedMapping); modified = true; } } } } if (!exists) { // Create an meta-data XmlElement that contains the mapping. final XmlElement mappingMetadataElement = XmlElement(XmlName.fromString('meta-data'), <XmlAttribute>[ XmlAttribute(XmlName.fromString('android:name'), _mappingKey), XmlAttribute(XmlName.fromString('android:value'), encodedMapping), ], ); for (final XmlElement application in document.findAllElements('application')) { application.children.add(mappingMetadataElement); break; } } if (!exists || modified) { final File manifestOutput = outputDir .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); ErrorHandlingFileSystem.deleteIfExists(manifestOutput); manifestOutput.createSync(recursive: true); manifestOutput.writeAsStringSync(document.toXmlString(pretty: true), flush: true); modifiedFiles.add(manifestOutput.path); return false; } return true; } /// Compares the provided loading units against the contents of the /// `deferred_components_loading_units.yaml` file. /// /// Returns true if a loading unit cache file exists and all loading units /// match, and false otherwise. /// /// This method will parse the cached loading units file if it exists and /// compare it to the provided generatedLoadingUnits. It will distinguish /// between newly added loading units and no longer existing loading units. If /// the cache file does not exist, then all generatedLoadingUnits will be /// considered new. bool checkAgainstLoadingUnitsCache( List<LoadingUnit> generatedLoadingUnits) { final List<LoadingUnit> cachedLoadingUnits = _parseLoadingUnitsCache(projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName)); loadingUnitComparisonResults = <String, Object>{}; final Set<LoadingUnit> unmatchedLoadingUnits = <LoadingUnit>{}; final List<LoadingUnit> newLoadingUnits = <LoadingUnit>[]; unmatchedLoadingUnits.addAll(cachedLoadingUnits); final Set<int> addedNewIds = <int>{}; for (final LoadingUnit genUnit in generatedLoadingUnits) { bool matched = false; for (final LoadingUnit cacheUnit in cachedLoadingUnits) { if (genUnit.equalsIgnoringPath(cacheUnit)) { matched = true; unmatchedLoadingUnits.remove(cacheUnit); break; } } if (!matched && !addedNewIds.contains(genUnit.id)) { newLoadingUnits.add(genUnit); addedNewIds.add(genUnit.id); } } loadingUnitComparisonResults!['new'] = newLoadingUnits; loadingUnitComparisonResults!['missing'] = unmatchedLoadingUnits; loadingUnitComparisonResults!['match'] = newLoadingUnits.isEmpty && unmatchedLoadingUnits.isEmpty; return loadingUnitComparisonResults!['match']! as bool; } List<LoadingUnit> _parseLoadingUnitsCache(File cacheFile) { final List<LoadingUnit> loadingUnits = <LoadingUnit>[]; inputs.add(cacheFile); if (!cacheFile.existsSync()) { return loadingUnits; } final YamlMap data = loadYaml(cacheFile.readAsStringSync()) as YamlMap; // validate yaml format. if (!data.containsKey('loading-units')) { invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' " 'entry did not exist.'; return loadingUnits; } else { if (data['loading-units'] is! YamlList && data['loading-units'] != null) { invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' " 'is not a list.'; return loadingUnits; } if (data['loading-units'] != null) { for (final Object? loadingUnitData in data['loading-units'] as List<Object?>) { if (loadingUnitData is! YamlMap) { invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' " 'is not a list of maps.'; return loadingUnits; } final YamlMap loadingUnitDataMap = loadingUnitData; if (loadingUnitDataMap['id'] == null) { invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, all ' "loading units must have an 'id'"; return loadingUnits; } if (loadingUnitDataMap['libraries'] != null) { if (loadingUnitDataMap['libraries'] is! YamlList) { invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'libraries' " 'is not a list.'; return loadingUnits; } for (final Object? node in loadingUnitDataMap['libraries'] as YamlList) { if (node is! String) { invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'libraries' " 'is not a list of strings.'; return loadingUnits; } } } } } } // Parse out validated yaml. if (data.containsKey('loading-units')) { if (data['loading-units'] != null) { for (final Object? loadingUnitData in data['loading-units'] as List<Object?>) { final YamlMap? loadingUnitDataMap = loadingUnitData as YamlMap?; final List<String> libraries = <String>[]; final YamlList? nodes = loadingUnitDataMap?['libraries'] as YamlList?; if (nodes != null) { for (final Object node in nodes.whereType<Object>()) { libraries.add(node as String); } } loadingUnits.add( LoadingUnit( id: loadingUnitDataMap!['id'] as int, libraries: libraries, )); } } } return loadingUnits; } /// Writes the provided generatedLoadingUnits as `deferred_components_loading_units.yaml` /// /// This cache file is used to detect any changes in the loading units /// produced by gen_snapshot. Running [checkAgainstLoadingUnitCache] with a /// mismatching or missing cache will result in a failed validation. This /// prevents unexpected changes in loading units causing misconfigured /// deferred components. void writeLoadingUnitsCache(List<LoadingUnit>? generatedLoadingUnits) { generatedLoadingUnits ??= <LoadingUnit>[]; final File cacheFile = projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); outputs.add(cacheFile); ErrorHandlingFileSystem.deleteIfExists(cacheFile); cacheFile.createSync(recursive: true); final StringBuffer buffer = StringBuffer(); buffer.write(''' # ============================================================================== # The contents of this file are automatically generated and it is not # recommended to modify this file manually. # ============================================================================== # # In order to prevent unexpected splitting of deferred apps, this file records # the last generated set of loading units. It only possible to obtain the final # configuration of loading units after compilation is complete. This means # improperly setup deferred imports can only be detected after compilation. # # This file allows the build tool to detect any changes in the generated # loading units. During the next build attempt, loading units in this file are # compared against the newly generated loading units to check for any new or # removed loading units. In the case where loading units do not match, the build # will fail and ask the developer to verify that the `deferred-components` # configuration in `pubspec.yaml` is correct. Developers should make any # necessary changes to integrate new and changed loading units or remove no # longer existing loading units from the configuration. The build command should # then be re-run to continue the build process. # # Sometimes, changes to the generated loading units may be unintentional. If # the list of loading units in this file is not what is expected, the app's # deferred imports should be reviewed. Third party plugins and packages may # also introduce deferred imports that result in unexpected loading units. loading-units: '''); final Set<int> usedIds = <int>{}; for (final LoadingUnit unit in generatedLoadingUnits) { if (usedIds.contains(unit.id)) { continue; } buffer.write(' - id: ${unit.id}\n'); if (unit.libraries.isNotEmpty) { buffer.write(' libraries:\n'); for (final String lib in unit.libraries) { buffer.write(' - $lib\n'); } } usedIds.add(unit.id); } cacheFile.writeAsStringSync(buffer.toString(), flush: true); } }
flutter/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart", "repo_id": "flutter", "token_count": 5243 }
816
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:process/process.dart'; import '../artifacts.dart'; import '../build_info.dart'; import '../macos/xcode.dart'; import 'file_system.dart'; import 'logger.dart'; import 'process.dart'; /// A snapshot build configuration. class SnapshotType { SnapshotType(this.platform, this.mode); final TargetPlatform? platform; final BuildMode mode; @override String toString() => '$platform $mode'; } /// Interface to the gen_snapshot command-line tool. class GenSnapshot { GenSnapshot({ required Artifacts artifacts, required ProcessManager processManager, required Logger logger, }) : _artifacts = artifacts, _processUtils = ProcessUtils(logger: logger, processManager: processManager); final Artifacts _artifacts; final ProcessUtils _processUtils; String getSnapshotterPath(SnapshotType snapshotType) { return _artifacts.getArtifactPath( Artifact.genSnapshot, platform: snapshotType.platform, mode: snapshotType.mode); } /// Ignored warning messages from gen_snapshot. static const Set<String> kIgnoredWarnings = <String>{ // --strip on elf snapshot. 'Warning: Generating ELF library without DWARF debugging information.', // --strip on ios-assembly snapshot. 'Warning: Generating assembly code without DWARF debugging information.', // A fun two-part message with spaces for obfuscation. 'Warning: This VM has been configured to obfuscate symbol information which violates the Dart standard.', ' See dartbug.com/30524 for more information.', }; Future<int> run({ required SnapshotType snapshotType, DarwinArch? darwinArch, Iterable<String> additionalArgs = const <String>[], }) { assert(darwinArch != DarwinArch.armv7); assert(snapshotType.platform != TargetPlatform.ios || darwinArch != null); final List<String> args = <String>[ ...additionalArgs, ]; String snapshotterPath = getSnapshotterPath(snapshotType); // iOS and macOS have separate gen_snapshot binaries for each target // architecture (iOS: armv7, arm64; macOS: x86_64, arm64). Select the right // one for the target architecture in question. if (snapshotType.platform == TargetPlatform.ios || snapshotType.platform == TargetPlatform.darwin) { snapshotterPath += '_${darwinArch!.dartName}'; } return _processUtils.stream( <String>[snapshotterPath, ...args], mapFunction: (String line) => kIgnoredWarnings.contains(line) ? null : line, ); } } class AOTSnapshotter { AOTSnapshotter({ this.reportTimings = false, required Logger logger, required FileSystem fileSystem, required Xcode xcode, required ProcessManager processManager, required Artifacts artifacts, }) : _logger = logger, _fileSystem = fileSystem, _xcode = xcode, _genSnapshot = GenSnapshot( artifacts: artifacts, processManager: processManager, logger: logger, ); final Logger _logger; final FileSystem _fileSystem; final Xcode _xcode; final GenSnapshot _genSnapshot; /// If true then AOTSnapshotter would report timings for individual building /// steps (Dart front-end parsing and snapshot generation) in a stable /// machine readable form. See [AOTSnapshotter._timedStep]. final bool reportTimings; /// Builds an architecture-specific ahead-of-time compiled snapshot of the specified script. Future<int> build({ required TargetPlatform platform, required BuildMode buildMode, required String mainPath, required String outputPath, DarwinArch? darwinArch, String? sdkRoot, List<String> extraGenSnapshotOptions = const <String>[], String? splitDebugInfo, required bool dartObfuscation, bool quiet = false, }) async { assert(platform != TargetPlatform.ios || darwinArch != null); if (!_isValidAotPlatform(platform, buildMode)) { _logger.printError('${getNameForTargetPlatform(platform)} does not support AOT compilation.'); return 1; } final Directory outputDir = _fileSystem.directory(outputPath); outputDir.createSync(recursive: true); final List<String> genSnapshotArgs = <String>[ '--deterministic', ]; final bool targetingApplePlatform = platform == TargetPlatform.ios || platform == TargetPlatform.darwin; _logger.printTrace('targetingApplePlatform = $targetingApplePlatform'); final bool extractAppleDebugSymbols = buildMode == BuildMode.profile || buildMode == BuildMode.release; _logger.printTrace('extractAppleDebugSymbols = $extractAppleDebugSymbols'); // We strip snapshot by default, but allow to suppress this behavior // by supplying --no-strip in extraGenSnapshotOptions. bool shouldStrip = true; if (extraGenSnapshotOptions.isNotEmpty) { _logger.printTrace('Extra gen_snapshot options: $extraGenSnapshotOptions'); for (final String option in extraGenSnapshotOptions) { if (option == '--no-strip') { shouldStrip = false; continue; } genSnapshotArgs.add(option); } } final String assembly = _fileSystem.path.join(outputDir.path, 'snapshot_assembly.S'); if (targetingApplePlatform) { genSnapshotArgs.addAll(<String>[ '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', ]); } else { final String aotSharedLibrary = _fileSystem.path.join(outputDir.path, 'app.so'); genSnapshotArgs.addAll(<String>[ '--snapshot_kind=app-aot-elf', '--elf=$aotSharedLibrary', ]); } // When building for iOS and splitting out debug info, we want to strip // manually after the dSYM export, instead of in the `gen_snapshot`. final bool stripAfterBuild; if (targetingApplePlatform) { stripAfterBuild = shouldStrip; if (stripAfterBuild) { _logger.printTrace('Will strip AOT snapshot manually after build and dSYM generation.'); } } else { stripAfterBuild = false; if (shouldStrip) { genSnapshotArgs.add('--strip'); _logger.printTrace('Will strip AOT snapshot during build.'); } } if (platform == TargetPlatform.android_arm) { // Use softfp for Android armv7 devices. // TODO(cbracken): eliminate this when we fix https://github.com/flutter/flutter/issues/17489 genSnapshotArgs.add('--no-sim-use-hardfp'); // Not supported by the Pixel in 32-bit mode. genSnapshotArgs.add('--no-use-integer-division'); } // The name of the debug file must contain additional information about // the architecture, since a single build command may produce // multiple debug files. final String archName = getNameForTargetPlatform(platform, darwinArch: darwinArch); final String debugFilename = 'app.$archName.symbols'; final bool shouldSplitDebugInfo = splitDebugInfo?.isNotEmpty ?? false; if (shouldSplitDebugInfo) { _fileSystem.directory(splitDebugInfo) .createSync(recursive: true); } // Debugging information. genSnapshotArgs.addAll(<String>[ if (shouldSplitDebugInfo) ...<String>[ '--dwarf-stack-traces', '--resolve-dwarf-paths', '--save-debugging-info=${_fileSystem.path.join(splitDebugInfo!, debugFilename)}', ], if (dartObfuscation) '--obfuscate', ]); genSnapshotArgs.add(mainPath); final SnapshotType snapshotType = SnapshotType(platform, buildMode); final int genSnapshotExitCode = await _genSnapshot.run( snapshotType: snapshotType, additionalArgs: genSnapshotArgs, darwinArch: darwinArch, ); if (genSnapshotExitCode != 0) { _logger.printError('Dart snapshot generator failed with exit code $genSnapshotExitCode'); return genSnapshotExitCode; } // On iOS and macOS, we use Xcode to compile the snapshot into a dynamic library that the // end-developer can link into their app. if (targetingApplePlatform) { return _buildFramework( appleArch: darwinArch!, isIOS: platform == TargetPlatform.ios, sdkRoot: sdkRoot, assemblyPath: assembly, outputPath: outputDir.path, quiet: quiet, stripAfterBuild: stripAfterBuild, extractAppleDebugSymbols: extractAppleDebugSymbols ); } else { return 0; } } /// Builds an iOS or macOS framework at [outputPath]/App.framework from the assembly /// source at [assemblyPath]. Future<int> _buildFramework({ required DarwinArch appleArch, required bool isIOS, String? sdkRoot, required String assemblyPath, required String outputPath, required bool quiet, required bool stripAfterBuild, required bool extractAppleDebugSymbols }) async { final String targetArch = appleArch.name; if (!quiet) { _logger.printStatus('Building App.framework for $targetArch...'); } final List<String> commonBuildOptions = <String>[ '-arch', targetArch, if (isIOS) // When the minimum version is updated, remember to update // template MinimumOSVersion. // https://github.com/flutter/flutter/pull/62902 '-miphoneos-version-min=12.0', if (sdkRoot != null) ...<String>[ '-isysroot', sdkRoot, ], ]; final String assemblyO = _fileSystem.path.join(outputPath, 'snapshot_assembly.o'); final RunResult compileResult = await _xcode.cc(<String>[ ...commonBuildOptions, '-c', assemblyPath, '-o', assemblyO, ]); if (compileResult.exitCode != 0) { _logger.printError('Failed to compile AOT snapshot. Compiler terminated with exit code ${compileResult.exitCode}'); return compileResult.exitCode; } final String frameworkDir = _fileSystem.path.join(outputPath, 'App.framework'); _fileSystem.directory(frameworkDir).createSync(recursive: true); final String appLib = _fileSystem.path.join(frameworkDir, 'App'); final List<String> linkArgs = <String>[ ...commonBuildOptions, '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', appLib, assemblyO, ]; final RunResult linkResult = await _xcode.clang(linkArgs); if (linkResult.exitCode != 0) { _logger.printError('Failed to link AOT snapshot. Linker terminated with exit code ${linkResult.exitCode}'); return linkResult.exitCode; } if (extractAppleDebugSymbols) { final RunResult dsymResult = await _xcode.dsymutil(<String>['-o', '$frameworkDir.dSYM', appLib]); if (dsymResult.exitCode != 0) { _logger.printError('Failed to generate dSYM - dsymutil terminated with exit code ${dsymResult.exitCode}'); return dsymResult.exitCode; } if (stripAfterBuild) { // See https://www.unix.com/man-page/osx/1/strip/ for arguments final RunResult stripResult = await _xcode.strip(<String>['-x', appLib, '-o', appLib]); if (stripResult.exitCode != 0) { _logger.printError('Failed to strip debugging symbols from the generated AOT snapshot - strip terminated with exit code ${stripResult.exitCode}'); return stripResult.exitCode; } } } else { assert(!stripAfterBuild); } return 0; } bool _isValidAotPlatform(TargetPlatform platform, BuildMode buildMode) { if (buildMode == BuildMode.debug) { return false; } return const <TargetPlatform>[ TargetPlatform.android_arm, TargetPlatform.android_arm64, TargetPlatform.android_x64, TargetPlatform.ios, TargetPlatform.darwin, TargetPlatform.linux_x64, TargetPlatform.linux_arm64, TargetPlatform.windows_x64, TargetPlatform.windows_arm64, ].contains(platform); } }
flutter/packages/flutter_tools/lib/src/base/build.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/base/build.dart", "repo_id": "flutter", "token_count": 4398 }
817
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:meta/meta.dart'; import 'package:process/process.dart'; import '../convert.dart'; import '../globals.dart' as globals; import '../reporting/first_run.dart'; import 'io.dart'; import 'logger.dart'; typedef StringConverter = String? Function(String string); /// A function that will be run before the VM exits. typedef ShutdownHook = FutureOr<void> Function(); // TODO(ianh): We have way too many ways to run subprocesses in this project. // Convert most of these into one or more lightweight wrappers around the // [ProcessManager] API using named parameters for the various options. // See [here](https://github.com/flutter/flutter/pull/14535#discussion_r167041161) // for more details. abstract class ShutdownHooks { factory ShutdownHooks() = _DefaultShutdownHooks; /// Registers a [ShutdownHook] to be executed before the VM exits. void addShutdownHook(ShutdownHook shutdownHook); @visibleForTesting List<ShutdownHook> get registeredHooks; /// Runs all registered shutdown hooks and returns a future that completes when /// all such hooks have finished. /// /// Shutdown hooks will be run in groups by their [ShutdownStage]. All shutdown /// hooks within a given stage will be started in parallel and will be /// guaranteed to run to completion before shutdown hooks in the next stage are /// started. /// /// This class is constructed before the [Logger], so it cannot be direct /// injected in the constructor. Future<void> runShutdownHooks(Logger logger); } class _DefaultShutdownHooks implements ShutdownHooks { _DefaultShutdownHooks(); @override final List<ShutdownHook> registeredHooks = <ShutdownHook>[]; bool _shutdownHooksRunning = false; @override void addShutdownHook( ShutdownHook shutdownHook ) { assert(!_shutdownHooksRunning); registeredHooks.add(shutdownHook); } @override Future<void> runShutdownHooks(Logger logger) async { logger.printTrace( 'Running ${registeredHooks.length} shutdown hook${registeredHooks.length == 1 ? '' : 's'}', ); _shutdownHooksRunning = true; try { final List<Future<dynamic>> futures = <Future<dynamic>>[]; for (final ShutdownHook shutdownHook in registeredHooks) { final FutureOr<dynamic> result = shutdownHook(); if (result is Future<dynamic>) { futures.add(result); } } await Future.wait<dynamic>(futures); } finally { _shutdownHooksRunning = false; } logger.printTrace('Shutdown hooks complete'); } } class ProcessExit implements Exception { ProcessExit(this.exitCode, {this.immediate = false}); final bool immediate; final int exitCode; String get message => 'ProcessExit: $exitCode'; @override String toString() => message; } class RunResult { RunResult(this.processResult, this._command) : assert(_command.isNotEmpty); final ProcessResult processResult; final List<String> _command; int get exitCode => processResult.exitCode; String get stdout => processResult.stdout as String; String get stderr => processResult.stderr as String; @override String toString() { final StringBuffer out = StringBuffer(); if (stdout.isNotEmpty) { out.writeln(stdout); } if (stderr.isNotEmpty) { out.writeln(stderr); } return out.toString().trimRight(); } /// Throws a [ProcessException] with the given `message`. void throwException(String message) { throw ProcessException( _command.first, _command.skip(1).toList(), message, exitCode, ); } } typedef RunResultChecker = bool Function(int); abstract class ProcessUtils { factory ProcessUtils({ required ProcessManager processManager, required Logger logger, }) = _DefaultProcessUtils; /// Spawns a child process to run the command [cmd]. /// /// When [throwOnError] is `true`, if the child process finishes with a non-zero /// exit code, a [ProcessException] is thrown. /// /// If [throwOnError] is `true`, and [allowedFailures] is supplied, /// a [ProcessException] is only thrown on a non-zero exit code if /// [allowedFailures] returns false when passed the exit code. /// /// When [workingDirectory] is set, it is the working directory of the child /// process. /// /// When [allowReentrantFlutter] is set to `true`, the child process is /// permitted to call the Flutter tool. By default it is not. /// /// When [environment] is supplied, it is used as the environment for the child /// process. /// /// When [timeout] is supplied, [runAsync] will kill the child process and /// throw a [ProcessException] when it doesn't finish in time. /// /// If [timeout] is supplied, the command will be retried [timeoutRetries] times /// if it times out. Future<RunResult> run( List<String> cmd, { bool throwOnError = false, RunResultChecker? allowedFailures, String? workingDirectory, bool allowReentrantFlutter = false, Map<String, String>? environment, Duration? timeout, int timeoutRetries = 0, }); /// Run the command and block waiting for its result. RunResult runSync( List<String> cmd, { bool throwOnError = false, bool verboseExceptions = false, RunResultChecker? allowedFailures, bool hideStdout = false, String? workingDirectory, Map<String, String>? environment, bool allowReentrantFlutter = false, Encoding encoding = systemEncoding, }); /// This runs the command in the background from the specified working /// directory. Completes when the process has been started. Future<Process> start( List<String> cmd, { String? workingDirectory, bool allowReentrantFlutter = false, Map<String, String>? environment, ProcessStartMode mode = ProcessStartMode.normal, }); /// This runs the command and streams stdout/stderr from the child process to /// this process' stdout/stderr. Completes with the process's exit code. /// /// If [filter] is null, no lines are removed. /// /// If [filter] is non-null, all lines that do not match it are removed. If /// [mapFunction] is present, all lines that match [filter] are also forwarded /// to [mapFunction] for further processing. /// /// If [stdoutErrorMatcher] is non-null, matching lines from stdout will be /// treated as errors, just as if they had been logged to stderr instead. Future<int> stream( List<String> cmd, { String? workingDirectory, bool allowReentrantFlutter = false, String prefix = '', bool trace = false, RegExp? filter, RegExp? stdoutErrorMatcher, StringConverter? mapFunction, Map<String, String>? environment, }); bool exitsHappySync( List<String> cli, { Map<String, String>? environment, }); Future<bool> exitsHappy( List<String> cli, { Map<String, String>? environment, }); /// Write [line] to [stdin] and catch any errors with [onError]. /// /// Specifically with [Process] file descriptors, an exception that is /// thrown as part of a write can be most reliably caught with a /// [ZoneSpecification] error handler. /// /// On some platforms, the following code appears to work: /// /// ```dart /// stdin.writeln(line); /// try { /// await stdin.flush(line); /// } catch (err) { /// // handle error /// } /// ``` /// /// However it did not catch a [SocketException] on Linux. static Future<void> writelnToStdinGuarded({ required IOSink stdin, required String line, required void Function(Object, StackTrace) onError, }) async { final Completer<void> completer = Completer<void>(); void writeFlushAndComplete() { stdin.writeln(line); stdin.flush().whenComplete(() { if (!completer.isCompleted) { completer.complete(); } }); } runZonedGuarded( writeFlushAndComplete, (Object error, StackTrace stackTrace) { onError(error, stackTrace); if (!completer.isCompleted) { completer.complete(); } }, ); return completer.future; } } class _DefaultProcessUtils implements ProcessUtils { _DefaultProcessUtils({ required ProcessManager processManager, required Logger logger, }) : _processManager = processManager, _logger = logger; final ProcessManager _processManager; final Logger _logger; @override Future<RunResult> run( List<String> cmd, { bool throwOnError = false, RunResultChecker? allowedFailures, String? workingDirectory, bool allowReentrantFlutter = false, Map<String, String>? environment, Duration? timeout, int timeoutRetries = 0, }) async { if (cmd.isEmpty) { throw ArgumentError('cmd must be a non-empty list'); } if (timeoutRetries < 0) { throw ArgumentError('timeoutRetries must be non-negative'); } _traceCommand(cmd, workingDirectory: workingDirectory); // When there is no timeout, there's no need to kill a running process, so // we can just use _processManager.run(). if (timeout == null) { final ProcessResult results = await _processManager.run( cmd, workingDirectory: workingDirectory, environment: _environment(allowReentrantFlutter, environment), ); final RunResult runResult = RunResult(results, cmd); _logger.printTrace(runResult.toString()); if (throwOnError && runResult.exitCode != 0 && (allowedFailures == null || !allowedFailures(runResult.exitCode))) { runResult.throwException('Process exited abnormally with exit code ${runResult.exitCode}:\n$runResult'); } return runResult; } // When there is a timeout, we have to kill the running process, so we have // to use _processManager.start() through _runCommand() above. while (true) { assert(timeoutRetries >= 0); timeoutRetries = timeoutRetries - 1; final Process process = await start( cmd, workingDirectory: workingDirectory, allowReentrantFlutter: allowReentrantFlutter, environment: environment, ); final StringBuffer stdoutBuffer = StringBuffer(); final StringBuffer stderrBuffer = StringBuffer(); final Future<void> stdoutFuture = process.stdout .transform<String>(const Utf8Decoder(reportErrors: false)) .listen(stdoutBuffer.write) .asFuture<void>(); final Future<void> stderrFuture = process.stderr .transform<String>(const Utf8Decoder(reportErrors: false)) .listen(stderrBuffer.write) .asFuture<void>(); int? exitCode; exitCode = await process.exitCode.then<int?>((int x) => x).timeout(timeout, onTimeout: () { // The process timed out. Kill it. _processManager.killPid(process.pid); return null; }); String stdoutString; String stderrString; try { Future<void> stdioFuture = Future.wait<void>(<Future<void>>[stdoutFuture, stderrFuture]); if (exitCode == null) { // If we had to kill the process for a timeout, only wait a short time // for the stdio streams to drain in case killing the process didn't // work. stdioFuture = stdioFuture.timeout(const Duration(seconds: 1)); } await stdioFuture; } on Exception { // Ignore errors on the process' stdout and stderr streams. Just capture // whatever we got, and use the exit code } stdoutString = stdoutBuffer.toString(); stderrString = stderrBuffer.toString(); final ProcessResult result = ProcessResult( process.pid, exitCode ?? -1, stdoutString, stderrString); final RunResult runResult = RunResult(result, cmd); // If the process did not timeout. We are done. if (exitCode != null) { _logger.printTrace(runResult.toString()); if (throwOnError && runResult.exitCode != 0 && (allowedFailures == null || !allowedFailures(exitCode))) { runResult.throwException('Process exited abnormally with exit code $exitCode:\n$runResult'); } return runResult; } // If we are out of timeoutRetries, throw a ProcessException. if (timeoutRetries < 0) { runResult.throwException('Process timed out:\n$runResult'); } // Log the timeout with a trace message in verbose mode. _logger.printTrace( 'Process "${cmd[0]}" timed out. $timeoutRetries attempts left:\n' '$runResult', ); } // Unreachable. } @override RunResult runSync( List<String> cmd, { bool throwOnError = false, bool verboseExceptions = false, RunResultChecker? allowedFailures, bool hideStdout = false, String? workingDirectory, Map<String, String>? environment, bool allowReentrantFlutter = false, Encoding encoding = systemEncoding, }) { _traceCommand(cmd, workingDirectory: workingDirectory); final ProcessResult results = _processManager.runSync( cmd, workingDirectory: workingDirectory, environment: _environment(allowReentrantFlutter, environment), stderrEncoding: encoding, stdoutEncoding: encoding, ); final RunResult runResult = RunResult(results, cmd); _logger.printTrace('Exit code ${runResult.exitCode} from: ${cmd.join(' ')}'); bool failedExitCode = runResult.exitCode != 0; if (allowedFailures != null && failedExitCode) { failedExitCode = !allowedFailures(runResult.exitCode); } if (runResult.stdout.isNotEmpty && !hideStdout) { if (failedExitCode && throwOnError) { _logger.printStatus(runResult.stdout.trim()); } else { _logger.printTrace(runResult.stdout.trim()); } } if (runResult.stderr.isNotEmpty) { if (failedExitCode && throwOnError) { _logger.printError(runResult.stderr.trim()); } else { _logger.printTrace(runResult.stderr.trim()); } } if (failedExitCode && throwOnError) { String message = 'The command failed with exit code ${runResult.exitCode}'; if (verboseExceptions) { message = 'The command failed\nStdout:\n${runResult.stdout}\n' 'Stderr:\n${runResult.stderr}'; } runResult.throwException(message); } return runResult; } @override Future<Process> start( List<String> cmd, { String? workingDirectory, bool allowReentrantFlutter = false, Map<String, String>? environment, ProcessStartMode mode = ProcessStartMode.normal, }) { _traceCommand(cmd, workingDirectory: workingDirectory); return _processManager.start( cmd, workingDirectory: workingDirectory, environment: _environment(allowReentrantFlutter, environment), mode: mode, ); } @override Future<int> stream( List<String> cmd, { String? workingDirectory, bool allowReentrantFlutter = false, String prefix = '', bool trace = false, RegExp? filter, RegExp? stdoutErrorMatcher, StringConverter? mapFunction, Map<String, String>? environment, }) async { final Process process = await start( cmd, workingDirectory: workingDirectory, allowReentrantFlutter: allowReentrantFlutter, environment: environment, ); final StreamSubscription<String> stdoutSubscription = process.stdout .transform<String>(utf8.decoder) .transform<String>(const LineSplitter()) .where((String line) => filter == null || filter.hasMatch(line)) .listen((String line) { String? mappedLine = line; if (mapFunction != null) { mappedLine = mapFunction(line); } if (mappedLine != null) { final String message = '$prefix$mappedLine'; if (stdoutErrorMatcher?.hasMatch(mappedLine) ?? false) { _logger.printError(message, wrap: false); } else if (trace) { _logger.printTrace(message); } else { _logger.printStatus(message, wrap: false); } } }); final StreamSubscription<String> stderrSubscription = process.stderr .transform<String>(utf8.decoder) .transform<String>(const LineSplitter()) .where((String line) => filter == null || filter.hasMatch(line)) .listen((String line) { String? mappedLine = line; if (mapFunction != null) { mappedLine = mapFunction(line); } if (mappedLine != null) { _logger.printError('$prefix$mappedLine', wrap: false); } }); // Wait for stdout to be fully processed // because process.exitCode may complete first causing flaky tests. await Future.wait<void>(<Future<void>>[ stdoutSubscription.asFuture<void>(), stderrSubscription.asFuture<void>(), ]); // The streams as futures have already completed, so waiting for the // potentially async stream cancellation to complete likely has no benefit. // Further, some Stream implementations commonly used in tests don't // complete the Future returned here, which causes tests using // mocks/FakeAsync to fail when these Futures are awaited. unawaited(stdoutSubscription.cancel()); unawaited(stderrSubscription.cancel()); return process.exitCode; } @override bool exitsHappySync( List<String> cli, { Map<String, String>? environment, }) { _traceCommand(cli); if (!_processManager.canRun(cli.first)) { _logger.printTrace('$cli either does not exist or is not executable.'); return false; } try { return _processManager.runSync(cli, environment: environment).exitCode == 0; } on Exception catch (error) { _logger.printTrace('$cli failed with $error'); return false; } } @override Future<bool> exitsHappy( List<String> cli, { Map<String, String>? environment, }) async { _traceCommand(cli); if (!_processManager.canRun(cli.first)) { _logger.printTrace('$cli either does not exist or is not executable.'); return false; } try { return (await _processManager.run(cli, environment: environment)).exitCode == 0; } on Exception catch (error) { _logger.printTrace('$cli failed with $error'); return false; } } Map<String, String>? _environment(bool allowReentrantFlutter, [ Map<String, String>? environment, ]) { if (allowReentrantFlutter) { if (environment == null) { environment = <String, String>{'FLUTTER_ALREADY_LOCKED': 'true'}; } else { environment['FLUTTER_ALREADY_LOCKED'] = 'true'; } } return environment; } void _traceCommand(List<String> args, { String? workingDirectory }) { final String argsText = args.join(' '); if (workingDirectory == null) { _logger.printTrace('executing: $argsText'); } else { _logger.printTrace('executing: [$workingDirectory/] $argsText'); } } } Future<int> exitWithHooks(int code, {required ShutdownHooks shutdownHooks}) async { // Need to get the boolean returned from `messenger.shouldDisplayLicenseTerms()` // before invoking the print welcome method because the print welcome method // will set `messenger.shouldDisplayLicenseTerms()` to false final FirstRunMessenger messenger = FirstRunMessenger(persistentToolState: globals.persistentToolState!); final bool legacyAnalyticsMessageShown = messenger.shouldDisplayLicenseTerms(); // Prints the welcome message if needed for legacy analytics. if (!(await globals.isRunningOnBot)) { globals.flutterUsage.printWelcome(); } // Ensure that the consent message has been displayed for unified analytics if (globals.analytics.shouldShowMessage) { globals.logger.printStatus(globals.analytics.getConsentMessage); if (!globals.flutterUsage.enabled) { globals.printStatus( 'Please note that analytics reporting was already disabled, ' 'and will continue to be disabled.\n'); } // Because the legacy analytics may have also sent a message, // the conditional below will print additional messaging informing // users that the two consent messages they are receiving is not a // bug if (legacyAnalyticsMessageShown) { globals.logger .printStatus('You have received two consent messages because ' 'the flutter tool is migrating to a new analytics system. ' 'Disabling analytics collection will disable both the legacy ' 'and new analytics collection systems. ' 'You can disable analytics reporting by running `flutter --disable-analytics`\n'); } // Invoking this will onboard the flutter tool onto // the package on the developer's machine and will // allow for events to be sent to Google Analytics // on subsequent runs of the flutter tool (ie. no events // will be sent on the first run to allow developers to // opt out of collection) globals.analytics.clientShowedMessage(); } // Send any last analytics calls that are in progress without overly delaying // the tool's exit (we wait a maximum of 250ms). if (globals.flutterUsage.enabled) { final Stopwatch stopwatch = Stopwatch()..start(); await globals.flutterUsage.ensureAnalyticsSent(); globals.printTrace('ensureAnalyticsSent: ${stopwatch.elapsedMilliseconds}ms'); } // Run shutdown hooks before flushing logs await shutdownHooks.runShutdownHooks(globals.logger); final Completer<void> completer = Completer<void>(); // Allow any pending analytics events to send and close the http connection // // By default, we will wait 250 ms before canceling any pending events, we // can change the [delayDuration] in the close method if it needs to be changed await globals.analytics.close(); // Give the task / timer queue one cycle through before we hard exit. Timer.run(() { try { globals.printTrace('exiting with code $code'); exit(code); completer.complete(); // This catches all exceptions because the error is propagated on the // completer. } catch (error, stackTrace) { // ignore: avoid_catches_without_on_clauses completer.completeError(error, stackTrace); } }); await completer.future; return code; }
flutter/packages/flutter_tools/lib/src/base/process.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/base/process.dart", "repo_id": "flutter", "token_count": 7941 }
818
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:collection'; import 'dart:typed_data'; import 'package:crypto/crypto.dart'; import '../base/file_system.dart'; import '../base/logger.dart'; import '../base/utils.dart'; import '../convert.dart'; import 'hash.dart'; /// An encoded representation of all file hashes. class FileStorage { FileStorage(this.version, this.files); factory FileStorage.fromBuffer(Uint8List buffer) { final Map<String, dynamic>? json = castStringKeyedMap(jsonDecode(utf8.decode(buffer))); if (json == null) { throw Exception('File storage format invalid'); } final int version = json['version'] as int; final List<Map<String, dynamic>> rawCachedFiles = (json['files'] as List<dynamic>).cast<Map<String, dynamic>>(); final List<FileHash> cachedFiles = <FileHash>[ for (final Map<String, dynamic> rawFile in rawCachedFiles) FileHash._fromJson(rawFile), ]; return FileStorage(version, cachedFiles); } final int version; final List<FileHash> files; List<int> toBuffer() { final Map<String, Object> json = <String, Object>{ 'version': version, 'files': <Object>[ for (final FileHash file in files) file.toJson(), ], }; return utf8.encode(jsonEncode(json)); } } /// A stored file hash and path. class FileHash { FileHash(this.path, this.hash); factory FileHash._fromJson(Map<String, dynamic> json) { if (!json.containsKey('path') || !json.containsKey('hash')) { throw Exception('File storage format invalid'); } return FileHash(json['path']! as String, json['hash']! as String); } final String path; final String hash; Object toJson() { return <String, Object>{ 'path': path, 'hash': hash, }; } } /// The strategy used by [FileStore] to determine if a file has been /// invalidated. enum FileStoreStrategy { /// The [FileStore] will compute an md5 hash of the file contents. hash, /// The [FileStore] will check for differences in the file's last modified /// timestamp. timestamp, } /// A globally accessible cache of files. /// /// In cases where multiple targets read the same source files as inputs, we /// avoid recomputing or storing multiple copies of hashes by delegating /// through this class. /// /// This class uses either timestamps or file hashes depending on the /// provided [FileStoreStrategy]. All information is held in memory during /// a build operation, and may be persisted to cache in the root build /// directory. /// /// The format of the file store is subject to change and not part of its API. class FileStore { FileStore({ required File cacheFile, required Logger logger, FileStoreStrategy strategy = FileStoreStrategy.hash, }) : _logger = logger, _strategy = strategy, _cacheFile = cacheFile; final File _cacheFile; final Logger _logger; final FileStoreStrategy _strategy; final HashMap<String, String> previousAssetKeys = HashMap<String, String>(); final HashMap<String, String> currentAssetKeys = HashMap<String, String>(); // The name of the file which stores the file hashes. static const String kFileCache = '.filecache'; // The current version of the file cache storage format. static const int _kVersion = 2; /// Read file hashes from disk. void initialize() { _logger.printTrace('Initializing file store'); if (!_cacheFile.existsSync()) { return; } Uint8List data; try { data = _cacheFile.readAsBytesSync(); } on FileSystemException catch (err) { _logger.printError( 'Failed to read file store at ${_cacheFile.path} due to $err.\n' 'Build artifacts will not be cached. Try clearing the cache directories ' 'with "flutter clean"', ); return; } FileStorage fileStorage; try { fileStorage = FileStorage.fromBuffer(data); } on Exception catch (err) { _logger.printTrace('Filestorage format changed: $err'); _cacheFile.deleteSync(); return; } if (fileStorage.version != _kVersion) { _logger.printTrace('file cache format updating, clearing old hashes.'); _cacheFile.deleteSync(); return; } for (final FileHash fileHash in fileStorage.files) { previousAssetKeys[fileHash.path] = fileHash.hash; } _logger.printTrace('Done initializing file store'); } /// Persist file marks to disk for a non-incremental build. void persist() { _logger.printTrace('Persisting file store'); if (!_cacheFile.existsSync()) { _cacheFile.createSync(recursive: true); } final List<FileHash> fileHashes = <FileHash>[]; for (final MapEntry<String, String> entry in currentAssetKeys.entries) { fileHashes.add(FileHash(entry.key, entry.value)); } final FileStorage fileStorage = FileStorage( _kVersion, fileHashes, ); final List<int> buffer = fileStorage.toBuffer(); try { _cacheFile.writeAsBytesSync(buffer); } on FileSystemException catch (err) { _logger.printError( 'Failed to persist file store at ${_cacheFile.path} due to $err.\n' 'Build artifacts will not be cached. Try clearing the cache directories ' 'with "flutter clean"', ); } _logger.printTrace('Done persisting file store'); } /// Reset `previousMarks` for an incremental build. void persistIncremental() { previousAssetKeys.clear(); previousAssetKeys.addAll(currentAssetKeys); currentAssetKeys.clear(); } /// Computes a diff of the provided files and returns a list of files /// that were dirty. List<File> diffFileList(List<File> files) { final List<File> dirty = <File>[]; switch (_strategy) { case FileStoreStrategy.hash: for (final File file in files) { _hashFile(file, dirty); } case FileStoreStrategy.timestamp: for (final File file in files) { _checkModification(file, dirty); } } return dirty; } void _checkModification(File file, List<File> dirty) { final String absolutePath = file.path; final String? previousTime = previousAssetKeys[absolutePath]; // If the file is missing it is assumed to be dirty. if (!file.existsSync()) { currentAssetKeys.remove(absolutePath); previousAssetKeys.remove(absolutePath); dirty.add(file); return; } final String modifiedTime = file.lastModifiedSync().toString(); if (modifiedTime != previousTime) { dirty.add(file); } currentAssetKeys[absolutePath] = modifiedTime; } // 64k is the same sized buffer used by dart:io for `File.openRead`. static final Uint8List _readBuffer = Uint8List(64 * 1024); void _hashFile(File file, List<File> dirty) { final String absolutePath = file.path; final String? previousHash = previousAssetKeys[absolutePath]; // If the file is missing it is assumed to be dirty. if (!file.existsSync()) { currentAssetKeys.remove(absolutePath); previousAssetKeys.remove(absolutePath); dirty.add(file); return; } final int fileBytes = file.lengthSync(); final Md5Hash hash = Md5Hash(); RandomAccessFile? openFile; try { openFile = file.openSync(); int bytes = 0; while (bytes < fileBytes) { final int bytesRead = openFile.readIntoSync(_readBuffer); hash.addChunk(_readBuffer, bytesRead); bytes += bytesRead; } } finally { openFile?.closeSync(); } final Digest digest = Digest(hash.finalize().buffer.asUint8List()); final String currentHash = digest.toString(); if (currentHash != previousHash) { dirty.add(file); } currentAssetKeys[absolutePath] = currentHash; } }
flutter/packages/flutter_tools/lib/src/build_system/file_store.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/build_system/file_store.dart", "repo_id": "flutter", "token_count": 2766 }
819
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../../artifacts.dart'; import '../../base/file_system.dart'; import '../../build_info.dart'; import '../build_system.dart'; import '../depfile.dart'; import '../exceptions.dart'; import 'assets.dart'; import 'common.dart'; import 'desktop.dart'; import 'icon_tree_shaker.dart'; /// The only files/subdirectories we care about. const List<String> _kWindowsArtifacts = <String>[ 'flutter_windows.dll', 'flutter_windows.dll.exp', 'flutter_windows.dll.lib', 'flutter_windows.dll.pdb', 'flutter_export.h', 'flutter_messenger.h', 'flutter_plugin_registrar.h', 'flutter_texture_registrar.h', 'flutter_windows.h', ]; const String _kWindowsDepfile = 'windows_engine_sources.d'; /// Copies the Windows desktop embedding files to the copy directory. class UnpackWindows extends Target { const UnpackWindows(this.targetPlatform); final TargetPlatform targetPlatform; @override String get name => 'unpack_windows'; @override List<Source> get inputs => const <Source>[ Source.pattern('{FLUTTER_ROOT}/packages/flutter_tools/lib/src/build_system/targets/windows.dart'), ]; @override List<Source> get outputs => const <Source>[]; @override List<String> get depfiles => const <String>[_kWindowsDepfile]; @override List<Target> get dependencies => const <Target>[]; @override Future<void> build(Environment environment) async { final String? buildModeEnvironment = environment.defines[kBuildMode]; if (buildModeEnvironment == null) { throw MissingDefineException(kBuildMode, name); } final BuildMode buildMode = BuildMode.fromCliName(buildModeEnvironment); final String engineSourcePath = environment.artifacts .getArtifactPath( Artifact.windowsDesktopPath, platform: targetPlatform, mode: buildMode, ); final String clientSourcePath = environment.artifacts .getArtifactPath( Artifact.windowsCppClientWrapper, platform: targetPlatform, mode: buildMode, ); final Directory outputDirectory = environment.fileSystem.directory( environment.fileSystem.path.join( environment.projectDir.path, 'windows', 'flutter', 'ephemeral', ), ); final Depfile depfile = unpackDesktopArtifacts( fileSystem: environment.fileSystem, artifacts: _kWindowsArtifacts, engineSourcePath: engineSourcePath, outputDirectory: outputDirectory, clientSourcePaths: <String>[clientSourcePath], icuDataPath: environment.artifacts.getArtifactPath( Artifact.icuData, platform: targetPlatform, ) ); environment.depFileService.writeToFile( depfile, environment.buildDir.childFile(_kWindowsDepfile), ); } } /// Creates a bundle for the Windows desktop target. abstract class BundleWindowsAssets extends Target { const BundleWindowsAssets(this.targetPlatform); final TargetPlatform targetPlatform; @override List<Target> get dependencies => <Target>[ const KernelSnapshot(), UnpackWindows(targetPlatform), ]; @override List<Source> get inputs => const <Source>[ Source.pattern('{FLUTTER_ROOT}/packages/flutter_tools/lib/src/build_system/targets/windows.dart'), Source.pattern('{PROJECT_DIR}/pubspec.yaml'), ...IconTreeShaker.inputs, ]; @override List<String> get depfiles => const <String>[ 'flutter_assets.d', ]; @override Future<void> build(Environment environment) async { final String? buildModeEnvironment = environment.defines[kBuildMode]; if (buildModeEnvironment == null) { throw MissingDefineException(kBuildMode, 'bundle_windows_assets'); } final BuildMode buildMode = BuildMode.fromCliName(buildModeEnvironment); final Directory outputDirectory = environment.outputDir .childDirectory('flutter_assets'); if (!outputDirectory.existsSync()) { outputDirectory.createSync(); } // Only copy the kernel blob in debug mode. if (buildMode == BuildMode.debug) { environment.buildDir.childFile('app.dill') .copySync(outputDirectory.childFile('kernel_blob.bin').path); } final Depfile depfile = await copyAssets( environment, outputDirectory, targetPlatform: targetPlatform, ); environment.depFileService.writeToFile( depfile, environment.buildDir.childFile('flutter_assets.d'), ); } } /// A wrapper for AOT compilation that copies app.so into the output directory. class WindowsAotBundle extends Target { /// Create a [WindowsAotBundle] wrapper for [aotTarget]. const WindowsAotBundle(this.aotTarget); /// The [AotElfBase] subclass that produces the app.so. final AotElfBase aotTarget; @override String get name => 'windows_aot_bundle'; @override List<Source> get inputs => const <Source>[ Source.pattern('{BUILD_DIR}/app.so'), ]; @override List<Source> get outputs => const <Source>[ Source.pattern('{OUTPUT_DIR}/windows/app.so'), ]; @override List<Target> get dependencies => <Target>[ aotTarget, ]; @override Future<void> build(Environment environment) async { final File outputFile = environment.buildDir.childFile('app.so'); final Directory outputDirectory = environment.outputDir.childDirectory('windows'); if (!outputDirectory.existsSync()) { outputDirectory.createSync(recursive: true); } outputFile.copySync(outputDirectory.childFile('app.so').path); } } class ReleaseBundleWindowsAssets extends BundleWindowsAssets { const ReleaseBundleWindowsAssets(super.targetPlatform); @override String get name => 'release_bundle_${getNameForTargetPlatform(targetPlatform)}_assets'; @override List<Source> get outputs => const <Source>[]; @override List<Target> get dependencies => <Target>[ ...super.dependencies, WindowsAotBundle(AotElfRelease(targetPlatform)), ]; } class ProfileBundleWindowsAssets extends BundleWindowsAssets { const ProfileBundleWindowsAssets(super.targetPlatform); @override String get name => 'profile_bundle_${getNameForTargetPlatform(targetPlatform)}_assets'; @override List<Source> get outputs => const <Source>[]; @override List<Target> get dependencies => <Target>[ ...super.dependencies, WindowsAotBundle(AotElfProfile(targetPlatform)), ]; } class DebugBundleWindowsAssets extends BundleWindowsAssets { const DebugBundleWindowsAssets(super.targetPlatform); @override String get name => 'debug_bundle_${getNameForTargetPlatform(targetPlatform)}_assets'; @override List<Source> get inputs => <Source>[ const Source.pattern('{BUILD_DIR}/app.dill'), ]; @override List<Source> get outputs => <Source>[ const Source.pattern('{OUTPUT_DIR}/flutter_assets/kernel_blob.bin'), ]; }
flutter/packages/flutter_tools/lib/src/build_system/targets/windows.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/build_system/targets/windows.dart", "repo_id": "flutter", "token_count": 2346 }
820
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:meta/meta.dart'; import '../android/android_sdk.dart'; import '../artifacts.dart'; import '../base/file_system.dart'; import '../base/logger.dart'; import '../base/os.dart'; import '../base/process.dart'; import '../build_info.dart'; import '../build_system/build_system.dart'; import '../cache.dart'; import '../commands/build_linux.dart'; import '../commands/build_macos.dart'; import '../commands/build_windows.dart'; import '../runner/flutter_command.dart'; import 'build_aar.dart'; import 'build_apk.dart'; import 'build_appbundle.dart'; import 'build_bundle.dart'; import 'build_ios.dart'; import 'build_ios_framework.dart'; import 'build_macos_framework.dart'; import 'build_preview.dart'; import 'build_web.dart'; class BuildCommand extends FlutterCommand { BuildCommand({ required Artifacts artifacts, required FileSystem fileSystem, required BuildSystem buildSystem, required OperatingSystemUtils osUtils, required Logger logger, required AndroidSdk? androidSdk, required ProcessUtils processUtils, bool verboseHelp = false, }){ _addSubcommand( BuildAarCommand( fileSystem: fileSystem, androidSdk: androidSdk, logger: logger, verboseHelp: verboseHelp, ) ); _addSubcommand(BuildApkCommand(logger: logger, verboseHelp: verboseHelp)); _addSubcommand(BuildAppBundleCommand(logger: logger, verboseHelp: verboseHelp)); _addSubcommand(BuildIOSCommand(logger: logger, verboseHelp: verboseHelp)); _addSubcommand(BuildIOSFrameworkCommand( logger: logger, buildSystem: buildSystem, verboseHelp: verboseHelp, )); _addSubcommand(BuildMacOSFrameworkCommand( logger: logger, buildSystem: buildSystem, verboseHelp: verboseHelp, )); _addSubcommand(BuildIOSArchiveCommand(logger: logger, verboseHelp: verboseHelp)); _addSubcommand(BuildBundleCommand(logger: logger, verboseHelp: verboseHelp)); _addSubcommand(BuildWebCommand( fileSystem: fileSystem, logger: logger, verboseHelp: verboseHelp, )); _addSubcommand(BuildMacosCommand(logger: logger, verboseHelp: verboseHelp)); _addSubcommand(BuildLinuxCommand( logger: logger, operatingSystemUtils: osUtils, verboseHelp: verboseHelp )); _addSubcommand(BuildWindowsCommand( logger: logger, operatingSystemUtils: osUtils, verboseHelp: verboseHelp, )); _addSubcommand(BuildPreviewCommand( artifacts: artifacts, flutterRoot: Cache.flutterRoot!, fs: fileSystem, logger: logger, processUtils: processUtils, verboseHelp: verboseHelp, )); } void _addSubcommand(BuildSubCommand command) { if (command.supported) { addSubcommand(command); } } @override final String name = 'build'; @override final String description = 'Build an executable app or install bundle.'; @override String get category => FlutterCommandCategory.project; @override Future<FlutterCommandResult> runCommand() async => FlutterCommandResult.fail(); } abstract class BuildSubCommand extends FlutterCommand { BuildSubCommand({ required this.logger, required bool verboseHelp }) { requiresPubspecYaml(); usesFatalWarningsOption(verboseHelp: verboseHelp); } @protected final Logger logger; @override bool get reportNullSafety => true; bool get supported => true; /// Display a message describing the current null safety runtime mode /// that was selected. /// /// This is similar to the run message in run_hot.dart @protected void displayNullSafetyMode(BuildInfo buildInfo) { if (buildInfo.nullSafetyMode != NullSafetyMode.sound) { logger.printStatus(''); logger.printStatus( 'Building without sound null safety ⚠️', emphasis: true, ); logger.printStatus( 'Dart 3 will only support sound null safety, see https://dart.dev/null-safety', ); } logger.printStatus(''); } }
flutter/packages/flutter_tools/lib/src/commands/build.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/commands/build.dart", "repo_id": "flutter", "token_count": 1513 }
821
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:meta/meta.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../android/gradle_utils.dart' as gradle; import '../base/common.dart'; import '../base/context.dart'; import '../base/file_system.dart'; import '../base/net.dart'; import '../base/terminal.dart'; import '../base/utils.dart'; import '../base/version.dart'; import '../base/version_range.dart'; import '../convert.dart'; import '../dart/pub.dart'; import '../features.dart'; import '../flutter_manifest.dart'; import '../flutter_project_metadata.dart'; import '../globals.dart' as globals; import '../ios/code_signing.dart'; import '../project.dart'; import '../reporting/reporting.dart'; import '../runner/flutter_command.dart'; import 'create_base.dart'; const String kPlatformHelp = 'The platforms supported by this project. ' 'Platform folders (e.g. android/) will be generated in the target project. ' 'This argument only works when "--template" is set to app or plugin. ' 'When adding platforms to a plugin project, the pubspec.yaml will be updated with the requested platform. ' 'Adding desktop platforms requires the corresponding desktop config setting to be enabled.'; class CreateCommand extends CreateBase { CreateCommand({ super.verboseHelp = false, }) { addPlatformsOptions(customHelp: kPlatformHelp); argParser.addOption( 'template', abbr: 't', allowed: FlutterProjectType.enabledValues .map<String>((FlutterProjectType e) => e.cliName), help: 'Specify the type of project to create.', valueHelp: 'type', allowedHelp: CliEnum.allowedHelp(FlutterProjectType.enabledValues), ); argParser.addOption( 'sample', abbr: 's', help: 'Specifies the Flutter code sample to use as the "main.dart" for an application. Implies ' '"--template=app". The value should be the sample ID of the desired sample from the API ' 'documentation website (https://api.flutter.dev/). An example can be found at: ' 'https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html', valueHelp: 'id', ); argParser.addFlag( 'empty', abbr: 'e', help: 'Specifies creating using an application template with a main.dart that is minimal, ' 'including no comments, as a starting point for a new application. Implies "--template=app".', ); argParser.addOption( 'list-samples', help: 'Specifies a JSON output file for a listing of Flutter code samples ' 'that can be created with "--sample".', valueHelp: 'path', ); } @override final String name = 'create'; @override final String description = 'Create a new Flutter project.\n\n' 'If run on a project that already exists, this will repair the project, recreating any files that are missing.'; @override String get category => FlutterCommandCategory.project; @override String get invocation => '${runner?.executableName} $name <output directory>'; @override Future<CustomDimensions> get usageValues async { return CustomDimensions( commandCreateProjectType: stringArg('template'), commandCreateAndroidLanguage: stringArg('android-language'), commandCreateIosLanguage: stringArg('ios-language'), ); } @override Future<Event> unifiedAnalyticsUsageValues(String commandPath) async => Event.commandUsageValues( workflow: commandPath, commandHasTerminal: hasTerminal, createProjectType: stringArg('template'), createAndroidLanguage: stringArg('android-language'), createIosLanguage: stringArg('ios-language'), ); // Lazy-initialize the net utilities with values from the context. late final Net _net = Net( httpClientFactory: context.get<HttpClientFactory>(), logger: globals.logger, platform: globals.platform, ); /// The hostname for the Flutter docs for the current channel. String get _snippetsHost => globals.flutterVersion.channel == 'stable' ? 'api.flutter.dev' : 'main-api.flutter.dev'; Future<String?> _fetchSampleFromServer(String sampleId) async { // Sanity check the sampleId if (sampleId.contains(RegExp(r'[^-\w\.]'))) { throwToolExit('Sample ID "$sampleId" contains invalid characters. Check the ID in the ' 'documentation and try again.'); } final Uri snippetsUri = Uri.https(_snippetsHost, 'snippets/$sampleId.dart'); final List<int>? data = await _net.fetchUrl(snippetsUri); if (data == null || data.isEmpty) { return null; } return utf8.decode(data); } /// Fetches the samples index file from the Flutter docs website. Future<String?> _fetchSamplesIndexFromServer() async { final Uri snippetsUri = Uri.https(_snippetsHost, 'snippets/index.json'); final List<int>? data = await _net.fetchUrl(snippetsUri, maxAttempts: 2); if (data == null || data.isEmpty) { return null; } return utf8.decode(data); } /// Fetches the samples index file from the server and writes it to /// [outputFilePath]. Future<void> _writeSamplesJson(String outputFilePath) async { try { final File outputFile = globals.fs.file(outputFilePath); if (outputFile.existsSync()) { throwToolExit('File "$outputFilePath" already exists', exitCode: 1); } final String? samplesJson = await _fetchSamplesIndexFromServer(); if (samplesJson == null) { throwToolExit('Unable to download samples', exitCode: 2); } else { outputFile.writeAsStringSync(samplesJson); globals.printStatus('Wrote samples JSON to "$outputFilePath"'); } } on Exception catch (e) { throwToolExit('Failed to write samples JSON to "$outputFilePath": $e', exitCode: 2); } } FlutterProjectType _getProjectType(Directory projectDir) { FlutterProjectType? template; FlutterProjectType? detectedProjectType; final bool metadataExists = projectDir.absolute.childFile('.metadata').existsSync(); final String? templateArgument = stringArg('template'); if (templateArgument != null) { template = FlutterProjectType.fromCliName(templateArgument); } // If the project directory exists and isn't empty, then try to determine the template // type from the project directory. if (projectDir.existsSync() && projectDir.listSync().isNotEmpty) { detectedProjectType = determineTemplateType(); if (detectedProjectType == null && metadataExists) { // We can only be definitive that this is the wrong type if the .metadata file // exists and contains a type that we don't understand, or doesn't contain a type. throwToolExit('Sorry, unable to detect the type of project to recreate. ' 'Try creating a fresh project and migrating your existing code to ' 'the new project manually.'); } } template ??= detectedProjectType ?? FlutterProjectType.app; if (detectedProjectType != null && template != detectedProjectType && metadataExists) { // We can only be definitive that this is the wrong type if the .metadata file // exists and contains a type that doesn't match. throwToolExit("The requested template type '${template.cliName}' doesn't match the " "existing template type of '${detectedProjectType.cliName}'."); } return template; } @override Future<FlutterCommandResult> runCommand() async { final String? listSamples = stringArg('list-samples'); if (listSamples != null) { // _writeSamplesJson can potentially be long-lived. await _writeSamplesJson(listSamples); return FlutterCommandResult.success(); } if (argResults!.wasParsed('empty') && argResults!.wasParsed('sample')) { throwToolExit( 'Only one of --empty or --sample may be specified, not both.', exitCode: 2, ); } validateOutputDirectoryArg(); String? sampleCode; final String? sampleArgument = stringArg('sample'); final bool emptyArgument = boolArg('empty'); final FlutterProjectType template = _getProjectType(projectDir); if (sampleArgument != null) { if (template != FlutterProjectType.app) { throwToolExit('Cannot specify --sample with a project type other than ' '"${FlutterProjectType.app.cliName}"'); } // Fetch the sample from the server. sampleCode = await _fetchSampleFromServer(sampleArgument); } if (emptyArgument && template != FlutterProjectType.app) { throwToolExit('The --empty flag is only supported for the app template.'); } final bool generateModule = template == FlutterProjectType.module; final bool generateMethodChannelsPlugin = template == FlutterProjectType.plugin; final bool generateFfiPackage = template == FlutterProjectType.packageFfi; final bool generateFfiPlugin = template == FlutterProjectType.pluginFfi; final bool generateFfi = generateFfiPlugin || generateFfiPackage; final bool generatePackage = template == FlutterProjectType.package; final List<String> platforms = stringsArg('platforms'); // `--platforms` does not support module or package. if (argResults!.wasParsed('platforms') && (generateModule || generatePackage || generateFfiPackage)) { final String template = generateModule ? 'module' : 'package'; throwToolExit( 'The "--platforms" argument is not supported in $template template.', exitCode: 2 ); } else if (platforms.isEmpty) { throwToolExit('Must specify at least one platform using --platforms', exitCode: 2); } else if (generateFfiPlugin && argResults!.wasParsed('platforms') && platforms.contains('web')) { throwToolExit( 'The web platform is not supported in plugin_ffi template.', exitCode: 2, ); } else if (generateFfi && argResults!.wasParsed('ios-language')) { throwToolExit( 'The "ios-language" option is not supported with the ${template.cliName} ' 'template: the language will always be C or C++.', exitCode: 2, ); } else if (generateFfi && argResults!.wasParsed('android-language')) { throwToolExit( 'The "android-language" option is not supported with the ${template.cliName} ' 'template: the language will always be C or C++.', exitCode: 2, ); } final String organization = await getOrganization(); final bool overwrite = boolArg('overwrite'); validateProjectDir(overwrite: overwrite); if (boolArg('with-driver-test')) { globals.printWarning( 'The "--with-driver-test" argument has been deprecated and will no longer add a flutter ' 'driver template. Instead, learn how to use package:integration_test by ' 'visiting https://pub.dev/packages/integration_test .' ); } final String dartSdk = globals.cache.dartSdkBuild; final bool includeIos; final bool includeAndroid; final bool includeWeb; final bool includeLinux; final bool includeMacos; final bool includeWindows; if (template == FlutterProjectType.module) { // The module template only supports iOS and Android. includeIos = true; includeAndroid = true; includeWeb = false; includeLinux = false; includeMacos = false; includeWindows = false; } else if (template == FlutterProjectType.package) { // The package template does not supports any platform. includeIos = false; includeAndroid = false; includeWeb = false; includeLinux = false; includeMacos = false; includeWindows = false; } else { includeIos = featureFlags.isIOSEnabled && platforms.contains('ios'); includeAndroid = featureFlags.isAndroidEnabled && platforms.contains('android'); includeWeb = featureFlags.isWebEnabled && platforms.contains('web'); includeLinux = featureFlags.isLinuxEnabled && platforms.contains('linux'); includeMacos = featureFlags.isMacOSEnabled && platforms.contains('macos'); includeWindows = featureFlags.isWindowsEnabled && platforms.contains('windows'); } String? developmentTeam; if (includeIos) { developmentTeam = await getCodeSigningIdentityDevelopmentTeam( processManager: globals.processManager, platform: globals.platform, logger: globals.logger, config: globals.config, terminal: globals.terminal, ); } // The dart project_name is in snake_case, this variable is the Title Case of the Project Name. final String titleCaseProjectName = snakeCaseToTitleCase(projectName); final Map<String, Object?> templateContext = createTemplateContext( organization: organization, projectName: projectName, titleCaseProjectName: titleCaseProjectName, projectDescription: stringArg('description'), flutterRoot: flutterRoot, withPlatformChannelPluginHook: generateMethodChannelsPlugin, withFfiPluginHook: generateFfiPlugin, withFfiPackage: generateFfiPackage, withEmptyMain: emptyArgument, androidLanguage: stringArg('android-language'), iosLanguage: stringArg('ios-language'), iosDevelopmentTeam: developmentTeam, ios: includeIos, android: includeAndroid, web: includeWeb, linux: includeLinux, macos: includeMacos, windows: includeWindows, dartSdkVersionBounds: "'>=$dartSdk <4.0.0'", implementationTests: boolArg('implementation-tests'), agpVersion: gradle.templateAndroidGradlePluginVersion, kotlinVersion: gradle.templateKotlinGradlePluginVersion, gradleVersion: gradle.templateDefaultGradleVersion, ); final String relativeDirPath = globals.fs.path.relative(projectDirPath); final bool creatingNewProject = !projectDir.existsSync() || projectDir.listSync().isEmpty; if (creatingNewProject) { globals.printStatus('Creating project $relativeDirPath...'); } else { if (sampleCode != null && !overwrite) { throwToolExit('Will not overwrite existing project in $relativeDirPath: ' 'must specify --overwrite for samples to overwrite.'); } globals.printStatus('Recreating project $relativeDirPath...'); } final Directory relativeDir = globals.fs.directory(projectDirPath); int generatedFileCount = 0; final PubContext pubContext; switch (template) { case FlutterProjectType.app: generatedFileCount += await generateApp( <String>['app', 'app_test_widget'], relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, projectType: template, ); pubContext = PubContext.create; case FlutterProjectType.skeleton: generatedFileCount += await generateApp( <String>['skeleton'], relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, generateMetadata: false, ); pubContext = PubContext.create; case FlutterProjectType.module: generatedFileCount += await _generateModule( relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, ); pubContext = PubContext.create; case FlutterProjectType.package: generatedFileCount += await _generatePackage( relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, ); pubContext = PubContext.createPackage; case FlutterProjectType.plugin: generatedFileCount += await _generateMethodChannelPlugin( relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, projectType: template, ); pubContext = PubContext.createPlugin; case FlutterProjectType.pluginFfi: generatedFileCount += await _generateFfiPlugin( relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, projectType: template, ); pubContext = PubContext.createPlugin; case FlutterProjectType.packageFfi: generatedFileCount += await _generateFfiPackage( relativeDir, templateContext, overwrite: overwrite, printStatusWhenWriting: !creatingNewProject, projectType: template, ); pubContext = PubContext.createPackage; } if (boolArg('pub')) { final FlutterProject project = FlutterProject.fromDirectory(relativeDir); await pub.get( context: pubContext, project: project, offline: boolArg('offline'), outputMode: PubOutputMode.summaryOnly, ); // Setting `includeIos` etc to false as with FlutterProjectType.package // causes the example sub directory to not get os sub directories. // This will lead to `flutter build ios` to fail in the example. // TODO(dacoharkes): Uncouple the app and parent project platforms. https://github.com/flutter/flutter/issues/133874 // Then this if can be removed. if (!generateFfiPackage) { await project.ensureReadyForPlatformSpecificTooling( androidPlatform: includeAndroid, iosPlatform: includeIos, linuxPlatform: includeLinux, macOSPlatform: includeMacos, windowsPlatform: includeWindows, webPlatform: includeWeb, ); } } if (sampleCode != null) { _applySample(relativeDir, sampleCode); } if (sampleCode != null || emptyArgument) { generatedFileCount += _removeTestDir(relativeDir); } globals.printStatus('Wrote $generatedFileCount files.'); globals.printStatus('\nAll done!'); final String application = '${emptyArgument ? 'empty ' : ''}${sampleCode != null ? 'sample ' : ''}application'; if (generatePackage) { final String relativeMainPath = globals.fs.path.normalize(globals.fs.path.join( relativeDirPath, 'lib', '${templateContext['projectName']}.dart', )); globals.printStatus('Your package code is in $relativeMainPath'); } else if (generateModule) { final String relativeMainPath = globals.fs.path.normalize(globals.fs.path.join( relativeDirPath, 'lib', 'main.dart', )); globals.printStatus('Your module code is in $relativeMainPath.'); } else if (generateMethodChannelsPlugin || generateFfiPlugin) { final String relativePluginPath = globals.fs.path.normalize(globals.fs.path.relative(projectDirPath)); final List<String> requestedPlatforms = _getUserRequestedPlatforms(); final String platformsString = requestedPlatforms.join(', '); _printPluginDirectoryLocationMessage(relativePluginPath, projectName, platformsString); if (!creatingNewProject && requestedPlatforms.isNotEmpty) { _printPluginUpdatePubspecMessage(relativePluginPath, platformsString); } else if (_getSupportedPlatformsInPlugin(projectDir).isEmpty) { _printNoPluginMessage(); } final List<String> platformsToWarn = _getPlatformWarningList(requestedPlatforms); if (platformsToWarn.isNotEmpty) { _printWarningDisabledPlatform(platformsToWarn); } final String template = generateMethodChannelsPlugin ? 'plugin' : 'plugin_ffi'; _printPluginAddPlatformMessage(relativePluginPath, template); } else { // Tell the user the next steps. final FlutterProject project = FlutterProject.fromDirectory(globals.fs.directory(projectDirPath)); final FlutterProject app = project.hasExampleApp ? project.example : project; final String relativeAppPath = globals.fs.path.normalize(globals.fs.path.relative(app.directory.path)); final String relativeAppMain = globals.fs.path.join(relativeAppPath, 'lib', 'main.dart'); final List<String> requestedPlatforms = _getUserRequestedPlatforms(); // Let them know a summary of the state of their tooling. globals.printStatus(''' You can find general documentation for Flutter at: https://docs.flutter.dev/ Detailed API documentation is available at: https://api.flutter.dev/ If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev In order to run your $application, type: \$ cd $relativeAppPath \$ flutter run Your $application code is in $relativeAppMain. '''); // Show warning if any selected platform is not enabled final List<String> platformsToWarn = _getPlatformWarningList(requestedPlatforms); if (platformsToWarn.isNotEmpty) { _printWarningDisabledPlatform(platformsToWarn); } } // Show warning for Java/AGP or Java/Gradle incompatibility if building for // Android and Java version has been detected. if (includeAndroid && globals.java?.version != null) { _printIncompatibleJavaAgpGradleVersionsWarning( javaVersion: versionToParsableString(globals.java?.version)!, templateGradleVersion: templateContext['gradleVersion']! as String, templateAgpVersion: templateContext['agpVersion']! as String, templateAgpVersionForModule: templateContext['agpVersionForModule']! as String, projectType: template, projectDirPath: projectDirPath, ); } return FlutterCommandResult.success(); } Future<int> _generateModule( Directory directory, Map<String, Object?> templateContext, { bool overwrite = false, bool printStatusWhenWriting = true, }) async { int generatedCount = 0; final String? description = argResults!.wasParsed('description') ? stringArg('description') : 'A new Flutter module project.'; templateContext['description'] = description; generatedCount += await renderTemplate( globals.fs.path.join('module', 'common'), directory, templateContext, overwrite: overwrite, printStatusWhenWriting: printStatusWhenWriting, ); return generatedCount; } Future<int> _generatePackage( Directory directory, Map<String, Object?> templateContext, { bool overwrite = false, bool printStatusWhenWriting = true, }) async { int generatedCount = 0; final String? description = argResults!.wasParsed('description') ? stringArg('description') : 'A new Flutter package project.'; templateContext['description'] = description; generatedCount += await renderTemplate( 'package', directory, templateContext, overwrite: overwrite, printStatusWhenWriting: printStatusWhenWriting, ); return generatedCount; } Future<int> _generateMethodChannelPlugin( Directory directory, Map<String, Object?> templateContext, { bool overwrite = false, bool printStatusWhenWriting = true, required FlutterProjectType projectType, }) async { // Plugins only add a platform if it was requested explicitly by the user. if (!argResults!.wasParsed('platforms')) { for (final String platform in kAllCreatePlatforms) { templateContext[platform] = false; } } final List<String> platformsToAdd = _getSupportedPlatformsFromTemplateContext(templateContext); final List<String> existingPlatforms = _getSupportedPlatformsInPlugin(directory); for (final String existingPlatform in existingPlatforms) { // re-generate files for existing platforms templateContext[existingPlatform] = true; } final bool willAddPlatforms = platformsToAdd.isNotEmpty; templateContext['no_platforms'] = !willAddPlatforms; int generatedCount = 0; final String? description = argResults!.wasParsed('description') ? stringArg('description') : 'A new Flutter plugin project.'; templateContext['description'] = description; generatedCount += await renderMerged( <String>['plugin', 'plugin_shared'], directory, templateContext, overwrite: overwrite, printStatusWhenWriting: printStatusWhenWriting, ); final FlutterProject project = FlutterProject.fromDirectory(directory); final bool generateAndroid = templateContext['android'] == true; if (generateAndroid) { gradle.updateLocalProperties( project: project, requireAndroidSdk: false); } final String? projectName = templateContext['projectName'] as String?; final String organization = templateContext['organization']! as String; // Required to make the context. final String? androidPluginIdentifier = templateContext['androidIdentifier'] as String?; final String exampleProjectName = '${projectName}_example'; templateContext['projectName'] = exampleProjectName; templateContext['androidIdentifier'] = CreateBase.createAndroidIdentifier(organization, exampleProjectName); templateContext['iosIdentifier'] = CreateBase.createUTIIdentifier(organization, exampleProjectName); templateContext['macosIdentifier'] = CreateBase.createUTIIdentifier(organization, exampleProjectName); templateContext['windowsIdentifier'] = CreateBase.createWindowsIdentifier(organization, exampleProjectName); templateContext['description'] = 'Demonstrates how to use the $projectName plugin.'; templateContext['pluginProjectName'] = projectName; templateContext['androidPluginIdentifier'] = androidPluginIdentifier; generatedCount += await generateApp( <String>['app', 'app_test_widget', 'app_integration_test'], project.example.directory, templateContext, overwrite: overwrite, pluginExampleApp: true, printStatusWhenWriting: printStatusWhenWriting, projectType: projectType, ); return generatedCount; } Future<int> _generateFfiPlugin( Directory directory, Map<String, Object?> templateContext, { bool overwrite = false, bool printStatusWhenWriting = true, required FlutterProjectType projectType, }) async { // Plugins only add a platform if it was requested explicitly by the user. if (!argResults!.wasParsed('platforms')) { for (final String platform in kAllCreatePlatforms) { templateContext[platform] = false; } } final List<String> platformsToAdd = _getSupportedPlatformsFromTemplateContext(templateContext); final List<String> existingPlatforms = _getSupportedPlatformsInPlugin(directory); for (final String existingPlatform in existingPlatforms) { // re-generate files for existing platforms templateContext[existingPlatform] = true; } final bool willAddPlatforms = platformsToAdd.isNotEmpty; templateContext['no_platforms'] = !willAddPlatforms; int generatedCount = 0; final String? description = argResults!.wasParsed('description') ? stringArg('description') : 'A new Flutter FFI plugin project.'; templateContext['description'] = description; generatedCount += await renderMerged( <String>['plugin_ffi', 'plugin_shared'], directory, templateContext, overwrite: overwrite, printStatusWhenWriting: printStatusWhenWriting, ); final FlutterProject project = FlutterProject.fromDirectory(directory); final bool generateAndroid = templateContext['android'] == true; if (generateAndroid) { gradle.updateLocalProperties(project: project, requireAndroidSdk: false); } final String? projectName = templateContext['projectName'] as String?; final String organization = templateContext['organization']! as String; // Required to make the context. final String? androidPluginIdentifier = templateContext['androidIdentifier'] as String?; final String exampleProjectName = '${projectName}_example'; templateContext['projectName'] = exampleProjectName; templateContext['androidIdentifier'] = CreateBase.createAndroidIdentifier(organization, exampleProjectName); templateContext['iosIdentifier'] = CreateBase.createUTIIdentifier(organization, exampleProjectName); templateContext['macosIdentifier'] = CreateBase.createUTIIdentifier(organization, exampleProjectName); templateContext['windowsIdentifier'] = CreateBase.createWindowsIdentifier(organization, exampleProjectName); templateContext['description'] = 'Demonstrates how to use the $projectName plugin.'; templateContext['pluginProjectName'] = projectName; templateContext['androidPluginIdentifier'] = androidPluginIdentifier; generatedCount += await generateApp( <String>['app'], project.example.directory, templateContext, overwrite: overwrite, pluginExampleApp: true, printStatusWhenWriting: printStatusWhenWriting, projectType: projectType, ); return generatedCount; } Future<int> _generateFfiPackage( Directory directory, Map<String, Object?> templateContext, { bool overwrite = false, bool printStatusWhenWriting = true, required FlutterProjectType projectType, }) async { int generatedCount = 0; final String? description = argResults!.wasParsed('description') ? stringArg('description') : 'A new Dart FFI package project.'; templateContext['description'] = description; generatedCount += await renderMerged( <String>[ 'package_ffi', ], directory, templateContext, overwrite: overwrite, printStatusWhenWriting: printStatusWhenWriting, ); final FlutterProject project = FlutterProject.fromDirectory(directory); final String? projectName = templateContext['projectName'] as String?; final String exampleProjectName = '${projectName}_example'; templateContext['projectName'] = exampleProjectName; templateContext['description'] = 'Demonstrates how to use the $projectName package.'; templateContext['pluginProjectName'] = projectName; generatedCount += await generateApp( <String>['app'], project.example.directory, templateContext, overwrite: overwrite, pluginExampleApp: true, printStatusWhenWriting: printStatusWhenWriting, projectType: projectType, ); return generatedCount; } // Takes an application template and replaces the main.dart with one from the // documentation website in sampleCode. Returns the difference in the number // of files after applying the sample, since it also deletes the application's // test directory (since the template's test doesn't apply to the sample). void _applySample(Directory directory, String sampleCode) { final File mainDartFile = directory.childDirectory('lib').childFile('main.dart'); mainDartFile.createSync(recursive: true); mainDartFile.writeAsStringSync(sampleCode); } int _removeTestDir(Directory directory) { final Directory testDir = directory.childDirectory('test'); if (!testDir.existsSync()) { return 0; } final List<FileSystemEntity> files = testDir.listSync(recursive: true); try { testDir.deleteSync(recursive: true); } on FileSystemException catch (exception) { throwToolExit('Failed to delete test directory: $exception'); } return -files.length; } List<String> _getSupportedPlatformsFromTemplateContext(Map<String, Object?> templateContext) { return <String>[ for (final String platform in kAllCreatePlatforms) if (templateContext[platform] == true) platform, ]; } // Returns a list of platforms that are explicitly requested by user via `--platforms`. List<String> _getUserRequestedPlatforms() { if (!argResults!.wasParsed('platforms')) { return <String>[]; } return stringsArg('platforms'); } } // Determine what platforms are supported based on generated files. List<String> _getSupportedPlatformsInPlugin(Directory projectDir) { final String pubspecPath = globals.fs.path.join(projectDir.absolute.path, 'pubspec.yaml'); final FlutterManifest? manifest = FlutterManifest.createFromPath(pubspecPath, fileSystem: globals.fs, logger: globals.logger); final Map<String, Object?>? validSupportedPlatforms = manifest?.validSupportedPlatforms; final List<String> platforms = validSupportedPlatforms == null ? <String>[] : validSupportedPlatforms.keys.toList(); return platforms; } void _printPluginDirectoryLocationMessage(String pluginPath, String projectName, String platformsString) { final String relativePluginMain = globals.fs.path.join(pluginPath, 'lib', '$projectName.dart'); final String relativeExampleMain = globals.fs.path.join(pluginPath, 'example', 'lib', 'main.dart'); globals.printStatus(''' Your plugin code is in $relativePluginMain. Your example app code is in $relativeExampleMain. '''); if (platformsString.isNotEmpty) { globals.printStatus(''' Host platform code is in the $platformsString directories under $pluginPath. To edit platform code in an IDE see https://flutter.dev/developing-packages/#edit-plugin-package. '''); } } void _printPluginUpdatePubspecMessage(String pluginPath, String platformsString) { globals.printStatus(''' You need to update $pluginPath/pubspec.yaml to support $platformsString. ''', emphasis: true, color: TerminalColor.red); } void _printNoPluginMessage() { globals.printError(''' You've created a plugin project that doesn't yet support any platforms. '''); } void _printPluginAddPlatformMessage(String pluginPath, String template) { globals.printStatus(''' To add platforms, run `flutter create -t $template --platforms <platforms> .` under $pluginPath. For more information, see https://flutter.dev/go/plugin-platforms. '''); } // returns a list disabled, but requested platforms List<String> _getPlatformWarningList(List<String> requestedPlatforms) { final List<String> platformsToWarn = <String>[ if (requestedPlatforms.contains('web') && !featureFlags.isWebEnabled) 'web', if (requestedPlatforms.contains('macos') && !featureFlags.isMacOSEnabled) 'macos', if (requestedPlatforms.contains('windows') && !featureFlags.isWindowsEnabled) 'windows', if (requestedPlatforms.contains('linux') && !featureFlags.isLinuxEnabled) 'linux', ]; return platformsToWarn; } void _printWarningDisabledPlatform(List<String> platforms) { final List<String> desktop = <String>[]; final List<String> web = <String>[]; for (final String platform in platforms) { switch (platform) { case 'web': web.add(platform); case 'macos' || 'windows' || 'linux': desktop.add(platform); } } if (desktop.isNotEmpty) { final String platforms = desktop.length > 1 ? 'platforms' : 'platform'; final String verb = desktop.length > 1 ? 'are' : 'is'; globals.printStatus(''' The desktop $platforms: ${desktop.join(', ')} $verb currently not supported on your local environment. For more details, see: https://flutter.dev/desktop '''); } if (web.isNotEmpty) { globals.printStatus(''' The web is currently not supported on your local environment. For more details, see: https://flutter.dev/docs/get-started/web '''); } } // Prints a warning if the specified Java version conflicts with either the // template Gradle or AGP version. // // Assumes the specified templateGradleVersion and templateAgpVersion are // compatible, meaning that the Java version may only conflict with one of the // template Gradle or AGP versions. void _printIncompatibleJavaAgpGradleVersionsWarning({ required String javaVersion, required String templateGradleVersion, required String templateAgpVersion, required String templateAgpVersionForModule, required FlutterProjectType projectType, required String projectDirPath}) { // Determine if the Java version specified conflicts with the template Gradle or AGP version. final bool javaGradleVersionsCompatible = gradle.validateJavaAndGradle(globals.logger, javaV: javaVersion, gradleV: templateGradleVersion); bool javaAgpVersionsCompatible = gradle.validateJavaAndAgp(globals.logger, javaV: javaVersion, agpV: templateAgpVersion); String relevantTemplateAgpVersion = templateAgpVersion; if (projectType == FlutterProjectType.module && Version.parse(templateAgpVersion)! < Version.parse(templateAgpVersionForModule)!) { // If a module is being created, make sure to check for Java/AGP compatibility between the highest used version of AGP in the module template. javaAgpVersionsCompatible = gradle.validateJavaAndAgp(globals.logger, javaV: javaVersion, agpV: templateAgpVersionForModule); relevantTemplateAgpVersion = templateAgpVersionForModule; } if (javaGradleVersionsCompatible && javaAgpVersionsCompatible) { return; } // Determine header of warning with recommended fix of re-configuring Java version. final String incompatibleVersionsAndRecommendedOptionMessage = getIncompatibleJavaGradleAgpMessageHeader(javaGradleVersionsCompatible, templateGradleVersion, relevantTemplateAgpVersion, projectType.cliName); if (!javaGradleVersionsCompatible) { if (projectType == FlutterProjectType.plugin || projectType == FlutterProjectType.pluginFfi) { // Only impacted files could be in sample code. return; } // Gradle template version incompatible with Java version. final gradle.JavaGradleCompat? validCompatibleGradleVersionRange = gradle.getValidGradleVersionRangeForJavaVersion(globals.logger, javaV: javaVersion); final String compatibleGradleVersionMessage = validCompatibleGradleVersionRange == null ? '' : ' (compatible Gradle version range: ${validCompatibleGradleVersionRange.gradleMin} - ${validCompatibleGradleVersionRange.gradleMax})'; globals.printWarning(''' $incompatibleVersionsAndRecommendedOptionMessage Alternatively, to continue using your configured Java version, update the Gradle version specified in the following file to a compatible Gradle version$compatibleGradleVersionMessage: ${_getGradleWrapperPropertiesFilePath(projectType, projectDirPath)} You may also update the Gradle version used by running `./gradlew wrapper --gradle-version=<COMPATIBLE_GRADLE_VERSION>`. See https://docs.gradle.org/current/userguide/compatibility.html#java for details on compatible Java/Gradle versions, and see https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper for more details on using the Gradle Wrapper command to update the Gradle version used. ''', emphasis: true ); return; } // AGP template version incompatible with Java version. final gradle.JavaAgpCompat? minimumCompatibleAgpVersion = gradle.getMinimumAgpVersionForJavaVersion(globals.logger, javaV: javaVersion); final String compatibleAgpVersionMessage = minimumCompatibleAgpVersion == null ? '' : ' (minimum compatible AGP version: ${minimumCompatibleAgpVersion.agpMin})'; final String gradleBuildFilePaths = ' - ${_getBuildGradleConfigurationFilePaths(projectType, projectDirPath)!.join('\n - ')}'; globals.printWarning(''' $incompatibleVersionsAndRecommendedOptionMessage Alternatively, to continue using your configured Java version, update the AGP version specified in the following files to a compatible AGP version$compatibleAgpVersionMessage as necessary: $gradleBuildFilePaths See https://developer.android.com/build/releases/gradle-plugin for details on compatible Java/AGP versions. ''', emphasis: true ); } // Returns incompatible Java/template Gradle/template AGP message header based // on incompatibility and project type. @visibleForTesting String getIncompatibleJavaGradleAgpMessageHeader( bool javaGradleVersionsCompatible, String templateGradleVersion, String templateAgpVersion, String projectType) { final String incompatibleDependency = javaGradleVersionsCompatible ? 'Android Gradle Plugin (AGP)' :'Gradle' ; final String incompatibleDependencyVersion = javaGradleVersionsCompatible ? 'AGP version $templateAgpVersion' : 'Gradle version $templateGradleVersion'; final VersionRange validJavaRange = gradle.getJavaVersionFor(gradleV: templateGradleVersion, agpV: templateAgpVersion); // validJavaRange should have non-null versionMin and versionMax since it based on our template AGP and Gradle versions. final String validJavaRangeMessage = '(Java ${validJavaRange.versionMin!} <= compatible Java version < Java ${validJavaRange.versionMax!})'; return ''' The configured version of Java detected may conflict with the $incompatibleDependency version in your new Flutter $projectType. [RECOMMENDED] If so, to keep the default $incompatibleDependencyVersion, make sure to download a compatible Java version $validJavaRangeMessage. You may configure this compatible Java version by running: `flutter config --jdk-dir=<JDK_DIRECTORY>` Note that this is a global configuration for Flutter. '''; } // Returns path of the gradle-wrapper.properties file for the specified // generated project type. String? _getGradleWrapperPropertiesFilePath(FlutterProjectType projectType, String projectDirPath) { String gradleWrapperPropertiesFilePath = ''; switch (projectType) { case FlutterProjectType.app: case FlutterProjectType.skeleton: gradleWrapperPropertiesFilePath = globals.fs.path.join(projectDirPath, 'android/gradle/wrapper/gradle-wrapper.properties'); case FlutterProjectType.module: gradleWrapperPropertiesFilePath = globals.fs.path.join(projectDirPath, '.android/gradle/wrapper/gradle-wrapper.properties'); case FlutterProjectType.plugin: case FlutterProjectType.pluginFfi: case FlutterProjectType.package: case FlutterProjectType.packageFfi: // TODO(camsim99): Add relevant file path for packageFfi when Android is supported. // No gradle-wrapper.properties files not part of sample code that // can be determined. return null; } return gradleWrapperPropertiesFilePath; } // Returns the path(s) of the build.gradle file(s) for the specified generated // project type. List<String>? _getBuildGradleConfigurationFilePaths(FlutterProjectType projectType, String projectDirPath) { final List<String> buildGradleConfigurationFilePaths = <String>[]; switch (projectType) { case FlutterProjectType.app: case FlutterProjectType.skeleton: case FlutterProjectType.pluginFfi: buildGradleConfigurationFilePaths.add(globals.fs.path.join(projectDirPath, 'android/build.gradle')); case FlutterProjectType.module: const String moduleBuildGradleFilePath = '.android/build.gradle'; const String moduleAppBuildGradleFlePath = '.android/app/build.gradle'; const String moduleFlutterBuildGradleFilePath = '.android/Flutter/build.gradle'; buildGradleConfigurationFilePaths.addAll(<String>[ globals.fs.path.join(projectDirPath, moduleBuildGradleFilePath), globals.fs.path.join(projectDirPath, moduleAppBuildGradleFlePath), globals.fs.path.join(projectDirPath, moduleFlutterBuildGradleFilePath), ]); case FlutterProjectType.plugin: buildGradleConfigurationFilePaths.add(globals.fs.path.join(projectDirPath, 'android/app/build.gradle')); case FlutterProjectType.package: case FlutterProjectType.packageFfi: // TODO(camsim99): Add any relevant file paths for packageFfi when Android is supported. // No build.gradle file because there is no platform-specific implementation. return null; } return buildGradleConfigurationFilePaths; }
flutter/packages/flutter_tools/lib/src/commands/create.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/commands/create.dart", "repo_id": "flutter", "token_count": 14409 }
822
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../runner/flutter_command.dart'; class MakeHostAppEditableCommand extends FlutterCommand { MakeHostAppEditableCommand() { requiresPubspecYaml(); argParser.addFlag( 'ios', help: "Whether to make this project's iOS app editable.", negatable: false, ); argParser.addFlag( 'android', help: "Whether ot make this project's Android app editable.", negatable: false, ); } @override final String name = 'make-host-app-editable'; @override bool get deprecated => true; @override final String description = 'Moves host apps from generated directories to non-generated directories so that they can be edited by developers.'; @override Future<FlutterCommandResult> runCommand() async { // Deprecated. No-op. return FlutterCommandResult.success(); } }
flutter/packages/flutter_tools/lib/src/commands/make_host_app_editable.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/commands/make_host_app_editable.dart", "repo_id": "flutter", "token_count": 319 }
823
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:meta/meta.dart'; import '../doctor_validator.dart'; import '../features.dart'; /// The custom-devices-specific implementation of a [Workflow]. /// /// Will apply to the host platform / be able to launch & list devices only if /// the custom devices feature is enabled in the featureFlags argument. /// /// Can't list emulators at all. @immutable class CustomDeviceWorkflow implements Workflow { const CustomDeviceWorkflow({ required FeatureFlags featureFlags }) : _featureFlags = featureFlags; final FeatureFlags _featureFlags; @override bool get appliesToHostPlatform => _featureFlags.areCustomDevicesEnabled; @override bool get canLaunchDevices => _featureFlags.areCustomDevicesEnabled; @override bool get canListDevices => _featureFlags.areCustomDevicesEnabled; @override bool get canListEmulators => false; }
flutter/packages/flutter_tools/lib/src/custom_devices/custom_device_workflow.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/custom_devices/custom_device_workflow.dart", "repo_id": "flutter", "token_count": 279 }
824
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:dds/dap.dart' hide DapServer; import '../base/file_system.dart'; import '../base/platform.dart'; import '../debug_adapters/flutter_adapter.dart'; import '../debug_adapters/flutter_adapter_args.dart'; import 'flutter_test_adapter.dart'; /// A DAP server that communicates over a [ByteStreamServerChannel], usually constructed from the processes stdin/stdout streams. /// /// The server is intended to be single-use. It should live only for the /// duration of a single debug session in the editor, and terminate when the /// user stops debugging. If a user starts multiple debug sessions /// simultaneously it is expected that the editor will start multiple debug /// adapters. class DapServer { DapServer( Stream<List<int>> input, StreamSink<List<int>> output, { required FileSystem fileSystem, required Platform platform, this.ipv6 = false, this.enableDds = true, this.enableAuthCodes = true, bool test = false, this.logger, void Function(Object? e)? onError, }) : channel = ByteStreamServerChannel(input, output, logger) { adapter = test ? FlutterTestDebugAdapter( channel, fileSystem: fileSystem, platform: platform, ipv6: ipv6, enableFlutterDds: enableDds, enableAuthCodes: enableAuthCodes, logger: logger, onError: onError, ) : FlutterDebugAdapter( channel, fileSystem: fileSystem, platform: platform, enableFlutterDds: enableDds, enableAuthCodes: enableAuthCodes, logger: logger, onError: onError, ); } final ByteStreamServerChannel channel; late final DartDebugAdapter<FlutterLaunchRequestArguments, FlutterAttachRequestArguments> adapter; final bool ipv6; final bool enableDds; final bool enableAuthCodes; final Logger? logger; void stop() { channel.close(); } }
flutter/packages/flutter_tools/lib/src/debug_adapters/server.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/debug_adapters/server.dart", "repo_id": "flutter", "token_count": 804 }
825
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:meta/meta.dart'; import 'package:pub_semver/pub_semver.dart'; import 'package:yaml/yaml.dart'; import 'base/deferred_component.dart'; import 'base/file_system.dart'; import 'base/logger.dart'; import 'base/utils.dart'; import 'globals.dart' as globals; import 'plugins.dart'; /// Whether or not Impeller Scene 3D model import is enabled. const bool kIs3dSceneSupported = true; const Set<String> _kValidPluginPlatforms = <String>{ 'android', 'ios', 'web', 'windows', 'linux', 'macos', }; /// A wrapper around the `flutter` section in the `pubspec.yaml` file. class FlutterManifest { FlutterManifest._({required Logger logger}) : _logger = logger; /// Returns an empty manifest. factory FlutterManifest.empty({ required Logger logger }) = FlutterManifest._; /// Returns null on invalid manifest. Returns empty manifest on missing file. static FlutterManifest? createFromPath(String path, { required FileSystem fileSystem, required Logger logger, }) { if (!fileSystem.isFileSync(path)) { return _createFromYaml(null, logger); } final String manifest = fileSystem.file(path).readAsStringSync(); return FlutterManifest.createFromString(manifest, logger: logger); } /// Returns null on missing or invalid manifest. @visibleForTesting static FlutterManifest? createFromString(String manifest, { required Logger logger }) { return _createFromYaml(loadYaml(manifest), logger); } static FlutterManifest? _createFromYaml(Object? yamlDocument, Logger logger) { if (yamlDocument != null && !_validate(yamlDocument, logger)) { return null; } final FlutterManifest pubspec = FlutterManifest._(logger: logger); final Map<Object?, Object?>? yamlMap = yamlDocument as YamlMap?; if (yamlMap != null) { pubspec._descriptor = yamlMap.cast<String, Object?>(); } final Map<Object?, Object?>? flutterMap = pubspec._descriptor['flutter'] as Map<Object?, Object?>?; if (flutterMap != null) { pubspec._flutterDescriptor = flutterMap.cast<String, Object?>(); } return pubspec; } final Logger _logger; /// A map representation of the entire `pubspec.yaml` file. Map<String, Object?> _descriptor = <String, Object?>{}; /// A map representation of the `flutter` section in the `pubspec.yaml` file. Map<String, Object?> _flutterDescriptor = <String, Object?>{}; Map<String, Object?> get flutterDescriptor => _flutterDescriptor; /// True if the `pubspec.yaml` file does not exist. bool get isEmpty => _descriptor.isEmpty; /// The string value of the top-level `name` property in the `pubspec.yaml` file. String get appName => _descriptor['name'] as String? ?? ''; /// Contains the name of the dependencies. /// These are the keys specified in the `dependency` map. Set<String> get dependencies { final YamlMap? dependencies = _descriptor['dependencies'] as YamlMap?; return dependencies != null ? <String>{...dependencies.keys.cast<String>()} : <String>{}; } // Flag to avoid printing multiple invalid version messages. bool _hasShowInvalidVersionMsg = false; /// The version String from the `pubspec.yaml` file. /// Can be null if it isn't set or has a wrong format. String? get appVersion { final String? verStr = _descriptor['version']?.toString(); if (verStr == null) { return null; } Version? version; try { version = Version.parse(verStr); } on Exception { if (!_hasShowInvalidVersionMsg) { _logger.printStatus(globals.userMessages.invalidVersionSettingHintMessage(verStr), emphasis: true); _hasShowInvalidVersionMsg = true; } } return version?.toString(); } /// The build version name from the `pubspec.yaml` file. /// Can be null if version isn't set or has a wrong format. String? get buildName { final String? version = appVersion; if (version != null && version.contains('+')) { return version.split('+').elementAt(0); } return version; } /// The build version number from the `pubspec.yaml` file. /// Can be null if version isn't set or has a wrong format. String? get buildNumber { final String? version = appVersion; if (version != null && version.contains('+')) { final String value = version.split('+').elementAt(1); return value; } else { return null; } } bool get usesMaterialDesign { return _flutterDescriptor['uses-material-design'] as bool? ?? false; } /// True if this Flutter module should use AndroidX dependencies. /// /// If false the deprecated Android Support library will be used. bool get usesAndroidX { final Object? module = _flutterDescriptor['module']; if (module is YamlMap) { return module['androidX'] == true; } return false; } /// Any additional license files listed under the `flutter` key. /// /// This is expected to be a list of file paths that should be treated as /// relative to the pubspec in this directory. /// /// For example: /// /// ```yaml /// flutter: /// licenses: /// - assets/foo_license.txt /// ``` List<String> get additionalLicenses { final Object? licenses = _flutterDescriptor['licenses']; if (licenses is YamlList) { return licenses.map((Object? element) => element.toString()).toList(); } return <String>[]; } /// True if this manifest declares a Flutter module project. /// /// A Flutter project is considered a module when it has a `module:` /// descriptor. A Flutter module project supports integration into an /// existing host app, and has managed platform host code. /// /// Such a project can be created using `flutter create -t module`. bool get isModule => _flutterDescriptor.containsKey('module'); /// True if this manifest declares a Flutter plugin project. /// /// A Flutter project is considered a plugin when it has a `plugin:` /// descriptor. A Flutter plugin project wraps custom Android and/or /// iOS code in a Dart interface for consumption by other Flutter app /// projects. /// /// Such a project can be created using `flutter create -t plugin`. bool get isPlugin => _flutterDescriptor.containsKey('plugin'); /// Returns the Android package declared by this manifest in its /// module or plugin descriptor. Returns null, if there is no /// such declaration. String? get androidPackage { if (isModule) { final Object? module = _flutterDescriptor['module']; if (module is YamlMap) { return module['androidPackage'] as String?; } } final Map<String, Object?>? platforms = supportedPlatforms; if (platforms == null) { // Pre-multi-platform plugin format if (isPlugin) { final YamlMap? plugin = _flutterDescriptor['plugin'] as YamlMap?; return plugin?['androidPackage'] as String?; } return null; } if (platforms.containsKey('android')) { final Object? android = platforms['android']; if (android is YamlMap) { return android['package'] as String?; } } return null; } /// Returns the deferred components configuration if declared. Returns /// null if no deferred components are declared. late final List<DeferredComponent>? deferredComponents = computeDeferredComponents(); List<DeferredComponent>? computeDeferredComponents() { if (!_flutterDescriptor.containsKey('deferred-components')) { return null; } final List<DeferredComponent> components = <DeferredComponent>[]; final Object? deferredComponents = _flutterDescriptor['deferred-components']; if (deferredComponents is! YamlList) { return components; } for (final Object? component in deferredComponents) { if (component is! YamlMap) { _logger.printError('Expected deferred component manifest to be a map.'); continue; } components.add( DeferredComponent( name: component['name'] as String, libraries: component['libraries'] == null ? <String>[] : (component['libraries'] as List<dynamic>).cast<String>(), assets: _computeAssets(component['assets']), ) ); } return components; } /// Returns the iOS bundle identifier declared by this manifest in its /// module descriptor. Returns null if there is no such declaration. String? get iosBundleIdentifier { if (isModule) { final Object? module = _flutterDescriptor['module']; if (module is YamlMap) { return module['iosBundleIdentifier'] as String?; } } return null; } /// Gets the supported platforms. This only supports the new `platforms` format. /// /// If the plugin uses the legacy pubspec format, this method returns null. Map<String, Object?>? get supportedPlatforms { if (isPlugin) { final YamlMap? plugin = _flutterDescriptor['plugin'] as YamlMap?; if (plugin?.containsKey('platforms') ?? false) { final YamlMap? platformsMap = plugin!['platforms'] as YamlMap?; return platformsMap?.value.cast<String, Object?>(); } } return null; } /// Like [supportedPlatforms], but only returns the valid platforms that are supported in flutter plugins. Map<String, Object?>? get validSupportedPlatforms { final Map<String, Object?>? allPlatforms = supportedPlatforms; if (allPlatforms == null) { return null; } final Map<String, Object?> platforms = <String, Object?>{}..addAll(allPlatforms); platforms.removeWhere((String key, Object? _) => !_kValidPluginPlatforms.contains(key)); if (platforms.isEmpty) { return null; } return platforms; } List<Map<String, Object?>> get fontsDescriptor { return fonts.map((Font font) => font.descriptor).toList(); } List<Map<String, Object?>> get _rawFontsDescriptor { final List<Object?>? fontList = _flutterDescriptor['fonts'] as List<Object?>?; return fontList == null ? const <Map<String, Object?>>[] : fontList.map<Map<String, Object?>?>(castStringKeyedMap).whereType<Map<String, Object?>>().toList(); } late final List<AssetsEntry> assets = _computeAssets(_flutterDescriptor['assets']); late final List<Font> fonts = _extractFonts(); List<Font> _extractFonts() { if (!_flutterDescriptor.containsKey('fonts')) { return <Font>[]; } final List<Font> fonts = <Font>[]; for (final Map<String, Object?> fontFamily in _rawFontsDescriptor) { final YamlList? fontFiles = fontFamily['fonts'] as YamlList?; final String? familyName = fontFamily['family'] as String?; if (familyName == null) { _logger.printWarning('Warning: Missing family name for font.', emphasis: true); continue; } if (fontFiles == null) { _logger.printWarning('Warning: No fonts specified for font $familyName', emphasis: true); continue; } final List<FontAsset> fontAssets = <FontAsset>[]; for (final Map<Object?, Object?> fontFile in fontFiles.cast<Map<Object?, Object?>>()) { final String? asset = fontFile['asset'] as String?; if (asset == null) { _logger.printWarning('Warning: Missing asset in fonts for $familyName', emphasis: true); continue; } fontAssets.add(FontAsset( Uri.parse(asset), weight: fontFile['weight'] as int?, style: fontFile['style'] as String?, )); } if (fontAssets.isNotEmpty) { fonts.add(Font(familyName, fontAssets)); } } return fonts; } late final List<Uri> shaders = _extractAssetUris('shaders', 'Shader'); late final List<Uri> models = kIs3dSceneSupported ? _extractAssetUris('models', 'Model') : <Uri>[]; List<Uri> _extractAssetUris(String key, String singularName) { if (!_flutterDescriptor.containsKey(key)) { return <Uri>[]; } final List<Object?>? items = _flutterDescriptor[key] as List<Object?>?; if (items == null) { return const <Uri>[]; } final List<Uri> results = <Uri>[]; for (final Object? item in items) { if (item is! String || item == '') { _logger.printError('$singularName manifest contains a null or empty uri.'); continue; } try { results.add(Uri(pathSegments: item.split('/'))); } on FormatException { _logger.printError('$singularName manifest contains invalid uri: $item.'); } } return results; } /// Whether a synthetic flutter_gen package should be generated. /// /// This can be provided to the [Pub] interface to inject a new entry /// into the package_config.json file which points to `.dart_tool/flutter_gen`. /// /// This allows generated source code to be imported using a package /// alias. late final bool generateSyntheticPackage = _computeGenerateSyntheticPackage(); bool _computeGenerateSyntheticPackage() { if (!_flutterDescriptor.containsKey('generate')) { return false; } final Object? value = _flutterDescriptor['generate']; if (value is! bool) { return false; } return value; } } class Font { Font(this.familyName, this.fontAssets) : assert(fontAssets.isNotEmpty); final String familyName; final List<FontAsset> fontAssets; Map<String, Object?> get descriptor { return <String, Object?>{ 'family': familyName, 'fonts': fontAssets.map<Map<String, Object?>>((FontAsset a) => a.descriptor).toList(), }; } @override String toString() => '$runtimeType(family: $familyName, assets: $fontAssets)'; } class FontAsset { FontAsset(this.assetUri, {this.weight, this.style}); final Uri assetUri; final int? weight; final String? style; Map<String, Object?> get descriptor { final Map<String, Object?> descriptor = <String, Object?>{}; if (weight != null) { descriptor['weight'] = weight; } if (style != null) { descriptor['style'] = style; } descriptor['asset'] = assetUri.path; return descriptor; } @override String toString() => '$runtimeType(asset: ${assetUri.path}, weight; $weight, style: $style)'; } bool _validate(Object? manifest, Logger logger) { final List<String> errors = <String>[]; if (manifest is! YamlMap) { errors.add('Expected YAML map'); } else { for (final MapEntry<Object?, Object?> kvp in manifest.entries) { if (kvp.key is! String) { errors.add('Expected YAML key to be a string, but got ${kvp.key}.'); continue; } switch (kvp.key as String?) { case 'name': if (kvp.value is! String) { errors.add('Expected "${kvp.key}" to be a string, but got ${kvp.value}.'); } case 'flutter': if (kvp.value == null) { continue; } if (kvp.value is! YamlMap) { errors.add('Expected "${kvp.key}" section to be an object or null, but got ${kvp.value}.'); } else { _validateFlutter(kvp.value as YamlMap?, errors); } default: // additionalProperties are allowed. break; } } } if (errors.isNotEmpty) { logger.printStatus('Error detected in pubspec.yaml:', emphasis: true); logger.printError(errors.join('\n')); return false; } return true; } void _validateFlutter(YamlMap? yaml, List<String> errors) { if (yaml == null) { return; } for (final MapEntry<Object?, Object?> kvp in yaml.entries) { final Object? yamlKey = kvp.key; final Object? yamlValue = kvp.value; if (yamlKey is! String) { errors.add('Expected YAML key to be a string, but got $yamlKey (${yamlValue.runtimeType}).'); continue; } switch (yamlKey) { case 'uses-material-design': if (yamlValue is! bool) { errors.add('Expected "$yamlKey" to be a bool, but got $yamlValue (${yamlValue.runtimeType}).'); } case 'assets': errors.addAll(_validateAssets(yamlValue)); case 'shaders': if (yamlValue is! YamlList) { errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).'); } else if (yamlValue.isEmpty) { break; } else if (yamlValue[0] is! String) { errors.add( 'Expected "$yamlKey" to be a list of strings, but the first element is $yamlValue (${yamlValue.runtimeType}).', ); } case 'models': if (yamlValue is! YamlList) { errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).'); } else if (yamlValue.isEmpty) { break; } else if (yamlValue[0] is! String) { errors.add( 'Expected "$yamlKey" to be a list of strings, but the first element is $yamlValue (${yamlValue.runtimeType}).', ); } case 'fonts': if (yamlValue is! YamlList) { errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).'); } else if (yamlValue.isEmpty) { break; } else if (yamlValue.first is! YamlMap) { errors.add( 'Expected "$yamlKey" to contain maps, but the first element is $yamlValue (${yamlValue.runtimeType}).', ); } else { _validateFonts(yamlValue, errors); } case 'licenses': final (_, List<String> filesErrors) = _parseList<String>(yamlValue, '"$yamlKey"', 'files'); errors.addAll(filesErrors); case 'module': if (yamlValue is! YamlMap) { errors.add('Expected "$yamlKey" to be an object, but got $yamlValue (${yamlValue.runtimeType}).'); break; } if (yamlValue['androidX'] != null && yamlValue['androidX'] is! bool) { errors.add('The "androidX" value must be a bool if set.'); } if (yamlValue['androidPackage'] != null && yamlValue['androidPackage'] is! String) { errors.add('The "androidPackage" value must be a string if set.'); } if (yamlValue['iosBundleIdentifier'] != null && yamlValue['iosBundleIdentifier'] is! String) { errors.add('The "iosBundleIdentifier" section must be a string if set.'); } case 'plugin': if (yamlValue is! YamlMap) { errors.add('Expected "$yamlKey" to be an object, but got $yamlValue (${yamlValue.runtimeType}).'); break; } final List<String> pluginErrors = Plugin.validatePluginYaml(yamlValue); errors.addAll(pluginErrors); case 'generate': break; case 'deferred-components': _validateDeferredComponents(kvp, errors); default: errors.add('Unexpected child "$yamlKey" found under "flutter".'); break; } } } (List<T>? result, List<String> errors) _parseList<T>(Object? yamlList, String context, String typeAlias) { final List<String> errors = <String>[]; if (yamlList is! YamlList) { final String message = 'Expected $context to be a list of $typeAlias, but got $yamlList (${yamlList.runtimeType}).'; return (null, <String>[message]); } for (int i = 0; i < yamlList.length; i++) { if (yamlList[i] is! T) { // ignore: avoid_dynamic_calls errors.add('Expected $context to be a list of $typeAlias, but element at index $i was a ${yamlList[i].runtimeType}.'); } } return errors.isEmpty ? (List<T>.from(yamlList), errors) : (null, errors); } void _validateDeferredComponents(MapEntry<Object?, Object?> kvp, List<String> errors) { final Object? yamlList = kvp.value; if (yamlList != null && (yamlList is! YamlList || yamlList[0] is! YamlMap)) { errors.add('Expected "${kvp.key}" to be a list, but got $yamlList (${yamlList.runtimeType}).'); } else if (yamlList is YamlList) { for (int i = 0; i < yamlList.length; i++) { final Object? valueMap = yamlList[i]; if (valueMap is! YamlMap) { // ignore: avoid_dynamic_calls errors.add('Expected the $i element in "${kvp.key}" to be a map, but got ${yamlList[i]} (${yamlList[i].runtimeType}).'); continue; } if (!valueMap.containsKey('name') || valueMap['name'] is! String) { errors.add('Expected the $i element in "${kvp.key}" to have required key "name" of type String'); } if (valueMap.containsKey('libraries')) { final (_, List<String> librariesErrors) = _parseList<String>( valueMap['libraries'], '"libraries" key in the element at index $i of "${kvp.key}"', 'String', ); errors.addAll(librariesErrors); } if (valueMap.containsKey('assets')) { errors.addAll(_validateAssets(valueMap['assets'])); } } } } List<String> _validateAssets(Object? yaml) { final (_, List<String> errors) = _computeAssetsSafe(yaml); return errors; } // TODO(andrewkolos): We end up parsing the assets section twice, once during // validation and once when the assets getter is called. We should consider // refactoring this class to parse and store everything in the constructor. // https://github.com/flutter/flutter/issues/139183 (List<AssetsEntry>, List<String> errors) _computeAssetsSafe(Object? yaml) { if (yaml == null) { return (const <AssetsEntry>[], const <String>[]); } if (yaml is! YamlList) { final String error = 'Expected "assets" to be a list, but got $yaml (${yaml.runtimeType}).'; return (const <AssetsEntry>[], <String>[error]); } final List<AssetsEntry> results = <AssetsEntry>[]; final List<String> errors = <String>[]; for (final Object? rawAssetEntry in yaml) { final (AssetsEntry? parsed, String? error) = AssetsEntry.parseFromYamlSafe(rawAssetEntry); if (parsed != null) { results.add(parsed); } if (error != null) { errors.add(error); } } return (results, errors); } List<AssetsEntry> _computeAssets(Object? assetsSection) { final (List<AssetsEntry> result, List<String> errors) = _computeAssetsSafe(assetsSection); if (errors.isNotEmpty) { throw Exception('Uncaught error(s) in assets section: ' '${errors.join('\n')}'); } return result; } void _validateFonts(YamlList fonts, List<String> errors) { const Set<int> fontWeights = <int>{ 100, 200, 300, 400, 500, 600, 700, 800, 900, }; for (final Object? fontMap in fonts) { if (fontMap is! YamlMap) { errors.add('Unexpected child "$fontMap" found under "fonts". Expected a map.'); continue; } for (final Object? key in fontMap.keys.where((Object? key) => key != 'family' && key != 'fonts')) { errors.add('Unexpected child "$key" found under "fonts".'); } if (fontMap['family'] != null && fontMap['family'] is! String) { errors.add('Font family must either be null or a String.'); } if (fontMap['fonts'] == null) { continue; } else if (fontMap['fonts'] is! YamlList) { errors.add('Expected "fonts" to either be null or a list.'); continue; } for (final Object? fontMapList in fontMap['fonts'] as List<Object?>) { if (fontMapList is! YamlMap) { errors.add('Expected "fonts" to be a list of maps.'); continue; } for (final MapEntry<Object?, Object?> kvp in fontMapList.entries) { final Object? fontKey = kvp.key; if (fontKey is! String) { errors.add('Expected "$fontKey" under "fonts" to be a string.'); } switch (fontKey) { case 'asset': if (kvp.value is! String) { errors.add('Expected font asset ${kvp.value} ((${kvp.value.runtimeType})) to be a string.'); } case 'weight': if (!fontWeights.contains(kvp.value)) { errors.add('Invalid value ${kvp.value} ((${kvp.value.runtimeType})) for font -> weight.'); } case 'style': if (kvp.value != 'normal' && kvp.value != 'italic') { errors.add('Invalid value ${kvp.value} ((${kvp.value.runtimeType})) for font -> style.'); } default: errors.add('Unexpected key $fontKey ((${kvp.value.runtimeType})) under font.'); break; } } } } } /// Represents an entry under the `assets` section of a pubspec. @immutable class AssetsEntry { const AssetsEntry({ required this.uri, this.flavors = const <String>{}, this.transformers = const <AssetTransformerEntry>[], }); final Uri uri; final Set<String> flavors; final List<AssetTransformerEntry> transformers; static const String _pathKey = 'path'; static const String _flavorKey = 'flavors'; static const String _transformersKey = 'transformers'; static AssetsEntry? parseFromYaml(Object? yaml) { final (AssetsEntry? value, String? error) = parseFromYamlSafe(yaml); if (error != null) { throw Exception('Unexpected error when parsing assets entry'); } return value!; } static (AssetsEntry? assetsEntry, String? error) parseFromYamlSafe(Object? yaml) { (Uri?, String?) tryParseUri(String uri) { try { return (Uri(pathSegments: uri.split('/')), null); } on FormatException { return (null, 'Asset manifest contains invalid uri: $uri.'); } } if (yaml == null || yaml == '') { return (null, 'Asset manifest contains a null or empty uri.'); } if (yaml is String) { final (Uri? uri, String? error) = tryParseUri(yaml); return uri == null ? (null, error) : (AssetsEntry(uri: uri), null); } if (yaml is Map) { if (yaml.keys.isEmpty) { return (null, null); } final Object? path = yaml[_pathKey]; if (path == null || path is! String) { return (null, 'Asset manifest entry is malformed. ' 'Expected asset entry to be either a string or a map ' 'containing a "$_pathKey" entry. Got ${path.runtimeType} instead.'); } final (List<String>? flavors, List<String> flavorsErrors) = _parseFlavorsSection(yaml[_flavorKey]); final (List<AssetTransformerEntry>? transformers, List<String> transformersErrors) = _parseTransformersSection(yaml[_transformersKey]); final List<String> errors = <String>[ ...flavorsErrors.map((String e) => 'In $_flavorKey section of asset "$path": $e'), ...transformersErrors.map((String e) => 'In $_transformersKey section of asset "$path": $e'), ]; if (errors.isNotEmpty) { return ( null, <String>[ 'Unable to parse assets section.', ...errors ].join('\n'), ); } return ( AssetsEntry( uri: Uri(pathSegments: path.split('/')), flavors: Set<String>.from(flavors ?? <String>[]), transformers: transformers ?? <AssetTransformerEntry>[], ), null, ); } return (null, 'Assets entry had unexpected shape. ' 'Expected a string or an object. Got ${yaml.runtimeType} instead.'); } static (List<String>? flavors, List<String> errors) _parseFlavorsSection(Object? yaml) { if (yaml == null) { return (null, <String>[]); } return _parseList<String>(yaml, _flavorKey, 'String'); } static (List<AssetTransformerEntry>?, List<String> errors) _parseTransformersSection(Object? yaml) { if (yaml == null) { return (null, <String>[]); } final (List<YamlMap>? yamlObjects, List<String> listErrors) = _parseList<YamlMap>( yaml, '$_transformersKey list', 'Map', ); if (listErrors.isNotEmpty) { return (null, listErrors); } final List<AssetTransformerEntry> transformers = <AssetTransformerEntry>[]; final List<String> errors = <String>[]; for (final YamlMap yaml in yamlObjects!) { final (AssetTransformerEntry? transformerEntry, List<String> transformerErrors) = AssetTransformerEntry.tryParse(yaml); if (transformerEntry != null) { transformers.add(transformerEntry); } else { errors.addAll(transformerErrors); } } if (errors.isEmpty) { return (transformers, errors); } return (null, errors); } @override bool operator ==(Object other) { if (other is! AssetsEntry) { return false; } return uri == other.uri && setEquals(flavors, other.flavors); } @override int get hashCode => Object.hashAll(<Object?>[ uri.hashCode, Object.hashAllUnordered(flavors), Object.hashAll(transformers), ]); @override String toString() => 'AssetsEntry(uri: $uri, flavors: $flavors, transformers: $transformers)'; } /// Represents an entry in the "transformers" section of an asset. @immutable final class AssetTransformerEntry { const AssetTransformerEntry({ required this.package, required List<String>? args, }): args = args ?? const <String>[]; final String package; final List<String>? args; static (AssetTransformerEntry? entry, List<String> errors) tryParse(Object? yaml) { if (yaml == null) { return (null, <String>['Transformer entry is null.']); } if (yaml is! YamlMap) { return (null, <String>['Expected entry to be a map. Found ${yaml.runtimeType} instead']); } final Object? package = yaml['package']; if (package is! String || package.isEmpty) { return (null, <String>['Expected "package" to be a String. Found ${package.runtimeType} instead.']); } final (List<String>? args, List<String> argsErrors) = _parseArgsSection(yaml['args']); if (argsErrors.isNotEmpty) { return (null, argsErrors.map((String e) => 'In args section of transformer using package "$package": $e').toList()); } return ( AssetTransformerEntry( package: package, args: args, ), <String>[], ); } static (List<String>? args, List<String> errors) _parseArgsSection(Object? yaml) { if (yaml == null) { return (null, <String>[]); } return _parseList(yaml, 'args', 'String'); } @override bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other is! AssetTransformerEntry) { return false; } final bool argsAreEqual = (() { if (args == null && other.args == null) { return true; } if (args?.length != other.args?.length) { return false; } for (int index = 0; index < args!.length; index += 1) { if (args![index] != other.args![index]) { return false; } } return true; })(); return package == other.package && argsAreEqual; } @override int get hashCode => Object.hashAll( <Object?>[ package.hashCode, args?.map((String e) => e.hashCode), ], ); @override String toString() { return 'AssetTransformerEntry(package: $package, args: $args)'; } }
flutter/packages/flutter_tools/lib/src/flutter_manifest.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/flutter_manifest.dart", "repo_id": "flutter", "token_count": 12024 }
826
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:process/process.dart'; import '../base/common.dart'; import '../base/config.dart'; import '../base/io.dart'; import '../base/logger.dart'; import '../base/platform.dart'; import '../base/process.dart'; import '../base/terminal.dart'; import '../convert.dart' show utf8; const String _developmentTeamBuildSettingName = 'DEVELOPMENT_TEAM'; /// User message when no development certificates are found in the keychain. /// /// The user likely never did any iOS development. const String noCertificatesInstruction = ''' ════════════════════════════════════════════════════════════════════════════════ No valid code signing certificates were found You can connect to your Apple Developer account by signing in with your Apple ID in Xcode and create an iOS Development Certificate as well as a Provisioning\u0020 Profile for your project by: $fixWithDevelopmentTeamInstruction 5- Trust your newly created Development Certificate on your iOS device via Settings > General > Device Management > [your new certificate] > Trust For more information, please visit: https://developer.apple.com/library/content/documentation/IDEs/Conceptual/ AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html Or run on an iOS simulator without code signing ════════════════════════════════════════════════════════════════════════════════'''; /// User message when there are no provisioning profile for the current app bundle identifier. /// /// The user did iOS development but never on this project and/or device. const String noProvisioningProfileInstruction = ''' ════════════════════════════════════════════════════════════════════════════════ No Provisioning Profile was found for your project's Bundle Identifier or your\u0020 device. You can create a new Provisioning Profile for your project in Xcode for\u0020 your team by: $fixWithDevelopmentTeamInstruction It's also possible that a previously installed app with the same Bundle\u0020 Identifier was signed with a different certificate. For more information, please visit: https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices Or run on an iOS simulator without code signing ════════════════════════════════════════════════════════════════════════════════'''; /// Fallback error message for signing issues. /// /// Couldn't auto sign the app but can likely solved by retracing the signing flow in Xcode. const String noDevelopmentTeamInstruction = ''' ════════════════════════════════════════════════════════════════════════════════ Building a deployable iOS app requires a selected Development Team with a\u0020 Provisioning Profile. Please ensure that a Development Team is selected by: $fixWithDevelopmentTeamInstruction For more information, please visit: https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices Or run on an iOS simulator without code signing ════════════════════════════════════════════════════════════════════════════════'''; const String fixWithDevelopmentTeamInstruction = ''' 1- Open the Flutter project's Xcode target with open ios/Runner.xcworkspace 2- Select the 'Runner' project in the navigator then the 'Runner' target in the project settings 3- Make sure a 'Development Team' is selected under Signing & Capabilities > Team.\u0020 You may need to: - Log in with your Apple ID in Xcode first - Ensure you have a valid unique Bundle ID - Register your device with your Apple Developer Account - Let Xcode automatically provision a profile for your app 4- Build or run your project again'''; final RegExp _securityFindIdentityDeveloperIdentityExtractionPattern = RegExp(r'^\s*\d+\).+"(.+Develop(ment|er).+)"$'); final RegExp _securityFindIdentityCertificateCnExtractionPattern = RegExp(r'.*\(([a-zA-Z0-9]+)\)'); final RegExp _certificateOrganizationalUnitExtractionPattern = RegExp(r'OU=([a-zA-Z0-9]+)'); /// Given a [BuildableIOSApp], this will try to find valid development code /// signing identities in the user's keychain prompting a choice if multiple /// are found. /// /// Returns a set of build configuration settings that uses the selected /// signing identities. /// /// Will return null if none are found, if the user cancels or if the Xcode /// project has a development team set in the project's build settings. Future<Map<String, String>?> getCodeSigningIdentityDevelopmentTeamBuildSetting({ required Map<String, String> buildSettings, required ProcessManager processManager, required Platform platform, required Logger logger, required Config config, required Terminal terminal, }) async { // If the user already has it set in the project build settings itself, // continue with that. if (_isNotEmpty(buildSettings[_developmentTeamBuildSettingName])) { logger.printStatus( 'Automatically signing iOS for device deployment using specified development ' 'team in Xcode project: ${buildSettings[_developmentTeamBuildSettingName]}' ); return null; } if (_isNotEmpty(buildSettings['PROVISIONING_PROFILE'])) { return null; } final String? developmentTeam = await _getCodeSigningIdentityDevelopmentTeam( processManager: processManager, platform: platform, logger: logger, config: config, terminal: terminal, shouldExitOnNoCerts: true, ); if (developmentTeam == null) { return null; } return <String, String>{ _developmentTeamBuildSettingName: developmentTeam, }; } Future<String?> getCodeSigningIdentityDevelopmentTeam({ required ProcessManager processManager, required Platform platform, required Logger logger, required Config config, required Terminal terminal, }) async => _getCodeSigningIdentityDevelopmentTeam( processManager: processManager, platform: platform, logger: logger, config: config, terminal: terminal, ); /// Set [shouldExitOnNoCerts] to show instructions for how to add a cert when none are found, then [toolExit]. Future<String?> _getCodeSigningIdentityDevelopmentTeam({ required ProcessManager processManager, required Platform platform, required Logger logger, required Config config, required Terminal terminal, bool shouldExitOnNoCerts = false, }) async { if (!platform.isMacOS) { return null; } // If the user's environment is missing the tools needed to find and read // certificates, abandon. Tools should be pre-equipped on macOS. final ProcessUtils processUtils = ProcessUtils(processManager: processManager, logger: logger); if (!await processUtils.exitsHappy(const <String>['which', 'security']) || !await processUtils.exitsHappy(const <String>['which', 'openssl'])) { return null; } const List<String> findIdentityCommand = <String>['security', 'find-identity', '-p', 'codesigning', '-v']; String findIdentityStdout; try { findIdentityStdout = (await processUtils.run( findIdentityCommand, throwOnError: true, )).stdout.trim(); } on ProcessException catch (error) { logger.printTrace('Unexpected failure from find-identity: $error.'); return null; } final List<String> validCodeSigningIdentities = findIdentityStdout .split('\n') .map<String?>((String outputLine) { return _securityFindIdentityDeveloperIdentityExtractionPattern .firstMatch(outputLine) ?.group(1); }) .where(_isNotEmpty) .whereType<String>() .toSet() // Unique. .toList(); final String? signingIdentity = await _chooseSigningIdentity(validCodeSigningIdentities, logger, config, terminal, shouldExitOnNoCerts); // If none are chosen, return null. if (signingIdentity == null) { return null; } logger.printStatus('Developer identity "$signingIdentity" selected for iOS code signing'); final String? signingCertificateId = _securityFindIdentityCertificateCnExtractionPattern .firstMatch(signingIdentity) ?.group(1); // If `security`'s output format changes, we'd have to update the above regex. if (signingCertificateId == null) { return null; } String signingCertificateStdout; try { signingCertificateStdout = (await processUtils.run( <String>['security', 'find-certificate', '-c', signingCertificateId, '-p'], throwOnError: true, )).stdout.trim(); } on ProcessException catch (error) { logger.printTrace("Couldn't find the certificate: $error."); return null; } final Process opensslProcess = await processUtils.start( const <String>['openssl', 'x509', '-subject']); await (opensslProcess.stdin..write(signingCertificateStdout)).close(); final String opensslOutput = await utf8.decodeStream(opensslProcess.stdout); // Fire and forget discard of the stderr stream so we don't hold onto resources. // Don't care about the result. unawaited(opensslProcess.stderr.drain<String?>()); if (await opensslProcess.exitCode != 0) { return null; } return _certificateOrganizationalUnitExtractionPattern.firstMatch(opensslOutput)?.group(1); } /// Set [shouldExitOnNoCerts] to show instructions for how to add a cert when none are found, then [toolExit]. Future<String?> _chooseSigningIdentity( List<String> validCodeSigningIdentities, Logger logger, Config config, Terminal terminal, bool shouldExitOnNoCerts, ) async { // The user has no valid code signing identities. if (validCodeSigningIdentities.isEmpty) { if (shouldExitOnNoCerts) { logger.printError(noCertificatesInstruction, emphasis: true); throwToolExit('No development certificates available to code sign app for device deployment'); } else { return null; } } if (validCodeSigningIdentities.length == 1) { return validCodeSigningIdentities.first; } if (validCodeSigningIdentities.length > 1) { final String? savedCertChoice = config.getValue('ios-signing-cert') as String?; if (savedCertChoice != null) { if (validCodeSigningIdentities.contains(savedCertChoice)) { logger.printStatus('Found saved certificate choice "$savedCertChoice". To clear, use "flutter config".'); return savedCertChoice; } else { logger.printError('Saved signing certificate "$savedCertChoice" is not a valid development certificate'); } } // If terminal UI can't be used, just attempt with the first valid certificate // since we can't ask the user. if (!terminal.usesTerminalUi) { return validCodeSigningIdentities.first; } final int count = validCodeSigningIdentities.length; logger.printStatus( 'Multiple valid development certificates available (your choice will be saved):', emphasis: true, ); for (int i=0; i<count; i++) { logger.printStatus(' ${i+1}) ${validCodeSigningIdentities[i]}', emphasis: true); } logger.printStatus(' a) Abort', emphasis: true); final String choice = await terminal.promptForCharInput( List<String>.generate(count, (int number) => '${number + 1}') ..add('a'), prompt: 'Please select a certificate for code signing', defaultChoiceIndex: 0, // Just pressing enter chooses the first one. logger: logger, ); if (choice == 'a') { throwToolExit('Aborted. Code signing is required to build a deployable iOS app.'); } else { final String selectedCert = validCodeSigningIdentities[int.parse(choice) - 1]; logger.printStatus('Certificate choice "$selectedCert" saved'); config.setValue('ios-signing-cert', selectedCert); return selectedCert; } } return null; } /// Returns true if s is a not empty string. bool _isNotEmpty(String? s) => s != null && s.isNotEmpty;
flutter/packages/flutter_tools/lib/src/ios/code_signing.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/ios/code_signing.dart", "repo_id": "flutter", "token_count": 3806 }
827
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:math' as math; import 'package:meta/meta.dart'; import 'package:process/process.dart'; import '../application_package.dart'; import '../base/common.dart'; import '../base/file_system.dart'; import '../base/io.dart'; import '../base/logger.dart'; import '../base/process.dart'; import '../base/utils.dart'; import '../base/version.dart'; import '../build_info.dart'; import '../convert.dart'; import '../devfs.dart'; import '../device.dart'; import '../device_port_forwarder.dart'; import '../globals.dart' as globals; import '../macos/xcode.dart'; import '../project.dart'; import '../protocol_discovery.dart'; import 'application_package.dart'; import 'mac.dart'; import 'plist_parser.dart'; const String iosSimulatorId = 'apple_ios_simulator'; class IOSSimulators extends PollingDeviceDiscovery { IOSSimulators({ required IOSSimulatorUtils iosSimulatorUtils, }) : _iosSimulatorUtils = iosSimulatorUtils, super('iOS simulators'); final IOSSimulatorUtils _iosSimulatorUtils; @override bool get supportsPlatform => globals.platform.isMacOS; @override bool get canListAnything => globals.iosWorkflow?.canListDevices ?? false; @override Future<List<Device>> pollingGetDevices({ Duration? timeout }) async => _iosSimulatorUtils.getAttachedDevices(); @override List<String> get wellKnownIds => const <String>[]; } class IOSSimulatorUtils { IOSSimulatorUtils({ required Xcode xcode, required Logger logger, required ProcessManager processManager, }) : _simControl = SimControl( logger: logger, processManager: processManager, xcode: xcode, ), _xcode = xcode; final SimControl _simControl; final Xcode _xcode; Future<List<IOSSimulator>> getAttachedDevices() async { if (!_xcode.isInstalledAndMeetsVersionCheck) { return <IOSSimulator>[]; } final List<BootedSimDevice> connected = await _simControl.getConnectedDevices(); return connected.map<IOSSimulator?>((BootedSimDevice device) { final String? udid = device.udid; final String? name = device.name; if (udid == null) { globals.printTrace('Could not parse simulator udid'); return null; } if (name == null) { globals.printTrace('Could not parse simulator name'); return null; } return IOSSimulator( udid, name: name, simControl: _simControl, simulatorCategory: device.category, ); }).whereType<IOSSimulator>().toList(); } Future<List<IOSSimulatorRuntime>> getAvailableIOSRuntimes() async { if (!_xcode.isInstalledAndMeetsVersionCheck) { return <IOSSimulatorRuntime>[]; } return _simControl.listAvailableIOSRuntimes(); } } /// A wrapper around the `simctl` command line tool. class SimControl { SimControl({ required Logger logger, required ProcessManager processManager, required Xcode xcode, }) : _logger = logger, _xcode = xcode, _processUtils = ProcessUtils(processManager: processManager, logger: logger); final Logger _logger; final ProcessUtils _processUtils; final Xcode _xcode; /// Runs `simctl list --json` and returns the JSON of the corresponding /// [section]. Future<Map<String, Object?>> _listBootedDevices() async { // Sample output from `simctl list available booted --json`: // // { // "devices" : { // "com.apple.CoreSimulator.SimRuntime.iOS-14-0" : [ // { // "lastBootedAt" : "2022-07-26T01:46:23Z", // "dataPath" : "\/Users\/magder\/Library\/Developer\/CoreSimulator\/Devices\/9EC90A99-6924-472D-8CDD-4D8234AB4779\/data", // "dataPathSize" : 1620578304, // "logPath" : "\/Users\/magder\/Library\/Logs\/CoreSimulator\/9EC90A99-6924-472D-8CDD-4D8234AB4779", // "udid" : "9EC90A99-6924-472D-8CDD-4D8234AB4779", // "isAvailable" : true, // "logPathSize" : 9740288, // "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-11", // "state" : "Booted", // "name" : "iPhone 11" // } // ], // "com.apple.CoreSimulator.SimRuntime.iOS-13-0" : [ // // ], // "com.apple.CoreSimulator.SimRuntime.iOS-12-4" : [ // // ], // "com.apple.CoreSimulator.SimRuntime.iOS-16-0" : [ // // ] // } // } final List<String> command = <String>[ ..._xcode.xcrunCommand(), 'simctl', 'list', 'devices', 'booted', 'iOS', '--json', ]; _logger.printTrace(command.join(' ')); final RunResult results = await _processUtils.run(command); if (results.exitCode != 0) { _logger.printError('Error executing simctl: ${results.exitCode}\n${results.stderr}'); return <String, Map<String, Object?>>{}; } try { final Object? decodeResult = (json.decode(results.stdout) as Map<String, Object?>)['devices']; if (decodeResult is Map<String, Object?>) { return decodeResult; } _logger.printError('simctl returned unexpected JSON response: ${results.stdout}'); return <String, Object>{}; } on FormatException { // We failed to parse the simctl output, or it returned junk. // One known message is "Install Started" isn't valid JSON but is // returned sometimes. _logger.printError('simctl returned non-JSON response: ${results.stdout}'); return <String, Object>{}; } } /// Returns all the connected simulator devices. Future<List<BootedSimDevice>> getConnectedDevices() async { final List<BootedSimDevice> devices = <BootedSimDevice>[]; final Map<String, Object?> devicesSection = await _listBootedDevices(); for (final String deviceCategory in devicesSection.keys) { final Object? devicesData = devicesSection[deviceCategory]; if (devicesData != null && devicesData is List<Object?>) { for (final Map<String, Object?> data in devicesData.map<Map<String, Object?>?>(castStringKeyedMap).whereType<Map<String, Object?>>()) { devices.add(BootedSimDevice(deviceCategory, data)); } } } return devices; } Future<bool> isInstalled(String deviceId, String appId) { return _processUtils.exitsHappy(<String>[ ..._xcode.xcrunCommand(), 'simctl', 'get_app_container', deviceId, appId, ]); } Future<RunResult> install(String deviceId, String appPath) async { RunResult result; try { result = await _processUtils.run( <String>[ ..._xcode.xcrunCommand(), 'simctl', 'install', deviceId, appPath, ], throwOnError: true, ); } on ProcessException catch (exception) { throwToolExit('Unable to install $appPath on $deviceId. This is sometimes caused by a malformed plist file:\n$exception'); } return result; } Future<RunResult> uninstall(String deviceId, String appId) async { RunResult result; try { result = await _processUtils.run( <String>[ ..._xcode.xcrunCommand(), 'simctl', 'uninstall', deviceId, appId, ], throwOnError: true, ); } on ProcessException catch (exception) { throwToolExit('Unable to uninstall $appId from $deviceId:\n$exception'); } return result; } Future<RunResult> launch(String deviceId, String appIdentifier, [ List<String>? launchArgs ]) async { RunResult result; try { result = await _processUtils.run( <String>[ ..._xcode.xcrunCommand(), 'simctl', 'launch', deviceId, appIdentifier, ...?launchArgs, ], throwOnError: true, ); } on ProcessException catch (exception) { throwToolExit('Unable to launch $appIdentifier on $deviceId:\n$exception'); } return result; } Future<RunResult> stopApp(String deviceId, String appIdentifier) async { RunResult result; try { result = await _processUtils.run( <String>[ ..._xcode.xcrunCommand(), 'simctl', 'terminate', deviceId, appIdentifier, ], throwOnError: true, ); } on ProcessException catch (exception) { throwToolExit('Unable to terminate $appIdentifier on $deviceId:\n$exception'); } return result; } Future<void> takeScreenshot(String deviceId, String outputPath) async { try { await _processUtils.run( <String>[ ..._xcode.xcrunCommand(), 'simctl', 'io', deviceId, 'screenshot', outputPath, ], throwOnError: true, ); } on ProcessException catch (exception) { _logger.printError('Unable to take screenshot of $deviceId:\n$exception'); } } /// Runs `simctl list runtimes available iOS --json` and returns all available iOS simulator runtimes. Future<List<IOSSimulatorRuntime>> listAvailableIOSRuntimes() async { final List<IOSSimulatorRuntime> runtimes = <IOSSimulatorRuntime>[]; final RunResult results = await _processUtils.run( <String>[ ..._xcode.xcrunCommand(), 'simctl', 'list', 'runtimes', 'available', 'iOS', '--json', ], ); if (results.exitCode != 0) { _logger.printError('Error executing simctl: ${results.exitCode}\n${results.stderr}'); return runtimes; } try { final Object? decodeResult = (json.decode(results.stdout) as Map<String, Object?>)['runtimes']; if (decodeResult is List<Object?>) { for (final Object? runtimeData in decodeResult) { if (runtimeData is Map<String, Object?>) { runtimes.add(IOSSimulatorRuntime.fromJson(runtimeData)); } } } return runtimes; } on FormatException { // We failed to parse the simctl output, or it returned junk. // One known message is "Install Started" isn't valid JSON but is // returned sometimes. _logger.printError('simctl returned non-JSON response: ${results.stdout}'); return runtimes; } } } class BootedSimDevice { BootedSimDevice(this.category, this.data); final String category; final Map<String, Object?> data; String? get name => data['name']?.toString(); String? get udid => data['udid']?.toString(); } class IOSSimulator extends Device { IOSSimulator( super.id, { required this.name, required this.simulatorCategory, required SimControl simControl, }) : _simControl = simControl, super( category: Category.mobile, platformType: PlatformType.ios, ephemeral: true, ); @override final String name; final String simulatorCategory; final SimControl _simControl; @override DevFSWriter createDevFSWriter(ApplicationPackage? app, String? userIdentifier) { return LocalDevFSWriter(fileSystem: globals.fs); } @override Future<bool> get isLocalEmulator async => true; @override Future<String> get emulatorId async => iosSimulatorId; @override bool get supportsHotReload => true; @override bool get supportsHotRestart => true; @override bool get supportsFlavors => true; @override Future<bool> get supportsHardwareRendering async => false; @override bool supportsRuntimeMode(BuildMode buildMode) => buildMode == BuildMode.debug; final Map<IOSApp?, DeviceLogReader> _logReaders = <IOSApp?, DeviceLogReader>{}; _IOSSimulatorDevicePortForwarder? _portForwarder; @override Future<bool> isAppInstalled( ApplicationPackage app, { String? userIdentifier, }) { return _simControl.isInstalled(id, app.id); } @override Future<bool> isLatestBuildInstalled(ApplicationPackage app) async => false; @override Future<bool> installApp( covariant IOSApp app, { String? userIdentifier, }) async { try { await _simControl.install(id, app.simulatorBundlePath); return true; } on Exception { return false; } } @override Future<bool> uninstallApp( ApplicationPackage app, { String? userIdentifier, }) async { try { await _simControl.uninstall(id, app.id); return true; } on Exception { return false; } } @override bool isSupported() { if (!globals.platform.isMacOS) { _supportMessage = 'iOS devices require a Mac host machine.'; return false; } // Check if the device is part of a blocked category. // We do not yet support WatchOS or tvOS devices. final RegExp blocklist = RegExp(r'Apple (TV|Watch)', caseSensitive: false); if (blocklist.hasMatch(name)) { _supportMessage = 'Flutter does not support Apple TV or Apple Watch.'; return false; } return true; } String? _supportMessage; @override String supportMessage() { if (isSupported()) { return 'Supported'; } return _supportMessage ?? 'Unknown'; } @override Future<LaunchResult> startApp( IOSApp package, { String? mainPath, String? route, required DebuggingOptions debuggingOptions, Map<String, Object?> platformArgs = const <String, Object?>{}, bool prebuiltApplication = false, bool ipv6 = false, String? userIdentifier, }) async { if (!prebuiltApplication && package is BuildableIOSApp) { globals.printTrace('Building ${package.name} for $id.'); try { await _setupUpdatedApplicationBundle(package, debuggingOptions.buildInfo, mainPath); } on ToolExit catch (e) { globals.printError('${e.message}'); return LaunchResult.failed(); } } else { if (!await installApp(package)) { return LaunchResult.failed(); } } // Prepare launch arguments. final List<String> launchArguments = debuggingOptions.getIOSLaunchArguments( EnvironmentType.simulator, route, platformArgs, ); ProtocolDiscovery? vmServiceDiscovery; if (debuggingOptions.debuggingEnabled) { vmServiceDiscovery = ProtocolDiscovery.vmService( getLogReader(app: package), ipv6: ipv6, hostPort: debuggingOptions.hostVmServicePort, devicePort: debuggingOptions.deviceVmServicePort, logger: globals.logger, ); } // Launch the updated application in the simulator. try { // Use the built application's Info.plist to get the bundle identifier, // which should always yield the correct value and does not require // parsing the xcodeproj or configuration files. // See https://github.com/flutter/flutter/issues/31037 for more information. final String plistPath = globals.fs.path.join(package.simulatorBundlePath, 'Info.plist'); final String? bundleIdentifier = globals.plistParser.getValueFromFile<String>(plistPath, PlistParser.kCFBundleIdentifierKey); if (bundleIdentifier == null) { globals.printError('Invalid prebuilt iOS app. Info.plist does not contain bundle identifier'); return LaunchResult.failed(); } await _simControl.launch(id, bundleIdentifier, launchArguments); } on Exception catch (error) { globals.printError('$error'); return LaunchResult.failed(); } if (!debuggingOptions.debuggingEnabled) { return LaunchResult.succeeded(); } // Wait for the service protocol port here. This will complete once the // device has printed "Dart VM Service is listening on..." globals.printTrace('Waiting for VM Service port to be available...'); try { final Uri? deviceUri = await vmServiceDiscovery?.uri; if (deviceUri != null) { return LaunchResult.succeeded(vmServiceUri: deviceUri); } globals.printError( 'Error waiting for a debug connection: ' 'The log reader failed unexpectedly', ); } on Exception catch (error) { globals.printError('Error waiting for a debug connection: $error'); } finally { await vmServiceDiscovery?.cancel(); } return LaunchResult.failed(); } Future<void> _setupUpdatedApplicationBundle(BuildableIOSApp app, BuildInfo buildInfo, String? mainPath) async { // Step 1: Build the Xcode project. // The build mode for the simulator is always debug. assert(buildInfo.isDebug); final XcodeBuildResult buildResult = await buildXcodeProject( app: app, buildInfo: buildInfo, targetOverride: mainPath, environmentType: EnvironmentType.simulator, deviceID: id, ); if (!buildResult.success) { await diagnoseXcodeBuildFailure(buildResult, globals.flutterUsage, globals.logger, globals.analytics); throwToolExit('Could not build the application for the simulator.'); } // Step 2: Assert that the Xcode project was successfully built. final Directory bundle = globals.fs.directory(app.simulatorBundlePath); final bool bundleExists = bundle.existsSync(); if (!bundleExists) { throwToolExit('Could not find the built application bundle at ${bundle.path}.'); } // Step 3: Install the updated bundle to the simulator. await _simControl.install(id, globals.fs.path.absolute(bundle.path)); } @override Future<bool> stopApp( ApplicationPackage? app, { String? userIdentifier, }) async { if (app == null) { return false; } return (await _simControl.stopApp(id, app.id)).exitCode == 0; } String get logFilePath { final String? logPath = globals.platform.environment['IOS_SIMULATOR_LOG_FILE_PATH']; return logPath != null ? logPath.replaceAll('%{id}', id) : globals.fs.path.join( globals.fsUtils.homeDirPath!, 'Library', 'Logs', 'CoreSimulator', id, 'system.log', ); } @override Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios; @override Future<String> get sdkNameAndVersion async => simulatorCategory; final RegExp _iosSdkRegExp = RegExp(r'iOS( |-)(\d+)'); Future<int> get sdkMajorVersion async { final Match? sdkMatch = _iosSdkRegExp.firstMatch(await sdkNameAndVersion); return int.parse(sdkMatch?.group(2) ?? '11'); } @override DeviceLogReader getLogReader({ covariant IOSApp? app, bool includePastLogs = false, }) { assert(!includePastLogs, 'Past log reading not supported on iOS simulators.'); return _logReaders.putIfAbsent(app, () => _IOSSimulatorLogReader(this, app)); } @override DevicePortForwarder get portForwarder => _portForwarder ??= _IOSSimulatorDevicePortForwarder(this); @override void clearLogs() { final File logFile = globals.fs.file(logFilePath); if (logFile.existsSync()) { final RandomAccessFile randomFile = logFile.openSync(mode: FileMode.write); randomFile.truncateSync(0); randomFile.closeSync(); } } Future<void> ensureLogsExists() async { if (await sdkMajorVersion < 11) { final File logFile = globals.fs.file(logFilePath); if (!logFile.existsSync()) { logFile.writeAsBytesSync(<int>[]); } } } @override bool get supportsScreenshot => true; @override Future<void> takeScreenshot(File outputFile) { return _simControl.takeScreenshot(id, outputFile.path); } @override bool isSupportedForProject(FlutterProject flutterProject) { return flutterProject.ios.existsSync(); } @override Future<void> dispose() async { for (final DeviceLogReader logReader in _logReaders.values) { logReader.dispose(); } await _portForwarder?.dispose(); } } class IOSSimulatorRuntime { IOSSimulatorRuntime._({ this.bundlePath, this.buildVersion, this.platform, this.runtimeRoot, this.identifier, this.version, this.isInternal, this.isAvailable, this.name, }); // Example: // { // "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Volumes\/iOS_21A5277g\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 17.0.simruntime", // "buildversion" : "21A5277g", // "platform" : "iOS", // "runtimeRoot" : "\/Library\/Developer\/CoreSimulator\/Volumes\/iOS_21A5277g\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 17.0.simruntime\/Contents\/Resources\/RuntimeRoot", // "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-17-0", // "version" : "17.0", // "isInternal" : false, // "isAvailable" : true, // "name" : "iOS 17.0", // "supportedDeviceTypes" : [ // { // "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 8.simdevicetype", // "name" : "iPhone 8", // "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8", // "productFamily" : "iPhone" // } // ] // }, factory IOSSimulatorRuntime.fromJson(Map<String, Object?> data) { return IOSSimulatorRuntime._( bundlePath: data['bundlePath']?.toString(), buildVersion: data['buildversion']?.toString(), platform: data['platform']?.toString(), runtimeRoot: data['runtimeRoot']?.toString(), identifier: data['identifier']?.toString(), version: Version.parse(data['version']?.toString()), isInternal: data['isInternal'] is bool? ? data['isInternal'] as bool? : null, isAvailable: data['isAvailable'] is bool? ? data['isAvailable'] as bool? : null, name: data['name']?.toString(), ); } final String? bundlePath; final String? buildVersion; final String? platform; final String? runtimeRoot; final String? identifier; final Version? version; final bool? isInternal; final bool? isAvailable; final String? name; } /// Launches the device log reader process on the host and parses the syslog. @visibleForTesting Future<Process> launchDeviceSystemLogTool(IOSSimulator device) async { return globals.processUtils.start(<String>['tail', '-n', '0', '-F', device.logFilePath]); } /// Launches the device log reader process on the host and parses unified logging. @visibleForTesting Future<Process> launchDeviceUnifiedLogging (IOSSimulator device, String? appName) async { // Make NSPredicate concatenation easier to read. String orP(List<String> clauses) => '(${clauses.join(" OR ")})'; String andP(List<String> clauses) => clauses.join(' AND '); String notP(String clause) => 'NOT($clause)'; final String predicate = andP(<String>[ 'eventType = logEvent', if (appName != null) 'processImagePath ENDSWITH "$appName"', // Either from Flutter or Swift (maybe assertion or fatal error) or from the app itself. orP(<String>[ 'senderImagePath ENDSWITH "/Flutter"', 'senderImagePath ENDSWITH "/libswiftCore.dylib"', 'processImageUUID == senderImageUUID', ]), // Filter out some messages that clearly aren't related to Flutter. notP('eventMessage CONTAINS ": could not find icon for representation -> com.apple."'), notP('eventMessage BEGINSWITH "assertion failed: "'), notP('eventMessage CONTAINS " libxpc.dylib "'), ]); return globals.processUtils.start(<String>[ ...globals.xcode!.xcrunCommand(), 'simctl', 'spawn', device.id, 'log', 'stream', '--style', 'json', '--predicate', predicate, ]); } @visibleForTesting Future<Process?> launchSystemLogTool(IOSSimulator device) async { // Versions of iOS prior to 11 tail the simulator syslog file. if (await device.sdkMajorVersion < 11) { return globals.processUtils.start(<String>['tail', '-n', '0', '-F', '/private/var/log/system.log']); } // For iOS 11 and later, all relevant detail is in the device log. return null; } class _IOSSimulatorLogReader extends DeviceLogReader { _IOSSimulatorLogReader(this.device, IOSApp? app) : _appName = app?.name?.replaceAll('.app', ''); final IOSSimulator device; final String? _appName; late final StreamController<String> _linesController = StreamController<String>.broadcast( onListen: _start, onCancel: _stop, ); // We log from two files: the device and the system log. Process? _deviceProcess; Process? _systemProcess; @override Stream<String> get logLines => _linesController.stream; @override String get name => device.name; Future<void> _start() async { // Unified logging iOS 11 and greater (introduced in iOS 10). if (await device.sdkMajorVersion >= 11) { _deviceProcess = await launchDeviceUnifiedLogging(device, _appName); _deviceProcess?.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_onUnifiedLoggingLine); _deviceProcess?.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_onUnifiedLoggingLine); } else { // Fall back to syslog parsing. await device.ensureLogsExists(); _deviceProcess = await launchDeviceSystemLogTool(device); _deviceProcess?.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_onSysLogDeviceLine); _deviceProcess?.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_onSysLogDeviceLine); } // Track system.log crashes. // ReportCrash[37965]: Saved crash report for FlutterRunner[37941]... _systemProcess = await launchSystemLogTool(device); if (_systemProcess != null) { _systemProcess?.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_onSystemLine); _systemProcess?.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_onSystemLine); } // We don't want to wait for the process or its callback. Best effort // cleanup in the callback. unawaited(_deviceProcess?.exitCode.whenComplete(() { if (_linesController.hasListener) { _linesController.close(); } })); } // Match the log prefix (in order to shorten it): // * Xcode 8: Sep 13 15:28:51 cbracken-macpro localhost Runner[37195]: (Flutter) The Dart VM service is listening on http://127.0.0.1:57701/ // * Xcode 9: 2017-09-13 15:26:57.228948-0700 localhost Runner[37195]: (Flutter) The Dart VM service is listening on http://127.0.0.1:57701/ static final RegExp _mapRegex = RegExp(r'\S+ +\S+ +(?:\S+) (.+?(?=\[))\[\d+\]\)?: (\(.*?\))? *(.*)$'); // Jan 31 19:23:28 --- last message repeated 1 time --- static final RegExp _lastMessageSingleRegex = RegExp(r'\S+ +\S+ +\S+ --- last message repeated 1 time ---$'); static final RegExp _lastMessageMultipleRegex = RegExp(r'\S+ +\S+ +\S+ --- last message repeated (\d+) times ---$'); static final RegExp _flutterRunnerRegex = RegExp(r' FlutterRunner\[\d+\] '); // Remember what we did with the last line, in case we need to process // a multiline record bool _lastLineMatched = false; String? _filterDeviceLine(String string) { final Match? match = _mapRegex.matchAsPrefix(string); if (match != null) { // The category contains the text between the date and the PID. Depending on which version of iOS being run, // it can contain "hostname App Name" or just "App Name". final String? category = match.group(1); final String? tag = match.group(2); final String? content = match.group(3); // Filter out log lines from an app other than this one (category doesn't match the app name). // If the hostname is included in the category, check that it doesn't end with the app name. final String? appName = _appName; if (appName != null && category != null && !category.endsWith(appName)) { return null; } if (tag != null && tag != '(Flutter)') { return null; } // Filter out some messages that clearly aren't related to Flutter. if (string.contains(': could not find icon for representation -> com.apple.')) { return null; } // assertion failed: 15G1212 13E230: libxpc.dylib + 57882 [66C28065-C9DB-3C8E-926F-5A40210A6D1B]: 0x7d if (content != null && content.startsWith('assertion failed: ') && content.contains(' libxpc.dylib ')) { return null; } if (appName == null) { return '$category: $content'; } else if (category != null && (category == appName || category.endsWith(' $appName'))) { return content; } return null; } if (string.startsWith('Filtering the log data using ')) { return null; } if (string.startsWith('Timestamp (process)[PID]')) { return null; } if (_lastMessageSingleRegex.matchAsPrefix(string) != null) { return null; } if (RegExp(r'assertion failed: .* libxpc.dylib .* 0x7d$').matchAsPrefix(string) != null) { return null; } // Starts with space(s) - continuation of the multiline message if (RegExp(r'\s+').matchAsPrefix(string) != null && !_lastLineMatched) { return null; } return string; } String? _lastLine; void _onSysLogDeviceLine(String line) { globals.printTrace('[DEVICE LOG] $line'); final Match? multi = _lastMessageMultipleRegex.matchAsPrefix(line); if (multi != null) { if (_lastLine != null) { int repeat = int.parse(multi.group(1)!); repeat = math.max(0, math.min(100, repeat)); for (int i = 1; i < repeat; i++) { _linesController.add(_lastLine!); } } } else { _lastLine = _filterDeviceLine(line); if (_lastLine != null) { _linesController.add(_lastLine!); _lastLineMatched = true; } else { _lastLineMatched = false; } } } // "eventMessage" : "flutter: 21", static final RegExp _unifiedLoggingEventMessageRegex = RegExp(r'.*"eventMessage" : (".*")'); void _onUnifiedLoggingLine(String line) { // The log command predicate handles filtering, so every log eventMessage should be decoded and added. final Match? eventMessageMatch = _unifiedLoggingEventMessageRegex.firstMatch(line); if (eventMessageMatch != null) { final String message = eventMessageMatch.group(1)!; try { final Object? decodedJson = jsonDecode(message); if (decodedJson is String) { _linesController.add(decodedJson); } } on FormatException { globals.printError('Logger returned non-JSON response: $message'); } } } String _filterSystemLog(String string) { final Match? match = _mapRegex.matchAsPrefix(string); return match == null ? string : '${match.group(1)}: ${match.group(2)}'; } void _onSystemLine(String line) { globals.printTrace('[SYS LOG] $line'); if (!_flutterRunnerRegex.hasMatch(line)) { return; } final String filteredLine = _filterSystemLog(line); _linesController.add(filteredLine); } void _stop() { _deviceProcess?.kill(); _systemProcess?.kill(); } @override void dispose() { _stop(); } } int compareIosVersions(String v1, String v2) { final List<int> v1Fragments = v1.split('.').map<int>(int.parse).toList(); final List<int> v2Fragments = v2.split('.').map<int>(int.parse).toList(); int i = 0; while (i < v1Fragments.length && i < v2Fragments.length) { final int v1Fragment = v1Fragments[i]; final int v2Fragment = v2Fragments[i]; if (v1Fragment != v2Fragment) { return v1Fragment.compareTo(v2Fragment); } i += 1; } return v1Fragments.length.compareTo(v2Fragments.length); } class _IOSSimulatorDevicePortForwarder extends DevicePortForwarder { _IOSSimulatorDevicePortForwarder(this.device); final IOSSimulator device; final List<ForwardedPort> _ports = <ForwardedPort>[]; @override List<ForwardedPort> get forwardedPorts => _ports; @override Future<int> forward(int devicePort, { int? hostPort }) async { if (hostPort == null || hostPort == 0) { hostPort = devicePort; } assert(devicePort == hostPort); _ports.add(ForwardedPort(devicePort, hostPort)); return hostPort; } @override Future<void> unforward(ForwardedPort forwardedPort) async { _ports.remove(forwardedPort); } @override Future<void> dispose() async { final List<ForwardedPort> portsCopy = List<ForwardedPort>.of(_ports); for (final ForwardedPort port in portsCopy) { await unforward(port); } } }
flutter/packages/flutter_tools/lib/src/ios/simulators.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/ios/simulators.dart", "repo_id": "flutter", "token_count": 12461 }
828
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:native_assets_builder/native_assets_builder.dart' hide NativeAssetsBuildRunner; import 'package:native_assets_cli/native_assets_cli_internal.dart' hide BuildMode; import '../../../base/file_system.dart'; import '../../../build_info.dart'; import '../../../globals.dart' as globals; import '../../../windows/visual_studio.dart'; import '../native_assets.dart'; /// Dry run the native builds. /// /// This does not build native assets, it only simulates what the final paths /// of all assets will be so that this can be embedded in the kernel file. Future<Uri?> dryRunNativeAssetsWindows({ required NativeAssetsBuildRunner buildRunner, required Uri projectUri, bool flutterTester = false, required FileSystem fileSystem, }) { return dryRunNativeAssetsSingleArchitecture( buildRunner: buildRunner, projectUri: projectUri, flutterTester: flutterTester, fileSystem: fileSystem, os: OS.windows, ); } Future<Iterable<KernelAsset>> dryRunNativeAssetsWindowsInternal( FileSystem fileSystem, Uri projectUri, bool flutterTester, NativeAssetsBuildRunner buildRunner, ) { return dryRunNativeAssetsSingleArchitectureInternal( fileSystem, projectUri, flutterTester, buildRunner, OS.windows, ); } Future<(Uri? nativeAssetsYaml, List<Uri> dependencies)> buildNativeAssetsWindows({ required NativeAssetsBuildRunner buildRunner, TargetPlatform? targetPlatform, required Uri projectUri, required BuildMode buildMode, bool flutterTester = false, Uri? yamlParentDirectory, required FileSystem fileSystem, }) { return buildNativeAssetsSingleArchitecture( buildRunner: buildRunner, targetPlatform: targetPlatform, projectUri: projectUri, buildMode: buildMode, flutterTester: flutterTester, yamlParentDirectory: yamlParentDirectory, fileSystem: fileSystem, ); } Future<CCompilerConfig> cCompilerConfigWindows() async { final VisualStudio visualStudio = VisualStudio( fileSystem: globals.fs, platform: globals.platform, logger: globals.logger, processManager: globals.processManager, osUtils: globals.os, ); return CCompilerConfig( cc: _toOptionalFileUri(visualStudio.clPath), ld: _toOptionalFileUri(visualStudio.linkPath), ar: _toOptionalFileUri(visualStudio.libPath), envScript: _toOptionalFileUri(visualStudio.vcvarsPath), envScriptArgs: <String>[], ); } Uri? _toOptionalFileUri(String? string) { if (string == null) { return null; } return Uri.file(string); }
flutter/packages/flutter_tools/lib/src/isolated/native_assets/windows/native_assets.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/isolated/native_assets/windows/native_assets.dart", "repo_id": "flutter", "token_count": 900 }
829
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../base/fingerprint.dart'; import '../build_info.dart'; import '../cache.dart'; import '../flutter_plugins.dart'; import '../globals.dart' as globals; import '../project.dart'; /// For a given build, determines whether dependencies have changed since the /// last call to processPods, then calls processPods with that information. Future<void> processPodsIfNeeded( XcodeBasedProject xcodeProject, String buildDirectory, BuildMode buildMode) async { final FlutterProject project = xcodeProject.parent; // Ensure that the plugin list is up to date, since hasPlugins relies on it. await refreshPluginsList(project, macOSPlatform: project.macos.existsSync()); if (!(hasPlugins(project) || (project.isModule && xcodeProject.podfile.existsSync()))) { return; } // If the Xcode project, Podfile, or generated xcconfig have changed since // last run, pods should be updated. final Fingerprinter fingerprinter = Fingerprinter( fingerprintPath: globals.fs.path.join(buildDirectory, 'pod_inputs.fingerprint'), paths: <String>[ xcodeProject.xcodeProjectInfoFile.path, xcodeProject.podfile.path, globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', 'bin', 'podhelper.rb', ), ], fileSystem: globals.fs, logger: globals.logger, ); final bool didPodInstall = await globals.cocoaPods?.processPods( xcodeProject: xcodeProject, buildMode: buildMode, dependenciesChanged: !fingerprinter.doesFingerprintMatch(), ) ?? false; if (didPodInstall) { fingerprinter.writeFingerprint(); } }
flutter/packages/flutter_tools/lib/src/macos/cocoapod_utils.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/macos/cocoapod_utils.dart", "repo_id": "flutter", "token_count": 608 }
830
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../base/file_system.dart'; import '../base/project_migrator.dart'; import '../base/version.dart'; import '../ios/xcodeproj.dart'; import '../xcode_project.dart'; /// Starting in Xcode 15, when building macOS, DT_TOOLCHAIN_DIR cannot be used /// to evaluate LD_RUNPATH_SEARCH_PATHS or LIBRARY_SEARCH_PATHS. `xcodebuild` /// error message recommend using TOOLCHAIN_DIR instead. /// /// This has been fixed upstream in CocoaPods, but migrate a copy of their /// workaround so users don't need to update. class CocoaPodsToolchainDirectoryMigration extends ProjectMigrator { CocoaPodsToolchainDirectoryMigration( XcodeBasedProject project, XcodeProjectInterpreter xcodeProjectInterpreter, super.logger, ) : _podRunnerTargetSupportFiles = project.podRunnerTargetSupportFiles, _xcodeProjectInterpreter = xcodeProjectInterpreter; final Directory _podRunnerTargetSupportFiles; final XcodeProjectInterpreter _xcodeProjectInterpreter; @override void migrate() { if (!_podRunnerTargetSupportFiles.existsSync()) { logger.printTrace('CocoaPods Pods-Runner Target Support Files not found, skipping TOOLCHAIN_DIR workaround.'); return; } final Version? version = _xcodeProjectInterpreter.version; // If Xcode not installed or less than 15, skip this migration. if (version == null || version < Version(15, 0, 0)) { logger.printTrace('Detected Xcode version is $version, below 15.0, skipping TOOLCHAIN_DIR workaround.'); return; } final List<FileSystemEntity> files = _podRunnerTargetSupportFiles.listSync(); for (final FileSystemEntity file in files) { if (file.basename.endsWith('xcconfig') && file is File) { processFileLines(file); } } } @override String? migrateLine(String line) { final String trimmedString = line.trim(); if (trimmedString.startsWith('LD_RUNPATH_SEARCH_PATHS') || trimmedString.startsWith('LIBRARY_SEARCH_PATHS')) { const String originalReadLinkLine = r'{DT_TOOLCHAIN_DIR}'; const String replacementReadLinkLine = r'{TOOLCHAIN_DIR}'; return line.replaceAll(originalReadLinkLine, replacementReadLinkLine); } return line; } }
flutter/packages/flutter_tools/lib/src/migrations/cocoapods_toolchain_directory_migration.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/migrations/cocoapods_toolchain_directory_migration.dart", "repo_id": "flutter", "token_count": 798 }
831
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:math'; import 'dart:typed_data'; import 'package:crypto/crypto.dart'; import 'package:meta/meta.dart'; import '../base/file_system.dart'; import '../build_system/hash.dart'; import '../convert.dart'; /// Adler-32 and MD5 hashes of blocks in files. class BlockHashes { const BlockHashes({ required this.blockSize, required this.totalSize, required this.adler32, required this.md5, required this.fileMd5, }); BlockHashes.fromJson(Map<String, Object?> obj) : blockSize = obj['blockSize']! as int, totalSize = obj['totalSize']! as int, adler32 = Uint32List.view(base64.decode(obj['adler32']! as String).buffer), md5 = (obj['md5']! as List<Object?>).cast<String>(), fileMd5 = obj['fileMd5']! as String; /// The block size used to generate the hashes. final int blockSize; /// Total size of the file. final int totalSize; /// List of adler32 hashes of each block in the file. final List<int> adler32; /// List of MD5 hashes of each block in the file. final List<String> md5; /// MD5 hash of the whole file. final String fileMd5; Map<String, Object> toJson() => <String, Object>{ 'blockSize': blockSize, 'totalSize': totalSize, 'adler32': base64.encode(Uint8List.view(Uint32List.fromList(adler32).buffer)), 'md5': md5, 'fileMd5': fileMd5, }; } /// Converts a stream of bytes, into a stream of bytes of fixed chunk size. @visibleForTesting Stream<Uint8List> convertToChunks(Stream<Uint8List> source, int chunkSize) { final BytesBuilder bytesBuilder = BytesBuilder(copy: false); final StreamController<Uint8List> controller = StreamController<Uint8List>(); final StreamSubscription<Uint8List> subscription = source.listen((Uint8List chunk) { int start = 0; while (start < chunk.length) { final int sizeToTake = min(chunkSize - bytesBuilder.length, chunk.length - start); assert(sizeToTake > 0); assert(sizeToTake <= chunkSize); final Uint8List sublist = chunk.sublist(start, start + sizeToTake); start += sizeToTake; if (bytesBuilder.isEmpty && sizeToTake == chunkSize) { controller.add(sublist); } else { bytesBuilder.add(sublist); assert(bytesBuilder.length <= chunkSize); if (bytesBuilder.length == chunkSize) { controller.add(bytesBuilder.takeBytes()); } } } }, onDone: () { if (controller.hasListener && !controller.isClosed) { if (bytesBuilder.isNotEmpty) { controller.add(bytesBuilder.takeBytes()); } controller.close(); } }, onError: (Object error, StackTrace stackTrace) { controller.addError(error, stackTrace); }); controller.onCancel = subscription.cancel; controller.onPause = subscription.pause; controller.onResume = subscription.resume; return controller.stream; } const int _adler32Prime = 65521; /// Helper function to calculate Adler32 hash of a binary. @visibleForTesting int adler32Hash(Uint8List binary) { // The maximum integer that can be stored in the `int` data type. const int maxInt = 0x1fffffffffffff; // maxChunkSize is the maximum number of bytes we can sum without // performing the modulus operation, without overflow. // n * (n + 1) / 2 * 255 < maxInt // n < sqrt(maxInt / 255) - 1 final int maxChunkSize = sqrt(maxInt / 255).floor() - 1; int a = 1; int b = 0; final int length = binary.length; for (int i = 0; i < length; i += maxChunkSize) { final int end = i + maxChunkSize < length ? i + maxChunkSize : length; for (int j = i; j < end; j++) { a += binary[j]; b += a; } a %= _adler32Prime; b %= _adler32Prime; } return ((b & 0xffff) << 16) | (a & 0xffff); } /// Helper to calculate rolling Adler32 hash of a file. @visibleForTesting class RollingAdler32 { RollingAdler32(this.blockSize): _buffer = Uint8List(blockSize); /// Block size of the rolling hash calculation. final int blockSize; int processedBytes = 0; final Uint8List _buffer; int _cur = 0; int _a = 1; int _b = 0; /// The current rolling hash value. int get hash => ((_b & 0xffff) << 16) | (_a & 0xffff); /// Push a new character into the rolling chunk window, and returns the /// current hash value. int push(int char) { processedBytes++; if (processedBytes > blockSize) { final int prev = _buffer[_cur]; _b -= prev * blockSize + 1; _a -= prev; } _a += char; _b += _a; _buffer[_cur] = char; _cur++; if (_cur == blockSize) { _cur = 0; } _a %= _adler32Prime; _b %= _adler32Prime; return hash; } /// Returns a [Uint8List] of size [blockSize] that was used to calculate the /// current Adler32 hash. Uint8List currentBlock() { if (processedBytes < blockSize) { return Uint8List.sublistView(_buffer, 0, processedBytes); } else if (_cur == 0) { return _buffer; } else { final BytesBuilder builder = BytesBuilder(copy:false) ..add(Uint8List.sublistView(_buffer, _cur)) ..add(Uint8List.sublistView(_buffer, 0, _cur)); return builder.takeBytes(); } } void reset() { _a = 1; _b = 0; processedBytes = 0; } } /// Helper for rsync-like file transfer. /// /// The algorithm works as follows. /// /// First, in the destination device, calculate hashes of the every block of /// the same size. Two hashes are used, Adler-32 for the rolling hash, and MD5 /// as a hash with a lower chance of collision. /// /// The block size is chosen to balance between the amount of data required in /// the initial transmission, and the amount of data needed for rebuilding the /// file. /// /// Next, on the machine that contains the source file, we calculate the /// rolling hash of the source file, for every possible position. If the hash /// is found on the block hashes, we then compare the MD5 of the block. If both /// the Adler-32 and MD5 hash match, we consider that the block is identical. /// /// For each block that can be found, we will generate the instruction asking /// the destination machine to read block from the destination block. For /// blocks that can't be found, we will transfer the content of the blocks. /// /// On the receiving end, it will build a copy of the source file from the /// given instructions. class FileTransfer { const FileTransfer(); /// Calculate hashes of blocks in the file. Future<BlockHashes> calculateBlockHashesOfFile(File file, { int? blockSize }) async { final int totalSize = await file.length(); blockSize ??= max(sqrt(totalSize).ceil(), 2560); final Stream<Uint8List> fileContentStream = file.openRead().map((List<int> chunk) => chunk is Uint8List ? chunk : Uint8List.fromList(chunk)); final List<int> adler32Results = <int>[]; final List<String> md5Results = <String>[]; await convertToChunks(fileContentStream, blockSize).forEach((Uint8List chunk) { adler32Results.add(adler32Hash(chunk)); md5Results.add(base64.encode(md5.convert(chunk).bytes)); }); // Handle whole file md5 separately. Md5Hash requires the chunk size to be a multiple of 64. final String fileMd5 = await _md5OfFile(file); return BlockHashes( blockSize: blockSize, totalSize: totalSize, adler32: adler32Results, md5: md5Results, fileMd5: fileMd5, ); } /// Compute the instructions to rebuild the source [file] with the block /// hashes of the destination file. /// /// Returns an empty list if the destination file is exactly the same as the /// source file. Future<List<FileDeltaBlock>> computeDelta(File file, BlockHashes hashes) async { // Skip computing delta if the destination file matches the source file. if (await file.length() == hashes.totalSize && await _md5OfFile(file) == hashes.fileMd5) { return <FileDeltaBlock>[]; } final Stream<List<int>> fileContentStream = file.openRead(); final int blockSize = hashes.blockSize; // Generate a lookup for adler32 hash to block index. final Map<int, List<int>> adler32ToBlockIndex = <int, List<int>>{}; for (int i = 0; i < hashes.adler32.length; i++) { (adler32ToBlockIndex[hashes.adler32[i]] ??= <int>[]).add(i); } final RollingAdler32 adler32 = RollingAdler32(blockSize); // Number of bytes read. int size = 0; // Offset of the beginning of the current block. int start = 0; final List<FileDeltaBlock> blocks = <FileDeltaBlock>[]; await fileContentStream.forEach((List<int> chunk) { for (int i = 0; i < chunk.length; i++) { final int c = chunk[i]; final int hash = adler32.push(c); size++; if (size - start < blockSize) { // Ignore if we have not processed enough bytes. continue; } if (!adler32ToBlockIndex.containsKey(hash)) { // Adler32 hash of the current block does not match the destination file. continue; } // The indices of possible matching blocks. final List<int> blockIndices = adler32ToBlockIndex[hash]!; final String md5Hash = base64.encode(md5.convert(adler32.currentBlock()).bytes); // Verify if any of our findings actually matches the destination block by comparing its MD5. for (final int blockIndex in blockIndices) { if (hashes.md5[blockIndex] != md5Hash) { // Adler-32 hash collision. This is not an actual match. continue; } // Found matching entry, generate instruction for reconstructing the file. // Copy the previously unmatched data from the source file. if (size - start > blockSize) { blocks.add(FileDeltaBlock.fromSource(start: start, size: size - start - blockSize)); } start = size; // Try to extend the previous entry. if (blocks.isNotEmpty && blocks.last.copyFromDestination) { final int lastBlockIndex = (blocks.last.start + blocks.last.size) ~/ blockSize; if (hashes.md5[lastBlockIndex] == md5Hash) { // We can extend the previous entry. final FileDeltaBlock last = blocks.removeLast(); blocks.add(FileDeltaBlock.fromDestination(start: last.start, size: last.size + blockSize)); break; } } blocks.add(FileDeltaBlock.fromDestination(start: blockIndex * blockSize, size: blockSize)); break; } } }); // For the remaining content that is not matched, copy from the source. if (start < size) { blocks.add(FileDeltaBlock.fromSource(start: start, size: size - start)); } return blocks; } /// Generates the binary blocks that need to be transferred to the remote /// end to regenerate the file. Future<Uint8List> binaryForRebuilding(File file, List<FileDeltaBlock> delta) async { final RandomAccessFile binaryView = await file.open(); final Iterable<FileDeltaBlock> toTransfer = delta.where((FileDeltaBlock block) => !block.copyFromDestination); final int totalSize = toTransfer.map((FileDeltaBlock i) => i.size).reduce((int a, int b) => a + b); final Uint8List buffer = Uint8List(totalSize); int start = 0; for (final FileDeltaBlock current in toTransfer) { await binaryView.setPosition(current.start); await binaryView.readInto(buffer, start, start + current.size); start += current.size; } assert(start == buffer.length); return buffer; } /// Generate the new destination file from the source file, with the /// [blocks] and [binary] stream given. Future<bool> rebuildFile(File file, List<FileDeltaBlock> delta, Stream<List<int>> binary) async { final RandomAccessFile fileView = await file.open(); // Buffer used to hold the file content in memory. final BytesBuilder buffer = BytesBuilder(copy: false); final StreamIterator<List<int>> iterator = StreamIterator<List<int>>(binary); int currentIteratorStart = -1; bool iteratorMoveNextReturnValue = true; for (final FileDeltaBlock current in delta) { if (current.copyFromDestination) { await fileView.setPosition(current.start); buffer.add(await fileView.read(current.size)); } else { int toRead = current.size; while (toRead > 0) { if (currentIteratorStart >= 0 && currentIteratorStart < iterator.current.length) { final int size = iterator.current.length - currentIteratorStart; final int sizeToRead = min(toRead, size); buffer.add(iterator.current.sublist(currentIteratorStart, currentIteratorStart + sizeToRead)); currentIteratorStart += sizeToRead; toRead -= sizeToRead; } else { currentIteratorStart = 0; iteratorMoveNextReturnValue = await iterator.moveNext(); } } } } await file.writeAsBytes(buffer.takeBytes(), flush: true); // Drain the stream iterator if needed. while (iteratorMoveNextReturnValue) { iteratorMoveNextReturnValue = await iterator.moveNext(); } return true; } Future<String> _md5OfFile(File file) async { final Md5Hash fileMd5Hash = Md5Hash(); await file.openRead().forEach((List<int> chunk) => fileMd5Hash.addChunk(chunk is Uint8List ? chunk : Uint8List.fromList(chunk))); return base64.encode(fileMd5Hash.finalize().buffer.asUint8List()); } } /// Represents a single line of instruction on how to generate the target file. @immutable class FileDeltaBlock { const FileDeltaBlock.fromSource({required this.start, required this.size}): copyFromDestination = false; const FileDeltaBlock.fromDestination({required this.start, required this.size}): copyFromDestination = true; /// If true, this block should be read from the destination file. final bool copyFromDestination; /// The size of the current block. final int size; /// Byte offset in the destination file from which the block should be read. final int start; Map<String, Object> toJson() => <String, Object> { if (copyFromDestination) 'start': start, 'size': size, }; static List<FileDeltaBlock> fromJsonList(List<Map<String, Object?>> jsonList) { return jsonList.map((Map<String, Object?> json) { if (json.containsKey('start')) { return FileDeltaBlock.fromDestination(start: json['start']! as int, size: json['size']! as int); } else { // The start position does not matter on the destination machine. return FileDeltaBlock.fromSource(start: 0, size: json['size']! as int); } }).toList(); } @override bool operator ==(Object other) { if (other is! FileDeltaBlock) { return false; } return other.copyFromDestination == copyFromDestination && other.size == size && other.start == start; } @override int get hashCode => Object.hash(copyFromDestination, size, start); }
flutter/packages/flutter_tools/lib/src/proxied_devices/file_transfer.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/proxied_devices/file_transfer.dart", "repo_id": "flutter", "token_count": 5448 }
832
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:args/args.dart'; import 'package:args/command_runner.dart'; import 'package:file/file.dart'; import 'package:meta/meta.dart'; import 'package:package_config/package_config_types.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../application_package.dart'; import '../base/common.dart'; import '../base/context.dart'; import '../base/io.dart' as io; import '../base/io.dart'; import '../base/os.dart'; import '../base/utils.dart'; import '../build_info.dart'; import '../build_system/build_system.dart'; import '../bundle.dart' as bundle; import '../cache.dart'; import '../convert.dart'; import '../dart/generate_synthetic_packages.dart'; import '../dart/package_map.dart'; import '../dart/pub.dart'; import '../device.dart'; import '../features.dart'; import '../globals.dart' as globals; import '../preview_device.dart'; import '../project.dart'; import '../reporting/reporting.dart'; import '../reporting/unified_analytics.dart'; import '../web/compile.dart'; import 'flutter_command_runner.dart'; import 'target_devices.dart'; export '../cache.dart' show DevelopmentArtifact; abstract class DotEnvRegex { // Dot env multi-line block value regex static final RegExp multiLineBlock = RegExp(r'^\s*([a-zA-Z_]+[a-zA-Z0-9_]*)\s*=\s*"""\s*(.*)$'); // Dot env full line value regex (eg FOO=bar) // Entire line will be matched including key and value static final RegExp keyValue = RegExp(r'^\s*([a-zA-Z_]+[a-zA-Z0-9_]*)\s*=\s*(.*)?$'); // Dot env value wrapped in double quotes regex (eg FOO="bar") // Value between double quotes will be matched (eg only bar in "bar") static final RegExp doubleQuotedValue = RegExp(r'^"(.*)"\s*(\#\s*.*)?$'); // Dot env value wrapped in single quotes regex (eg FOO='bar') // Value between single quotes will be matched (eg only bar in 'bar') static final RegExp singleQuotedValue = RegExp(r"^'(.*)'\s*(\#\s*.*)?$"); // Dot env value wrapped in back quotes regex (eg FOO=`bar`) // Value between back quotes will be matched (eg only bar in `bar`) static final RegExp backQuotedValue = RegExp(r'^`(.*)`\s*(\#\s*.*)?$'); // Dot env value without quotes regex (eg FOO=bar) // Value without quotes will be matched (eg full value after the equals sign) static final RegExp unquotedValue = RegExp(r'^([^#\n\s]*)\s*(?:\s*#\s*(.*))?$'); } abstract class _HttpRegex { // https://datatracker.ietf.org/doc/html/rfc7230#section-3.2 static const String _vchar = r'\x21-\x7E'; static const String _spaceOrTab = r'\x20\x09'; static const String _nonDelimiterVchar = r'\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E'; // --web-header is provided as key=value for consistency with --dart-define static final RegExp httpHeader = RegExp('^([$_nonDelimiterVchar]+)' r'\s*=\s*' '([$_vchar$_spaceOrTab]+)' r'$'); } enum ExitStatus { success, warning, fail, killed, } /// [FlutterCommand]s' subclasses' [FlutterCommand.runCommand] can optionally /// provide a [FlutterCommandResult] to furnish additional information for /// analytics. class FlutterCommandResult { const FlutterCommandResult( this.exitStatus, { this.timingLabelParts, this.endTimeOverride, }); /// A command that succeeded. It is used to log the result of a command invocation. factory FlutterCommandResult.success() { return const FlutterCommandResult(ExitStatus.success); } /// A command that exited with a warning. It is used to log the result of a command invocation. factory FlutterCommandResult.warning() { return const FlutterCommandResult(ExitStatus.warning); } /// A command that failed. It is used to log the result of a command invocation. factory FlutterCommandResult.fail() { return const FlutterCommandResult(ExitStatus.fail); } final ExitStatus exitStatus; /// Optional data that can be appended to the timing event. /// https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#timingLabel /// Do not add PII. final List<String?>? timingLabelParts; /// Optional epoch time when the command's non-interactive wait time is /// complete during the command's execution. Use to measure user perceivable /// latency without measuring user interaction time. /// /// [FlutterCommand] will automatically measure and report the command's /// complete time if not overridden. final DateTime? endTimeOverride; @override String toString() => exitStatus.name; } /// Common flutter command line options. abstract final class FlutterOptions { static const String kFrontendServerStarterPath = 'frontend-server-starter-path'; static const String kExtraFrontEndOptions = 'extra-front-end-options'; static const String kExtraGenSnapshotOptions = 'extra-gen-snapshot-options'; static const String kEnableExperiment = 'enable-experiment'; static const String kFileSystemRoot = 'filesystem-root'; static const String kFileSystemScheme = 'filesystem-scheme'; static const String kSplitDebugInfoOption = 'split-debug-info'; static const String kDartObfuscationOption = 'obfuscate'; static const String kDartDefinesOption = 'dart-define'; static const String kDartDefineFromFileOption = 'dart-define-from-file'; static const String kBundleSkSLPathOption = 'bundle-sksl-path'; static const String kPerformanceMeasurementFile = 'performance-measurement-file'; static const String kNullSafety = 'sound-null-safety'; static const String kDeviceUser = 'device-user'; static const String kDeviceTimeout = 'device-timeout'; static const String kDeviceConnection = 'device-connection'; static const String kAnalyzeSize = 'analyze-size'; static const String kCodeSizeDirectory = 'code-size-directory'; static const String kNullAssertions = 'null-assertions'; static const String kAndroidGradleDaemon = 'android-gradle-daemon'; static const String kDeferredComponents = 'deferred-components'; static const String kAndroidProjectArgs = 'android-project-arg'; static const String kAndroidSkipBuildDependencyValidation = 'android-skip-build-dependency-validation'; static const String kInitializeFromDill = 'initialize-from-dill'; static const String kAssumeInitializeFromDillUpToDate = 'assume-initialize-from-dill-up-to-date'; static const String kNativeAssetsYamlFile = 'native-assets-yaml-file'; static const String kFatalWarnings = 'fatal-warnings'; static const String kUseApplicationBinary = 'use-application-binary'; static const String kWebBrowserFlag = 'web-browser-flag'; static const String kWebRendererFlag = 'web-renderer'; static const String kWebResourcesCdnFlag = 'web-resources-cdn'; static const String kWebWasmFlag = 'wasm'; } /// flutter command categories for usage. abstract final class FlutterCommandCategory { static const String sdk = 'Flutter SDK'; static const String project = 'Project'; static const String tools = 'Tools & Devices'; } abstract class FlutterCommand extends Command<void> { /// The currently executing command (or sub-command). /// /// Will be `null` until the top-most command has begun execution. static FlutterCommand? get current => context.get<FlutterCommand>(); /// The option name for a custom VM Service port. static const String vmServicePortOption = 'vm-service-port'; /// The option name for a custom VM Service port. static const String observatoryPortOption = 'observatory-port'; /// The option name for a custom DevTools server address. static const String kDevToolsServerAddress = 'devtools-server-address'; /// The flag name for whether to launch the DevTools or not. static const String kEnableDevTools = 'devtools'; /// The flag name for whether or not to use ipv6. static const String ipv6Flag = 'ipv6'; @override ArgParser get argParser => _argParser; final ArgParser _argParser = ArgParser( usageLineLength: globals.outputPreferences.wrapText ? globals.outputPreferences.wrapColumn : null, ); @override FlutterCommandRunner? get runner => super.runner as FlutterCommandRunner?; bool _requiresPubspecYaml = false; /// Whether this command uses the 'target' option. bool _usesTargetOption = false; bool _usesPubOption = false; bool _usesPortOption = false; bool _usesIpv6Flag = false; bool _usesFatalWarnings = false; DeprecationBehavior get deprecationBehavior => DeprecationBehavior.none; bool get shouldRunPub => _usesPubOption && boolArg('pub'); bool get shouldUpdateCache => true; bool get deprecated => false; ProcessInfo get processInfo => globals.processInfo; /// When the command runs and this is true, trigger an async process to /// discover devices from discoverers that support wireless devices for an /// extended amount of time and refresh the device cache with the results. bool get refreshWirelessDevices => false; @override bool get hidden => deprecated; bool _excludeDebug = false; bool _excludeRelease = false; /// Grabs the [Analytics] instance from the global context. It is defined /// at the [FlutterCommand] level to enable any classes that extend it to /// easily reference it or overwrite as necessary. Analytics get analytics => globals.analytics; void requiresPubspecYaml() { _requiresPubspecYaml = true; } void usesWebOptions({ required bool verboseHelp }) { argParser.addMultiOption('web-header', help: 'Additional key-value pairs that will added by the web server ' 'as headers to all responses. Multiple headers can be passed by ' 'repeating "--web-header" multiple times.', valueHelp: 'X-Custom-Header=header-value', splitCommas: false, hide: !verboseHelp, ); argParser.addOption('web-hostname', defaultsTo: 'localhost', help: 'The hostname that the web sever will use to resolve an IP to serve ' 'from. The unresolved hostname is used to launch Chrome when using ' 'the chrome Device. The name "any" may also be used to serve on any ' 'IPV4 for either the Chrome or web-server device.', hide: !verboseHelp, ); argParser.addOption('web-port', help: 'The host port to serve the web application from. If not provided, the tool ' 'will select a random open port on the host.', hide: !verboseHelp, ); argParser.addOption( 'web-tls-cert-path', help: 'The certificate that host will use to serve using TLS connection. ' 'If not provided, the tool will use default http scheme.', ); argParser.addOption( 'web-tls-cert-key-path', help: 'The certificate key that host will use to authenticate cert. ' 'If not provided, the tool will use default http scheme.', ); argParser.addOption('web-server-debug-protocol', allowed: <String>['sse', 'ws'], defaultsTo: 'ws', help: 'The protocol (SSE or WebSockets) to use for the debug service proxy ' 'when using the Web Server device and Dart Debug extension. ' 'This is useful for editors/debug adapters that do not support debugging ' 'over SSE (the default protocol for Web Server/Dart Debugger extension).', hide: !verboseHelp, ); argParser.addOption('web-server-debug-backend-protocol', allowed: <String>['sse', 'ws'], defaultsTo: 'ws', help: 'The protocol (SSE or WebSockets) to use for the Dart Debug Extension ' 'backend service when using the Web Server device. ' 'Using WebSockets can improve performance but may fail when connecting through ' 'some proxy servers.', hide: !verboseHelp, ); argParser.addOption('web-server-debug-injected-client-protocol', allowed: <String>['sse', 'ws'], defaultsTo: 'ws', help: 'The protocol (SSE or WebSockets) to use for the injected client ' 'when using the Web Server device. ' 'Using WebSockets can improve performance but may fail when connecting through ' 'some proxy servers.', hide: !verboseHelp, ); argParser.addFlag('web-allow-expose-url', help: 'Enables daemon-to-editor requests (app.exposeUrl) for exposing URLs ' 'when running on remote machines.', hide: !verboseHelp, ); argParser.addFlag('web-run-headless', help: 'Launches the browser in headless mode. Currently only Chrome ' 'supports this option.', hide: !verboseHelp, ); argParser.addOption('web-browser-debug-port', help: 'The debug port the browser should use. If not specified, a ' 'random port is selected. Currently only Chrome supports this option. ' 'It serves the Chrome DevTools Protocol ' '(https://chromedevtools.github.io/devtools-protocol/).', hide: !verboseHelp, ); argParser.addFlag('web-enable-expression-evaluation', defaultsTo: true, help: 'Enables expression evaluation in the debugger.', hide: !verboseHelp, ); argParser.addOption('web-launch-url', help: 'The URL to provide to the browser. Defaults to an HTTP URL with the host ' 'name of "--web-hostname", the port of "--web-port", and the path set to "/".', ); argParser.addMultiOption( FlutterOptions.kWebBrowserFlag, help: 'Additional flag to pass to a browser instance at startup.\n' 'Chrome: https://www.chromium.org/developers/how-tos/run-chromium-with-flags/\n' 'Firefox: https://wiki.mozilla.org/Firefox/CommandLineOptions\n' 'Multiple flags can be passed by repeating "--${FlutterOptions.kWebBrowserFlag}" multiple times.', valueHelp: '--foo=bar', hide: !verboseHelp, ); } void usesTargetOption() { argParser.addOption('target', abbr: 't', defaultsTo: bundle.defaultMainPath, help: 'The main entry-point file of the application, as run on the device.\n' 'If the "--target" option is omitted, but a file name is provided on ' 'the command line, then that is used instead.', valueHelp: 'path'); _usesTargetOption = true; } void usesFatalWarningsOption({ required bool verboseHelp }) { argParser.addFlag(FlutterOptions.kFatalWarnings, hide: !verboseHelp, help: 'Causes the command to fail if warnings are sent to the console ' 'during its execution.' ); _usesFatalWarnings = true; } String get targetFile { if (argResults?.wasParsed('target') ?? false) { return stringArg('target')!; } final List<String>? rest = argResults?.rest; if (rest != null && rest.isNotEmpty) { return rest.first; } return bundle.defaultMainPath; } /// Indicates if the current command running has a terminal attached. bool get hasTerminal => globals.stdio.hasTerminal; /// Path to the Dart's package config file. /// /// This can be overridden by some of its subclasses. String? get packagesPath => stringArg(FlutterGlobalOptions.kPackagesOption, global: true); /// Whether flutter is being run from our CI. bool get usingCISystem => boolArg(FlutterGlobalOptions.kContinuousIntegrationFlag, global: true); String? get debugLogsDirectoryPath => stringArg(FlutterGlobalOptions.kDebugLogsDirectoryFlag, global: true); /// The value of the `--filesystem-scheme` argument. /// /// This can be overridden by some of its subclasses. String? get fileSystemScheme => argParser.options.containsKey(FlutterOptions.kFileSystemScheme) ? stringArg(FlutterOptions.kFileSystemScheme) : null; /// The values of the `--filesystem-root` argument. /// /// This can be overridden by some of its subclasses. List<String>? get fileSystemRoots => argParser.options.containsKey(FlutterOptions.kFileSystemRoot) ? stringsArg(FlutterOptions.kFileSystemRoot) : null; void usesPubOption({bool hide = false}) { argParser.addFlag('pub', defaultsTo: true, hide: hide, help: 'Whether to run "flutter pub get" before executing this command.'); _usesPubOption = true; } /// Adds flags for using a specific filesystem root and scheme. /// /// The `hide` argument indicates whether or not to hide these options when /// the user asks for help. void usesFilesystemOptions({ required bool hide }) { argParser ..addOption('output-dill', hide: hide, help: 'Specify the path to frontend server output kernel file.', ) ..addMultiOption(FlutterOptions.kFileSystemRoot, hide: hide, help: 'Specify the path that is used as the root of a virtual file system ' 'during compilation. The input file name should be specified as a URL ' 'using the scheme given in "--${FlutterOptions.kFileSystemScheme}".\n' 'Requires the "--output-dill" option to be explicitly specified.', ) ..addOption(FlutterOptions.kFileSystemScheme, defaultsTo: 'org-dartlang-root', hide: hide, help: 'Specify the scheme that is used for virtual file system used in ' 'compilation. See also the "--${FlutterOptions.kFileSystemRoot}" option.', ); } /// Adds options for connecting to the Dart VM Service port. void usesPortOptions({ required bool verboseHelp }) { argParser.addOption(vmServicePortOption, help: '(deprecated; use host-vmservice-port instead) ' 'Listen to the given port for a Dart VM Service connection.\n' 'Specifying port 0 (the default) will find a random free port.\n ' 'if the Dart Development Service (DDS) is enabled, this will not be the port ' 'of the VmService instance advertised on the command line.', hide: !verboseHelp, ); argParser.addOption(observatoryPortOption, help: '(deprecated; use host-vmservice-port instead) ' 'Listen to the given port for a Dart VM Service connection.\n' 'Specifying port 0 (the default) will find a random free port.\n ' 'if the Dart Development Service (DDS) is enabled, this will not be the port ' 'of the VmService instance advertised on the command line.', hide: !verboseHelp, ); argParser.addOption('device-vmservice-port', help: 'Look for vmservice connections only from the specified port.\n' 'Specifying port 0 (the default) will accept the first vmservice ' 'discovered.', ); argParser.addOption('host-vmservice-port', help: 'When a device-side vmservice port is forwarded to a host-side ' 'port, use this value as the host port.\nSpecifying port 0 ' '(the default) will find a random free host port.' ); _usesPortOption = true; } /// Add option values for output directory of artifacts void usesOutputDir() { // TODO(eliasyishak): this feature has been added to [BuildWebCommand] and // [BuildAarCommand] argParser.addOption('output', abbr: 'o', aliases: <String>['output-dir'], help: 'The absolute path to the directory where the repository is generated. ' 'By default, this is <current-directory>/build/<target-platform>.\n' 'Currently supported for subcommands: aar, web.'); } void addDevToolsOptions({required bool verboseHelp}) { argParser.addFlag( kEnableDevTools, hide: !verboseHelp, defaultsTo: true, help: 'Enable (or disable, with "--no-$kEnableDevTools") the launching of the ' 'Flutter DevTools debugger and profiler. ' 'If specified, "--$kDevToolsServerAddress" is ignored.' ); argParser.addOption( kDevToolsServerAddress, hide: !verboseHelp, help: 'When this value is provided, the Flutter tool will not spin up a ' 'new DevTools server instance, and will instead use the one provided ' 'at the given address. Ignored if "--no-$kEnableDevTools" is specified.' ); } void addDdsOptions({required bool verboseHelp}) { argParser.addOption('dds-port', help: 'When this value is provided, the Dart Development Service (DDS) will be ' 'bound to the provided port.\n' 'Specifying port 0 (the default) will find a random free port.' ); argParser.addFlag( 'dds', hide: !verboseHelp, defaultsTo: true, help: 'Enable the Dart Developer Service (DDS).\n' 'It may be necessary to disable this when attaching to an application with ' 'an existing DDS instance (e.g., attaching to an application currently ' 'connected to by "flutter run"), or when running certain tests.\n' 'Disabling this feature may degrade IDE functionality if a DDS instance is ' 'not already connected to the target application.' ); argParser.addFlag( 'disable-dds', hide: !verboseHelp, help: '(deprecated; use "--no-dds" instead) ' 'Disable the Dart Developer Service (DDS).' ); } void addServeObservatoryOptions({required bool verboseHelp}) { argParser.addFlag('serve-observatory', hide: !verboseHelp, help: 'Serve the legacy Observatory developer tooling through the VM service.', ); } late final bool enableDds = () { bool ddsEnabled = false; if (argResults?.wasParsed('disable-dds') ?? false) { if (argResults?.wasParsed('dds') ?? false) { throwToolExit( 'The "--[no-]dds" and "--[no-]disable-dds" arguments are mutually exclusive. Only specify "--[no-]dds".'); } ddsEnabled = !boolArg('disable-dds'); // TODO(ianh): enable the following code once google3 is migrated away from --disable-dds (and add test to flutter_command_test.dart) if (false) { // ignore: dead_code, literal_only_boolean_expressions if (ddsEnabled) { globals.printWarning('${globals.logger.terminal .warningMark} The "--no-disable-dds" argument is deprecated and redundant, and should be omitted.'); } else { globals.printWarning('${globals.logger.terminal .warningMark} The "--disable-dds" argument is deprecated. Use "--no-dds" instead.'); } } } else { ddsEnabled = boolArg('dds'); } return ddsEnabled; }(); bool get _hostVmServicePortProvided => (argResults?.wasParsed(vmServicePortOption) ?? false) || (argResults?.wasParsed(observatoryPortOption) ?? false) || (argResults?.wasParsed('host-vmservice-port') ?? false); int _tryParseHostVmservicePort() { final String? vmServicePort = stringArg(vmServicePortOption) ?? stringArg(observatoryPortOption); final String? hostPort = stringArg('host-vmservice-port'); if (vmServicePort == null && hostPort == null) { throwToolExit('Invalid port for `--vm-service-port/--host-vmservice-port`'); } try { return int.parse((vmServicePort ?? hostPort)!); } on FormatException catch (error) { throwToolExit('Invalid port for `--vm-service-port/--host-vmservice-port`: $error'); } } int get ddsPort { if (argResults?.wasParsed('dds-port') != true && _hostVmServicePortProvided) { // If an explicit DDS port is _not_ provided, use the host-vmservice-port for DDS. return _tryParseHostVmservicePort(); } else if (argResults?.wasParsed('dds-port') ?? false) { // If an explicit DDS port is provided, use dds-port for DDS. return int.tryParse(stringArg('dds-port')!) ?? 0; } // Otherwise, DDS can bind to a random port. return 0; } Uri? get devToolsServerAddress { if (argResults?.wasParsed(kDevToolsServerAddress) ?? false) { final Uri? uri = Uri.tryParse(stringArg(kDevToolsServerAddress)!); if (uri != null && uri.host.isNotEmpty && uri.port != 0) { return uri; } } return null; } /// Gets the vmservice port provided to in the 'vm-service-port' or /// 'host-vmservice-port option. /// /// Only one of "host-vmservice-port" and "vm-service-port" may be /// specified. /// /// If no port is set, returns null. int? get hostVmservicePort { if (!_usesPortOption || !_hostVmServicePortProvided) { return null; } if ((argResults?.wasParsed(vmServicePortOption) ?? false) && (argResults?.wasParsed(observatoryPortOption) ?? false) && (argResults?.wasParsed('host-vmservice-port') ?? false)) { throwToolExit('Only one of "--vm-service-port" and ' '"--host-vmservice-port" may be specified.'); } // If DDS is enabled and no explicit DDS port is provided, use the // host-vmservice-port for DDS instead and bind the VM service to a random // port. if (enableDds && argResults?.wasParsed('dds-port') != true) { return null; } return _tryParseHostVmservicePort(); } /// Gets the vmservice port provided to in the 'device-vmservice-port' option. /// /// If no port is set, returns null. int? get deviceVmservicePort { final String? devicePort = stringArg('device-vmservice-port'); if (!_usesPortOption || devicePort == null) { return null; } try { return int.parse(devicePort); } on FormatException catch (error) { throwToolExit('Invalid port for `--device-vmservice-port`: $error'); } } void addPublishPort({ bool enabledByDefault = true, bool verboseHelp = false }) { argParser.addFlag('publish-port', hide: !verboseHelp, help: 'Publish the VM service port over mDNS. Disable to prevent the ' 'local network permission app dialog in debug and profile build modes (iOS devices only).', defaultsTo: enabledByDefault, ); } Future<bool> get disablePortPublication async => !boolArg('publish-port'); void usesIpv6Flag({required bool verboseHelp}) { argParser.addFlag(ipv6Flag, negatable: false, help: 'Binds to IPv6 localhost instead of IPv4 when the flutter tool ' 'forwards the host port to a device port.', hide: !verboseHelp, ); _usesIpv6Flag = true; } bool? get ipv6 => _usesIpv6Flag ? boolArg('ipv6') : null; void usesBuildNumberOption() { argParser.addOption('build-number', help: 'An identifier used as an internal version number.\n' 'Each build must have a unique identifier to differentiate it from previous builds.\n' 'It is used to determine whether one build is more recent than another, with higher numbers indicating more recent build.\n' 'On Android it is used as "versionCode".\n' 'On Xcode builds it is used as "CFBundleVersion".\n' 'On Windows it is used as the build suffix for the product and file versions.', ); } void usesBuildNameOption() { argParser.addOption('build-name', help: 'A "x.y.z" string used as the version number shown to users.\n' 'For each new version of your app, you will provide a version number to differentiate it from previous versions.\n' 'On Android it is used as "versionName".\n' 'On Xcode builds it is used as "CFBundleShortVersionString".\n' 'On Windows it is used as the major, minor, and patch parts of the product and file versions.', valueHelp: 'x.y.z'); } void usesDartDefineOption() { argParser.addMultiOption( FlutterOptions.kDartDefinesOption, aliases: <String>[ kDartDefines ], // supported for historical reasons help: 'Additional key-value pairs that will be available as constants ' 'from the String.fromEnvironment, bool.fromEnvironment, and int.fromEnvironment ' 'constructors.\n' 'Multiple defines can be passed by repeating "--${FlutterOptions.kDartDefinesOption}" multiple times.', valueHelp: 'foo=bar', splitCommas: false, ); _usesDartDefineFromFileOption(); } void _usesDartDefineFromFileOption() { argParser.addMultiOption( FlutterOptions.kDartDefineFromFileOption, help: 'The path of a .json or .env file containing key-value pairs that will be available as environment variables.\n' 'These can be accessed using the String.fromEnvironment, bool.fromEnvironment, and int.fromEnvironment constructors.\n' 'Multiple defines can be passed by repeating "--${FlutterOptions.kDartDefineFromFileOption}" multiple times.\n' 'Entries from "--${FlutterOptions.kDartDefinesOption}" with identical keys take precedence over entries from these files.', valueHelp: 'use-define-config.json|.env', splitCommas: false, ); } void usesWebRendererOption() { argParser.addOption( FlutterOptions.kWebRendererFlag, defaultsTo: WebRendererMode.auto.name, allowed: WebRendererMode.values.map((WebRendererMode e) => e.name), help: 'The renderer implementation to use when building for the web.', allowedHelp: CliEnum.allowedHelp(WebRendererMode.values) ); } void usesWebResourcesCdnFlag() { argParser.addFlag( FlutterOptions.kWebResourcesCdnFlag, defaultsTo: true, help: 'Use Web static resources hosted on a CDN.', ); } void usesDeviceUserOption() { argParser.addOption(FlutterOptions.kDeviceUser, help: 'Identifier number for a user or work profile on Android only. Run "adb shell pm list users" for available identifiers.', valueHelp: '10'); } void usesDeviceTimeoutOption() { argParser.addOption( FlutterOptions.kDeviceTimeout, help: 'Time in seconds to wait for devices to attach. Longer timeouts may be necessary for networked devices.', valueHelp: '10' ); } void usesDeviceConnectionOption() { argParser.addOption(FlutterOptions.kDeviceConnection, defaultsTo: 'both', help: 'Discover devices based on connection type.', allowed: <String>['attached', 'wireless', 'both'], allowedHelp: <String, String>{ 'both': 'Searches for both attached and wireless devices.', 'attached': 'Only searches for devices connected by USB or built-in (such as simulators/emulators, MacOS/Windows, Chrome)', 'wireless': 'Only searches for devices connected wirelessly. Discovering wireless devices may take longer.' }, ); } void usesApplicationBinaryOption() { argParser.addOption( FlutterOptions.kUseApplicationBinary, help: 'Specify a pre-built application binary to use when running. For Android applications, ' 'this must be the path to an APK. For iOS applications, the path to an IPA. Other device types ' 'do not yet support prebuilt application binaries.', valueHelp: 'path/to/app.apk', ); } /// Whether it is safe for this command to use a cached pub invocation. bool get cachePubGet => true; /// Whether this command should report null safety analytics. bool get reportNullSafety => false; late final Duration? deviceDiscoveryTimeout = () { if ((argResults?.options.contains(FlutterOptions.kDeviceTimeout) ?? false) && (argResults?.wasParsed(FlutterOptions.kDeviceTimeout) ?? false)) { final int? timeoutSeconds = int.tryParse(stringArg(FlutterOptions.kDeviceTimeout)!); if (timeoutSeconds == null) { throwToolExit( 'Could not parse "--${FlutterOptions.kDeviceTimeout}" argument. It must be an integer.'); } return Duration(seconds: timeoutSeconds); } return null; }(); DeviceConnectionInterface? get deviceConnectionInterface { if ((argResults?.options.contains(FlutterOptions.kDeviceConnection) ?? false) && (argResults?.wasParsed(FlutterOptions.kDeviceConnection) ?? false)) { final String? connectionType = stringArg(FlutterOptions.kDeviceConnection); if (connectionType == 'attached') { return DeviceConnectionInterface.attached; } else if (connectionType == 'wireless') { return DeviceConnectionInterface.wireless; } } return null; } late final TargetDevices _targetDevices = TargetDevices( platform: globals.platform, deviceManager: globals.deviceManager!, logger: globals.logger, deviceConnectionInterface: deviceConnectionInterface, ); void addBuildModeFlags({ required bool verboseHelp, bool defaultToRelease = true, bool excludeDebug = false, bool excludeRelease = false, }) { // A release build must be the default if a debug build is not possible. assert(defaultToRelease || !excludeDebug); _excludeDebug = excludeDebug; _excludeRelease = excludeRelease; defaultBuildMode = defaultToRelease ? BuildMode.release : BuildMode.debug; if (!excludeDebug) { argParser.addFlag('debug', negatable: false, help: 'Build a debug version of your app${defaultToRelease ? '' : ' (default mode)'}.'); } argParser.addFlag('profile', negatable: false, help: 'Build a version of your app specialized for performance profiling.'); if (!excludeRelease) { argParser.addFlag('release', negatable: false, help: 'Build a release version of your app${defaultToRelease ? ' (default mode)' : ''}.'); argParser.addFlag('jit-release', negatable: false, hide: !verboseHelp, help: 'Build a JIT release version of your app${defaultToRelease ? ' (default mode)' : ''}.'); } } void addSplitDebugInfoOption() { argParser.addOption(FlutterOptions.kSplitDebugInfoOption, help: 'In a release build, this flag reduces application size by storing ' 'Dart program symbols in a separate file on the host rather than in the ' 'application. The value of the flag should be a directory where program ' 'symbol files can be stored for later use. These symbol files contain ' 'the information needed to symbolize Dart stack traces. For an app built ' 'with this flag, the "flutter symbolize" command with the right program ' 'symbol file is required to obtain a human readable stack trace.\n' 'This flag cannot be combined with "--${FlutterOptions.kAnalyzeSize}".', valueHelp: 'v1.2.3/', ); } void addDartObfuscationOption() { argParser.addFlag(FlutterOptions.kDartObfuscationOption, help: 'In a release build, this flag removes identifiers and replaces them ' 'with randomized values for the purposes of source code obfuscation. This ' 'flag must always be combined with "--${FlutterOptions.kSplitDebugInfoOption}" option, the ' 'mapping between the values and the original identifiers is stored in the ' 'symbol map created in the specified directory. For an app built with this ' 'flag, the "flutter symbolize" command with the right program ' 'symbol file is required to obtain a human readable stack trace.\n' '\n' 'Because all identifiers are renamed, methods like Object.runtimeType, ' 'Type.toString, Enum.toString, Stacktrace.toString, Symbol.toString ' '(for constant symbols or those generated by runtime system) will ' 'return obfuscated results. Any code or tests that rely on exact names ' 'will break.' ); } void addBundleSkSLPathOption({ required bool hide }) { argParser.addOption(FlutterOptions.kBundleSkSLPathOption, help: 'A path to a file containing precompiled SkSL shaders generated ' 'during "flutter run". These can be included in an application to ' 'improve the first frame render times.', hide: hide, valueHelp: 'flutter_1.sksl' ); } void addTreeShakeIconsFlag({ bool? enabledByDefault }) { argParser.addFlag('tree-shake-icons', defaultsTo: enabledByDefault ?? kIconTreeShakerEnabledDefault, help: 'Tree shake icon fonts so that only glyphs used by the application remain.', ); } void addShrinkingFlag({ required bool verboseHelp }) { argParser.addFlag('shrink', hide: !verboseHelp, help: 'This flag has no effect. Code shrinking is always enabled in release builds. ' 'To learn more, see: https://developer.android.com/studio/build/shrink-code' ); } void addNullSafetyModeOptions({ required bool hide }) { argParser.addFlag(FlutterOptions.kNullSafety, help: 'This flag is deprecated as only null-safe code is supported.', defaultsTo: true, hide: true, ); argParser.addFlag(FlutterOptions.kNullAssertions, help: 'This flag is deprecated as only null-safe code is supported.', hide: true, ); } void usesFrontendServerStarterPathOption({required bool verboseHelp}) { argParser.addOption( FlutterOptions.kFrontendServerStarterPath, help: 'When this value is provided, the frontend server will be started ' 'in JIT mode from the specified file, instead of from the AOT ' 'snapshot shipped with the Dart SDK. The specified file can either ' 'be a Dart source file, or an AppJIT snapshot. This option does ' 'not affect web builds.', hide: !verboseHelp, ); } /// Enables support for the hidden options --extra-front-end-options and /// --extra-gen-snapshot-options. void usesExtraDartFlagOptions({ required bool verboseHelp }) { argParser.addMultiOption(FlutterOptions.kExtraFrontEndOptions, aliases: <String>[ kExtraFrontEndOptions ], // supported for historical reasons help: 'A comma-separated list of additional command line arguments that will be passed directly to the Dart front end. ' 'For example, "--${FlutterOptions.kExtraFrontEndOptions}=--enable-experiment=nonfunction-type-aliases".', valueHelp: '--foo,--bar', hide: !verboseHelp, ); argParser.addMultiOption(FlutterOptions.kExtraGenSnapshotOptions, aliases: <String>[ kExtraGenSnapshotOptions ], // supported for historical reasons help: 'A comma-separated list of additional command line arguments that will be passed directly to the Dart native compiler. ' '(Only used in "--profile" or "--release" builds.) ' 'For example, "--${FlutterOptions.kExtraGenSnapshotOptions}=--no-strip".', valueHelp: '--foo,--bar', hide: !verboseHelp, ); } void usesFuchsiaOptions({ bool hide = false }) { argParser.addOption( 'target-model', help: 'Target model that determines what core libraries are available.', defaultsTo: 'flutter', hide: hide, allowed: const <String>['flutter', 'flutter_runner'], ); argParser.addOption( 'module', abbr: 'm', hide: hide, help: 'The name of the module (required if attaching to a fuchsia device).', valueHelp: 'module-name', ); } void addEnableExperimentation({ required bool hide }) { argParser.addMultiOption( FlutterOptions.kEnableExperiment, help: 'The name of an experimental Dart feature to enable. For more information see: ' 'https://github.com/dart-lang/sdk/blob/main/docs/process/experimental-flags.md', hide: hide, ); } void addBuildPerformanceFile({ bool hide = false }) { argParser.addOption( FlutterOptions.kPerformanceMeasurementFile, help: 'The name of a file where flutter assemble performance and ' 'cached-ness information will be written in a JSON format.', hide: hide, ); } void addAndroidSpecificBuildOptions({ bool hide = false }) { argParser.addFlag( FlutterOptions.kAndroidGradleDaemon, help: 'Whether to enable the Gradle daemon when performing an Android build. ' 'Starting the daemon is the default behavior of the gradle wrapper script created ' 'in a Flutter project. Setting this flag to false corresponds to passing ' '"--no-daemon" to the gradle wrapper script. This flag will cause the daemon ' 'process to terminate after the build is completed.', defaultsTo: true, hide: hide, ); argParser.addFlag( FlutterOptions.kAndroidSkipBuildDependencyValidation, help: 'Whether to skip version checking for Java, Gradle, ' 'the Android Gradle Plugin (AGP), and the Kotlin Gradle Plugin (KGP)' ' during Android builds.', ); argParser.addMultiOption( FlutterOptions.kAndroidProjectArgs, help: 'Additional arguments specified as key=value that are passed directly to the gradle ' 'project via the -P flag. These can be accessed in build.gradle via the "project.property" API.', splitCommas: false, abbr: 'P', ); } void addNativeNullAssertions({ bool hide = false }) { argParser.addFlag('native-null-assertions', defaultsTo: true, hide: hide, help: 'Enables additional runtime null checks in web applications to ensure ' 'the correct nullability of native (such as in dart:html) and external ' '(such as with JS interop) types. This is enabled by default but only takes ' 'effect in sound mode. To report an issue with a null assertion failure in ' 'dart:html or the other dart web libraries, please file a bug at: ' 'https://github.com/dart-lang/sdk/issues/labels/web-libraries' ); } void usesInitializeFromDillOption({ required bool hide }) { argParser.addOption(FlutterOptions.kInitializeFromDill, help: 'Initializes the resident compiler with a specific kernel file instead of ' 'the default cached location.', hide: hide, ); argParser.addFlag(FlutterOptions.kAssumeInitializeFromDillUpToDate, help: 'If set, assumes that the file passed in initialize-from-dill is up ' 'to date and skip the check and potential invalidation of files.', hide: hide, ); } void usesNativeAssetsOption({ required bool hide }) { argParser.addOption(FlutterOptions.kNativeAssetsYamlFile, help: 'Initializes the resident compiler with a custom native assets ' 'yaml file instead of the default cached location.', hide: hide, ); } void addIgnoreDeprecationOption({ bool hide = false }) { argParser.addFlag('ignore-deprecation', negatable: false, help: 'Indicates that the app should ignore deprecation warnings and continue to build ' 'using deprecated APIs. Use of this flag may cause your app to fail to build when ' 'deprecated APIs are removed.', ); } /// Adds build options common to all of the desktop build commands. void addCommonDesktopBuildOptions({ required bool verboseHelp }) { addBuildModeFlags(verboseHelp: verboseHelp); addBuildPerformanceFile(hide: !verboseHelp); addBundleSkSLPathOption(hide: !verboseHelp); addDartObfuscationOption(); addEnableExperimentation(hide: !verboseHelp); addNullSafetyModeOptions(hide: !verboseHelp); addSplitDebugInfoOption(); addTreeShakeIconsFlag(); usesAnalyzeSizeFlag(); usesDartDefineOption(); usesExtraDartFlagOptions(verboseHelp: verboseHelp); usesPubOption(); usesTargetOption(); usesTrackWidgetCreation(verboseHelp: verboseHelp); usesBuildNumberOption(); usesBuildNameOption(); } /// The build mode that this command will use if no build mode is /// explicitly specified. /// /// Use [getBuildMode] to obtain the actual effective build mode. BuildMode defaultBuildMode = BuildMode.debug; BuildMode getBuildMode() { // No debug when _excludeDebug is true. // If debug is not excluded, then take the command line flag. final bool debugResult = !_excludeDebug && boolArg('debug'); final bool jitReleaseResult = !_excludeRelease && boolArg('jit-release'); final bool releaseResult = !_excludeRelease && boolArg('release'); final List<bool> modeFlags = <bool>[ debugResult, jitReleaseResult, boolArg('profile'), releaseResult, ]; if (modeFlags.where((bool flag) => flag).length > 1) { throw UsageException('Only one of "--debug", "--profile", "--jit-release", ' 'or "--release" can be specified.', ''); } if (debugResult) { return BuildMode.debug; } if (boolArg('profile')) { return BuildMode.profile; } if (releaseResult) { return BuildMode.release; } if (jitReleaseResult) { return BuildMode.jitRelease; } return defaultBuildMode; } void usesFlavorOption() { argParser.addOption( 'flavor', help: 'Build a custom app flavor as defined by platform-specific build setup.\n' 'Supports the use of product flavors in Android Gradle scripts, and ' 'the use of custom Xcode schemes.', ); } void usesTrackWidgetCreation({ bool hasEffect = true, required bool verboseHelp }) { argParser.addFlag( 'track-widget-creation', hide: !hasEffect && !verboseHelp, defaultsTo: true, help: 'Track widget creation locations. This enables features such as the widget inspector. ' 'This parameter is only functional in debug mode (i.e. when compiling JIT, not AOT).', ); } void usesAnalyzeSizeFlag() { argParser.addFlag( FlutterOptions.kAnalyzeSize, help: 'Whether to produce additional profile information for artifact output size. ' 'This flag is only supported on "--release" builds. When building for Android, a single ' 'ABI must be specified at a time with the "--target-platform" flag. When building for iOS, ' 'only the symbols from the arm64 architecture are used to analyze code size.\n' 'By default, the intermediate output files will be placed in a transient directory in the ' 'build directory. This can be overridden with the "--${FlutterOptions.kCodeSizeDirectory}" option.\n' 'This flag cannot be combined with "--${FlutterOptions.kSplitDebugInfoOption}".' ); argParser.addOption( FlutterOptions.kCodeSizeDirectory, help: 'The location to write code size analysis files. If this is not specified, files ' 'are written to a temporary directory under the build directory.' ); } void addEnableImpellerFlag({required bool verboseHelp}) { argParser.addFlag('enable-impeller', hide: !verboseHelp, defaultsTo: null, help: 'Whether to enable the Impeller rendering engine. ' 'Impeller is the default renderer on iOS. On Android, Impeller ' 'is available but not the default. This flag will cause Impeller ' 'to be used on Android. On other platforms, this flag will be ' 'ignored.', ); } void addEnableVulkanValidationFlag({required bool verboseHelp}) { argParser.addFlag('enable-vulkan-validation', hide: !verboseHelp, help: 'Enable vulkan validation on the Impeller rendering backend if ' 'Vulkan is in use and the validation layers are available to the ' 'application.', ); } void addEnableEmbedderApiFlag({required bool verboseHelp}) { argParser.addFlag('enable-embedder-api', hide: !verboseHelp, help: 'Whether to enable the experimental embedder API on iOS.', ); } /// Compute the [BuildInfo] for the current flutter command. /// Commands that build multiple build modes can pass in a [forcedBuildMode] /// to be used instead of parsing flags. /// /// Throws a [ToolExit] if the current set of options is not compatible with /// each other. Future<BuildInfo> getBuildInfo({ BuildMode? forcedBuildMode, File? forcedTargetFile }) async { final bool trackWidgetCreation = argParser.options.containsKey('track-widget-creation') && boolArg('track-widget-creation'); final String? buildNumber = argParser.options.containsKey('build-number') ? stringArg('build-number') : null; final File packagesFile = globals.fs.file( packagesPath ?? globals.fs.path.absolute('.dart_tool', 'package_config.json')); final PackageConfig packageConfig = await loadPackageConfigWithLogging( packagesFile, logger: globals.logger, throwOnError: false); final List<String> experiments = argParser.options.containsKey(FlutterOptions.kEnableExperiment) ? stringsArg(FlutterOptions.kEnableExperiment).toList() : <String>[]; final List<String> extraGenSnapshotOptions = argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions) ? stringsArg(FlutterOptions.kExtraGenSnapshotOptions).toList() : <String>[]; final List<String> extraFrontEndOptions = argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions) ? stringsArg(FlutterOptions.kExtraFrontEndOptions).toList() : <String>[]; if (experiments.isNotEmpty) { for (final String expFlag in experiments) { final String flag = '--enable-experiment=$expFlag'; extraFrontEndOptions.add(flag); extraGenSnapshotOptions.add(flag); } } String? codeSizeDirectory; if (argParser.options.containsKey(FlutterOptions.kAnalyzeSize) && boolArg(FlutterOptions.kAnalyzeSize)) { Directory directory = globals.fsUtils.getUniqueDirectory( globals.fs.directory(getBuildDirectory()), 'flutter_size', ); if (argParser.options.containsKey(FlutterOptions.kCodeSizeDirectory) && stringArg(FlutterOptions.kCodeSizeDirectory) != null) { directory = globals.fs.directory(stringArg(FlutterOptions.kCodeSizeDirectory)); } directory.createSync(recursive: true); codeSizeDirectory = directory.path; } NullSafetyMode nullSafetyMode = NullSafetyMode.sound; if (argParser.options.containsKey(FlutterOptions.kNullSafety)) { final bool wasNullSafetyFlagParsed = argResults?.wasParsed(FlutterOptions.kNullSafety) ?? false; // Extra frontend options are only provided if explicitly // requested. if (wasNullSafetyFlagParsed) { if (boolArg(FlutterOptions.kNullSafety)) { nullSafetyMode = NullSafetyMode.sound; extraFrontEndOptions.add('--sound-null-safety'); } else { nullSafetyMode = NullSafetyMode.unsound; extraFrontEndOptions.add('--no-sound-null-safety'); } } } final bool dartObfuscation = argParser.options.containsKey(FlutterOptions.kDartObfuscationOption) && boolArg(FlutterOptions.kDartObfuscationOption); final String? splitDebugInfoPath = argParser.options.containsKey(FlutterOptions.kSplitDebugInfoOption) ? stringArg(FlutterOptions.kSplitDebugInfoOption) : null; final bool androidGradleDaemon = !argParser.options.containsKey(FlutterOptions.kAndroidGradleDaemon) || boolArg(FlutterOptions.kAndroidGradleDaemon); final bool androidSkipBuildDependencyValidation = !argParser.options.containsKey(FlutterOptions.kAndroidSkipBuildDependencyValidation) || boolArg(FlutterOptions.kAndroidSkipBuildDependencyValidation); final List<String> androidProjectArgs = argParser.options.containsKey(FlutterOptions.kAndroidProjectArgs) ? stringsArg(FlutterOptions.kAndroidProjectArgs) : <String>[]; if (dartObfuscation && (splitDebugInfoPath == null || splitDebugInfoPath.isEmpty)) { throwToolExit( '"--${FlutterOptions.kDartObfuscationOption}" can only be used in ' 'combination with "--${FlutterOptions.kSplitDebugInfoOption}"', ); } final BuildMode buildMode = forcedBuildMode ?? getBuildMode(); if (buildMode != BuildMode.release && codeSizeDirectory != null) { throwToolExit('"--${FlutterOptions.kAnalyzeSize}" can only be used on release builds.'); } if (codeSizeDirectory != null && splitDebugInfoPath != null) { throwToolExit('"--${FlutterOptions.kAnalyzeSize}" cannot be combined with "--${FlutterOptions.kSplitDebugInfoOption}".'); } final bool treeShakeIcons = argParser.options.containsKey('tree-shake-icons') && buildMode.isPrecompiled && boolArg('tree-shake-icons'); final String? bundleSkSLPath = argParser.options.containsKey(FlutterOptions.kBundleSkSLPathOption) ? stringArg(FlutterOptions.kBundleSkSLPathOption) : null; if (bundleSkSLPath != null && !globals.fs.isFileSync(bundleSkSLPath)) { throwToolExit('No SkSL shader bundle found at $bundleSkSLPath.'); } final String? performanceMeasurementFile = argParser.options.containsKey(FlutterOptions.kPerformanceMeasurementFile) ? stringArg(FlutterOptions.kPerformanceMeasurementFile) : null; final Map<String, Object?> defineConfigJsonMap = extractDartDefineConfigJsonMap(); final List<String> dartDefines = extractDartDefines(defineConfigJsonMap: defineConfigJsonMap); if (argParser.options.containsKey(FlutterOptions.kWebResourcesCdnFlag)) { final bool hasLocalWebSdk = argParser.options.containsKey('local-web-sdk') && stringArg('local-web-sdk') != null; if (boolArg(FlutterOptions.kWebResourcesCdnFlag) && !hasLocalWebSdk) { if (!dartDefines.any((String define) => define.startsWith('FLUTTER_WEB_CANVASKIT_URL='))) { dartDefines.add('FLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/${globals.flutterVersion.engineRevision}/'); } } } final String? flavor = argParser.options.containsKey('flavor') ? stringArg('flavor') : null; if (flavor != null) { if (globals.platform.environment['FLUTTER_APP_FLAVOR'] != null) { throwToolExit('FLUTTER_APP_FLAVOR is used by the framework and cannot be set in the environment.'); } if (dartDefines.any((String define) => define.startsWith('FLUTTER_APP_FLAVOR'))) { throwToolExit('FLUTTER_APP_FLAVOR is used by the framework and cannot be ' 'set using --${FlutterOptions.kDartDefinesOption} or --${FlutterOptions.kDartDefineFromFileOption}'); } dartDefines.add('FLUTTER_APP_FLAVOR=$flavor'); } return BuildInfo(buildMode, flavor, trackWidgetCreation: trackWidgetCreation, frontendServerStarterPath: argParser.options .containsKey(FlutterOptions.kFrontendServerStarterPath) ? stringArg(FlutterOptions.kFrontendServerStarterPath) : null, extraFrontEndOptions: extraFrontEndOptions.isNotEmpty ? extraFrontEndOptions : null, extraGenSnapshotOptions: extraGenSnapshotOptions.isNotEmpty ? extraGenSnapshotOptions : null, fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme, buildNumber: buildNumber, buildName: argParser.options.containsKey('build-name') ? stringArg('build-name') : null, treeShakeIcons: treeShakeIcons, splitDebugInfoPath: splitDebugInfoPath, dartObfuscation: dartObfuscation, dartDefines: dartDefines, bundleSkSLPath: bundleSkSLPath, dartExperiments: experiments, performanceMeasurementFile: performanceMeasurementFile, packagesPath: packagesPath ?? globals.fs.path.absolute('.dart_tool', 'package_config.json'), nullSafetyMode: nullSafetyMode, codeSizeDirectory: codeSizeDirectory, androidGradleDaemon: androidGradleDaemon, androidSkipBuildDependencyValidation: androidSkipBuildDependencyValidation, packageConfig: packageConfig, androidProjectArgs: androidProjectArgs, initializeFromDill: argParser.options.containsKey(FlutterOptions.kInitializeFromDill) ? stringArg(FlutterOptions.kInitializeFromDill) : null, assumeInitializeFromDillUpToDate: argParser.options.containsKey(FlutterOptions.kAssumeInitializeFromDillUpToDate) && boolArg(FlutterOptions.kAssumeInitializeFromDillUpToDate), ); } void setupApplicationPackages() { applicationPackages ??= ApplicationPackageFactory.instance; } /// The path to send to Google Analytics. Return null here to disable /// tracking of the command. Future<String?> get usagePath async { if (parent is FlutterCommand) { final FlutterCommand? commandParent = parent as FlutterCommand?; final String? path = await commandParent?.usagePath; // Don't report for parents that return null for usagePath. return path == null ? null : '$path/$name'; } else { return name; } } /// Additional usage values to be sent with the usage ping. Future<CustomDimensions> get usageValues async => const CustomDimensions(); /// Additional usage values to be sent with the usage ping for /// package:unified_analytics. /// /// Implementations of [FlutterCommand] can override this getter in order /// to add additional parameters in the [Event.commandUsageValues] constructor. Future<Event> unifiedAnalyticsUsageValues(String commandPath) async => Event.commandUsageValues(workflow: commandPath, commandHasTerminal: hasTerminal); /// Runs this command. /// /// Rather than overriding this method, subclasses should override /// [verifyThenRunCommand] to perform any verification /// and [runCommand] to execute the command /// so that this method can record and report the overall time to analytics. @override Future<void> run() { final DateTime startTime = globals.systemClock.now(); return context.run<void>( name: 'command', overrides: <Type, Generator>{FlutterCommand: () => this}, body: () async { if (_usesFatalWarnings) { globals.logger.fatalWarnings = boolArg(FlutterOptions.kFatalWarnings); } // Prints the welcome message if needed. globals.flutterUsage.printWelcome(); _printDeprecationWarning(); final String? commandPath = await usagePath; if (commandPath != null) { _registerSignalHandlers(commandPath, startTime); } FlutterCommandResult commandResult = FlutterCommandResult.fail(); try { commandResult = await verifyThenRunCommand(commandPath); } finally { final DateTime endTime = globals.systemClock.now(); globals.printTrace(globals.userMessages.flutterElapsedTime(name, getElapsedAsMilliseconds(endTime.difference(startTime)))); if (commandPath != null) { _sendPostUsage( commandPath, commandResult, startTime, endTime, ); } if (_usesFatalWarnings) { globals.logger.checkForFatalLogs(); } } }, ); } @visibleForOverriding String get deprecationWarning { return '${globals.logger.terminal.warningMark} The "$name" command is ' 'deprecated and will be removed in a future version of Flutter. ' 'See https://flutter.dev/docs/development/tools/sdk/releases ' 'for previous releases of Flutter.\n'; } void _printDeprecationWarning() { if (deprecated) { globals.printWarning(deprecationWarning); } } List<String> extractDartDefines({required Map<String, Object?> defineConfigJsonMap}) { final List<String> dartDefines = <String>[]; defineConfigJsonMap.forEach((String key, Object? value) { dartDefines.add('$key=$value'); }); if (argParser.options.containsKey(FlutterOptions.kDartDefinesOption)) { dartDefines.addAll(stringsArg(FlutterOptions.kDartDefinesOption)); } return dartDefines; } Map<String, Object?> extractDartDefineConfigJsonMap() { final Map<String, Object?> dartDefineConfigJsonMap = <String, Object?>{}; if (argParser.options.containsKey(FlutterOptions.kDartDefineFromFileOption)) { final List<String> configFilePaths = stringsArg( FlutterOptions.kDartDefineFromFileOption, ); for (final String path in configFilePaths) { if (!globals.fs.isFileSync(path)) { throwToolExit('Did not find the file passed to "--${FlutterOptions .kDartDefineFromFileOption}". Path: $path'); } final String configRaw = globals.fs.file(path).readAsStringSync(); // Determine whether the file content is JSON or .env format. String configJsonRaw; if (configRaw.trim().startsWith('{')) { configJsonRaw = configRaw; } else { // Convert env file to JSON. configJsonRaw = convertEnvFileToJsonRaw(configRaw); } try { // Fix json convert Object value :type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, Object>' in type cast (json.decode(configJsonRaw) as Map<String, dynamic>) .forEach((String key, Object? value) { dartDefineConfigJsonMap[key] = value; }); } on FormatException catch (err) { throwToolExit('Unable to parse the file at path "$path" due to a formatting error. ' 'Ensure that the file contains valid JSON.\n' 'Error details: $err' ); } } } return dartDefineConfigJsonMap; } /// Parse a property line from an env file. /// Supposed property structure should be: /// key=value /// /// Where: key is a string without spaces and value is a string. /// Value can also contain '=' char. /// /// Returns a record of key and value as strings. MapEntry<String, String> _parseProperty(String line) { if (DotEnvRegex.multiLineBlock.hasMatch(line)) { throwToolExit('Multi-line value is not supported: $line'); } final Match? keyValueMatch = DotEnvRegex.keyValue.firstMatch(line); if (keyValueMatch == null) { throwToolExit('Unable to parse file provided for ' '--${FlutterOptions.kDartDefineFromFileOption}.\n' 'Invalid property line: $line'); } final String key = keyValueMatch.group(1)!; final String value = keyValueMatch.group(2) ?? ''; // Remove wrapping quotes and trailing line comment. final Match? doubleQuotedValueMatch = DotEnvRegex.doubleQuotedValue.firstMatch(value); if (doubleQuotedValueMatch != null) { return MapEntry<String, String>(key, doubleQuotedValueMatch.group(1)!); } final Match? singleQuotedValueMatch = DotEnvRegex.singleQuotedValue.firstMatch(value); if (singleQuotedValueMatch != null) { return MapEntry<String, String>(key, singleQuotedValueMatch.group(1)!); } final Match? backQuotedValueMatch = DotEnvRegex.backQuotedValue.firstMatch(value); if (backQuotedValueMatch != null) { return MapEntry<String, String>(key, backQuotedValueMatch.group(1)!); } final Match? unquotedValueMatch = DotEnvRegex.unquotedValue.firstMatch(value); if (unquotedValueMatch != null) { return MapEntry<String, String>(key, unquotedValueMatch.group(1)!); } return MapEntry<String, String>(key, value); } /// Converts an .env file string to its equivalent JSON string. /// /// For example, the .env file string /// key=value # comment /// complexKey="foo#bar=baz" /// would be converted to a JSON string equivalent to: /// { /// "key": "value", /// "complexKey": "foo#bar=baz" /// } /// /// Multiline values are not supported. String convertEnvFileToJsonRaw(String configRaw) { final List<String> lines = configRaw .split('\n') .map((String line) => line.trim()) .where((String line) => line.isNotEmpty) .where((String line) => !line.startsWith('#')) // Remove comment lines. .toList(); final Map<String, String> propertyMap = <String, String>{}; for (final String line in lines) { final MapEntry<String, String> property = _parseProperty(line); propertyMap[property.key] = property.value; } return jsonEncode(propertyMap); } Map<String, String> extractWebHeaders() { final Map<String, String> webHeaders = <String, String>{}; if (argParser.options.containsKey('web-header')) { final List<String> candidates = stringsArg('web-header'); final List<String> invalidHeaders = <String>[]; for (final String candidate in candidates) { final Match? keyValueMatch = _HttpRegex.httpHeader.firstMatch(candidate); if (keyValueMatch == null) { invalidHeaders.add(candidate); continue; } webHeaders[keyValueMatch.group(1)!] = keyValueMatch.group(2)!; } if (invalidHeaders.isNotEmpty) { throwToolExit('Invalid web headers: ${invalidHeaders.join(', ')}'); } } return webHeaders; } void _registerSignalHandlers(String commandPath, DateTime startTime) { void handler(io.ProcessSignal s) { globals.cache.releaseLock(); _sendPostUsage( commandPath, const FlutterCommandResult(ExitStatus.killed), startTime, globals.systemClock.now(), ); } globals.signals.addHandler(io.ProcessSignal.sigterm, handler); globals.signals.addHandler(io.ProcessSignal.sigint, handler); } /// Logs data about this command. /// /// For example, the command path (e.g. `build/apk`) and the result, /// as well as the time spent running it. void _sendPostUsage( String commandPath, FlutterCommandResult commandResult, DateTime startTime, DateTime endTime, ) { // Send command result. final int? maxRss = getMaxRss(processInfo); CommandResultEvent(commandPath, commandResult.toString(), maxRss).send(); analytics.send(Event.flutterCommandResult( commandPath: commandPath, result: commandResult.toString(), maxRss: maxRss, commandHasTerminal: hasTerminal, )); // Send timing. final List<String?> labels = <String?>[ commandResult.exitStatus.name, if (commandResult.timingLabelParts?.isNotEmpty ?? false) ...?commandResult.timingLabelParts, ]; final String label = labels .where((String? label) => label != null && !_isBlank(label)) .join('-'); // If the command provides its own end time, use it. Otherwise report // the duration of the entire execution. final Duration elapsedDuration = (commandResult.endTimeOverride ?? endTime).difference(startTime); globals.flutterUsage.sendTiming( 'flutter', name, elapsedDuration, // Report in the form of `success-[parameter1-parameter2]`, all of which // can be null if the command doesn't provide a FlutterCommandResult. label: label == '' ? null : label, ); analytics.send(Event.timing( workflow: 'flutter', variableName: name, elapsedMilliseconds: elapsedDuration.inMilliseconds, // Report in the form of `success-[parameter1-parameter2]`, all of which // can be null if the command doesn't provide a FlutterCommandResult. label: label == '' ? null : label, )); } /// Perform validation then call [runCommand] to execute the command. /// Return a [Future] that completes with an exit code /// indicating whether execution was successful. /// /// Subclasses should override this method to perform verification /// then call this method to execute the command /// rather than calling [runCommand] directly. @mustCallSuper Future<FlutterCommandResult> verifyThenRunCommand(String? commandPath) async { if (argParser.options.containsKey(FlutterOptions.kNullSafety) && argResults![FlutterOptions.kNullSafety] == false && globals.nonNullSafeBuilds == NonNullSafeBuilds.notAllowed) { throwToolExit(''' Could not find an option named "no-${FlutterOptions.kNullSafety}". Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options. '''); } globals.preRunValidator.validate(); if (refreshWirelessDevices) { // Loading wireless devices takes longer so start it early. _targetDevices.startExtendedWirelessDeviceDiscovery( deviceDiscoveryTimeout: deviceDiscoveryTimeout, ); } // Populate the cache. We call this before pub get below so that the // sky_engine package is available in the flutter cache for pub to find. if (shouldUpdateCache) { // First always update universal artifacts, as some of these (e.g. // ios-deploy on macOS) are required to determine `requiredArtifacts`. final bool offline; if (argParser.options.containsKey('offline')) { offline = boolArg('offline'); } else { offline = false; } await globals.cache.updateAll(<DevelopmentArtifact>{DevelopmentArtifact.universal}, offline: offline); await globals.cache.updateAll(await requiredArtifacts, offline: offline); } globals.cache.releaseLock(); await validateCommand(); final FlutterProject project = FlutterProject.current(); project.checkForDeprecation(deprecationBehavior: deprecationBehavior); if (shouldRunPub) { final Environment environment = Environment( artifacts: globals.artifacts!, logger: globals.logger, cacheDir: globals.cache.getRoot(), engineVersion: globals.flutterVersion.engineRevision, fileSystem: globals.fs, flutterRootDir: globals.fs.directory(Cache.flutterRoot), outputDir: globals.fs.directory(getBuildDirectory()), processManager: globals.processManager, platform: globals.platform, usage: globals.flutterUsage, analytics: analytics, projectDir: project.directory, generateDartPluginRegistry: true, ); await generateLocalizationsSyntheticPackage( environment: environment, buildSystem: globals.buildSystem, buildTargets: globals.buildTargets, ); await pub.get( context: PubContext.getVerifyContext(name), project: project, checkUpToDate: cachePubGet, ); // null implicitly means all plugins are allowed List<String>? allowedPlugins; if (stringArg(FlutterGlobalOptions.kDeviceIdOption, global: true) == 'preview') { // The preview device does not currently support any plugins. allowedPlugins = PreviewDevice.supportedPubPlugins; } await project.regeneratePlatformSpecificTooling(allowedPlugins: allowedPlugins); if (reportNullSafety) { await _sendNullSafetyAnalyticsEvents(project); } } setupApplicationPackages(); if (commandPath != null) { // Until the GA4 migration is complete, we will continue to send to the GA3 instance // as well as GA4. Once migration is complete, we will only make a call for GA4 values final List<Object> pairOfUsageValues = await Future.wait<Object>(<Future<Object>>[ usageValues, unifiedAnalyticsUsageValues(commandPath), ]); Usage.command(commandPath, parameters: CustomDimensions( commandHasTerminal: hasTerminal, ).merge(pairOfUsageValues[0] as CustomDimensions)); analytics.send(pairOfUsageValues[1] as Event); } return runCommand(); } Future<void> _sendNullSafetyAnalyticsEvents(FlutterProject project) async { final BuildInfo buildInfo = await getBuildInfo(); NullSafetyAnalysisEvent( buildInfo.packageConfig, buildInfo.nullSafetyMode, project.manifest.appName, globals.flutterUsage, ).send(); } /// The set of development artifacts required for this command. /// /// Defaults to an empty set. Including [DevelopmentArtifact.universal] is /// not required as it is always updated. Future<Set<DevelopmentArtifact>> get requiredArtifacts async => const <DevelopmentArtifact>{}; /// Subclasses must implement this to execute the command. /// Optionally provide a [FlutterCommandResult] to send more details about the /// execution for analytics. Future<FlutterCommandResult> runCommand(); /// Find and return all target [Device]s based upon currently connected /// devices and criteria entered by the user on the command line. /// If no device can be found that meets specified criteria, /// then print an error message and return null. Future<List<Device>?> findAllTargetDevices({ bool includeDevicesUnsupportedByProject = false, }) async { return _targetDevices.findAllTargetDevices( deviceDiscoveryTimeout: deviceDiscoveryTimeout, includeDevicesUnsupportedByProject: includeDevicesUnsupportedByProject, ); } /// Find and return the target [Device] based upon currently connected /// devices and criteria entered by the user on the command line. /// If a device cannot be found that meets specified criteria, /// then print an error message and return null. /// /// If [includeDevicesUnsupportedByProject] is true, the tool does not filter /// the list by the current project support list. Future<Device?> findTargetDevice({ bool includeDevicesUnsupportedByProject = false, }) async { List<Device>? deviceList = await findAllTargetDevices( includeDevicesUnsupportedByProject: includeDevicesUnsupportedByProject, ); if (deviceList == null) { return null; } if (deviceList.length > 1) { globals.printStatus(globals.userMessages.flutterSpecifyDevice); deviceList = await globals.deviceManager!.getAllDevices(); globals.printStatus(''); await Device.printDevices(deviceList, globals.logger); return null; } return deviceList.single; } @protected @mustCallSuper Future<void> validateCommand() async { if (_requiresPubspecYaml && globalResults?.wasParsed('packages') != true) { // Don't expect a pubspec.yaml file if the user passed in an explicit .packages file path. // If there is no pubspec in the current directory, look in the parent // until one can be found. final String? path = findProjectRoot(globals.fs, globals.fs.currentDirectory.path); if (path == null) { throwToolExit(globals.userMessages.flutterNoPubspec); } if (path != globals.fs.currentDirectory.path) { globals.fs.currentDirectory = path; globals.printStatus('Changing current working directory to: ${globals.fs.currentDirectory.path}'); } } if (_usesTargetOption) { final String targetPath = targetFile; if (!globals.fs.isFileSync(targetPath)) { throw ToolExit(globals.userMessages.flutterTargetFileMissing(targetPath)); } } } @override String get usage { final String usageWithoutDescription = super.usage.substring( // The description plus two newlines. description.length + 2, ); final String help = <String>[ if (deprecated) '${globals.logger.terminal.warningMark} Deprecated. This command will be removed in a future version of Flutter.', description, '', 'Global options:', '${runner?.argParser.usage}', '', usageWithoutDescription, ].join('\n'); return help; } ApplicationPackageFactory? applicationPackages; /// Gets the parsed command-line flag named [name] as a `bool`. /// /// If no flag named [name] was added to the [ArgParser], an [ArgumentError] /// will be thrown. bool boolArg(String name, {bool global = false}) { if (global) { return globalResults![name] as bool; } return argResults![name] as bool; } /// Gets the parsed command-line option named [name] as a `String`. /// /// If no option named [name] was added to the [ArgParser], an [ArgumentError] /// will be thrown. String? stringArg(String name, {bool global = false}) { if (global) { return globalResults![name] as String?; } return argResults![name] as String?; } /// Gets the parsed command-line option named [name] as `List<String>`. List<String> stringsArg(String name, {bool global = false}) { if (global) { return globalResults![name] as List<String>; } return argResults![name] as List<String>; } } /// A mixin which applies an implementation of [requiredArtifacts] that only /// downloads artifacts corresponding to potentially connected devices. mixin DeviceBasedDevelopmentArtifacts on FlutterCommand { @override Future<Set<DevelopmentArtifact>> get requiredArtifacts async { // If there are no devices, use the default configuration. // Otherwise, only add development artifacts corresponding to // potentially connected devices. We might not be able to determine if a // device is connected yet, so include it in case it becomes connected. final List<Device> devices = await globals.deviceManager!.getDevices( filter: DeviceDiscoveryFilter(excludeDisconnected: false), ); if (devices.isEmpty) { return super.requiredArtifacts; } final Set<DevelopmentArtifact> artifacts = <DevelopmentArtifact>{ DevelopmentArtifact.universal, }; for (final Device device in devices) { final TargetPlatform targetPlatform = await device.targetPlatform; final DevelopmentArtifact? developmentArtifact = artifactFromTargetPlatform(targetPlatform); if (developmentArtifact != null) { artifacts.add(developmentArtifact); } } return artifacts; } } // Returns the development artifact for the target platform, or null // if none is supported @protected DevelopmentArtifact? artifactFromTargetPlatform(TargetPlatform targetPlatform) { switch (targetPlatform) { case TargetPlatform.android: case TargetPlatform.android_arm: case TargetPlatform.android_arm64: case TargetPlatform.android_x64: case TargetPlatform.android_x86: return DevelopmentArtifact.androidGenSnapshot; case TargetPlatform.web_javascript: return DevelopmentArtifact.web; case TargetPlatform.ios: return DevelopmentArtifact.iOS; case TargetPlatform.darwin: if (featureFlags.isMacOSEnabled) { return DevelopmentArtifact.macOS; } return null; case TargetPlatform.windows_x64: case TargetPlatform.windows_arm64: if (featureFlags.isWindowsEnabled) { return DevelopmentArtifact.windows; } return null; case TargetPlatform.linux_x64: case TargetPlatform.linux_arm64: if (featureFlags.isLinuxEnabled) { return DevelopmentArtifact.linux; } return null; case TargetPlatform.fuchsia_arm64: case TargetPlatform.fuchsia_x64: case TargetPlatform.tester: return null; } } /// Returns true if s is either null, empty or is solely made of whitespace characters (as defined by String.trim). bool _isBlank(String s) => s.trim().isEmpty; /// Whether the tool should allow non-null safe builds. /// /// The Dart SDK no longer supports non-null safe builds, so this value in the /// tool's context should always be [NonNullSafeBuilds.notAllowed]. enum NonNullSafeBuilds { allowed, notAllowed, }
flutter/packages/flutter_tools/lib/src/runner/flutter_command.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/runner/flutter_command.dart", "repo_id": "flutter", "token_count": 27957 }
833
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../base/file_system.dart'; import '../base/logger.dart'; /// The name of the test configuration file that will be discovered by the /// test harness if it exists in the project directory hierarchy. const String _kTestConfigFileName = 'flutter_test_config.dart'; /// The name of the file that signals the root of the project and that will /// cause the test harness to stop scanning for configuration files. const String _kProjectRootSentinel = 'pubspec.yaml'; /// Find the `flutter_test_config.dart` file for a specific test file. File? findTestConfigFile(File testFile, Logger logger) { File? testConfigFile; Directory directory = testFile.parent; while (directory.path != directory.parent.path) { final File configFile = directory.childFile(_kTestConfigFileName); if (configFile.existsSync()) { logger.printTrace('Discovered $_kTestConfigFileName in ${directory.path}'); testConfigFile = configFile; break; } if (directory.childFile(_kProjectRootSentinel).existsSync()) { logger.printTrace('Stopping scan for $_kTestConfigFileName; ' 'found project root at ${directory.path}'); break; } directory = directory.parent; } return testConfigFile; }
flutter/packages/flutter_tools/lib/src/test/test_config.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/test/test_config.dart", "repo_id": "flutter", "token_count": 427 }
834
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../build_info.dart' show BuildMode; import '../convert.dart'; import 'compile.dart'; enum CompileTarget { js, wasm, } sealed class WebCompilerConfig { const WebCompilerConfig({required this.renderer, required this.optimizationLevel}); /// The default optimization level for dart2js/dart2wasm. static const int kDefaultOptimizationLevel = 4; /// Build environment flag for [optimizationLevel]. static const String kOptimizationLevel = 'OptimizationLevel'; /// The compiler optimization level. /// /// Valid values are O1 (lowest, profile default) to O4 (highest, release default). final int optimizationLevel; /// Returns which target this compiler outputs (js or wasm) CompileTarget get compileTarget; final WebRendererMode renderer; String get buildKey; Map<String, Object> get buildEventAnalyticsValues => <String, Object>{ 'optimizationLevel': optimizationLevel, }; Map<String, dynamic> get _buildKeyMap => <String, dynamic>{ 'optimizationLevel': optimizationLevel, }; } /// Configuration for the Dart-to-Javascript compiler (dart2js). class JsCompilerConfig extends WebCompilerConfig { const JsCompilerConfig({ this.csp = false, this.dumpInfo = false, this.nativeNullAssertions = false, super.optimizationLevel = WebCompilerConfig.kDefaultOptimizationLevel, this.noFrequencyBasedMinification = false, this.sourceMaps = true, super.renderer = WebRendererMode.auto, }); /// Instantiates [JsCompilerConfig] suitable for the `flutter run` command. const JsCompilerConfig.run({ required bool nativeNullAssertions, required WebRendererMode renderer, }) : this( nativeNullAssertions: nativeNullAssertions, optimizationLevel: WebCompilerConfig.kDefaultOptimizationLevel , renderer: renderer, ); /// Build environment flag for [dumpInfo]. static const String kDart2jsDumpInfo = 'Dart2jsDumpInfo'; /// Build environment flag for [noFrequencyBasedMinification]. static const String kDart2jsNoFrequencyBasedMinification = 'Dart2jsNoFrequencyBasedMinification'; /// Build environment flag for [csp]. static const String kCspMode = 'cspMode'; /// Build environment flag for [sourceMaps]. static const String kSourceMapsEnabled = 'SourceMaps'; /// Build environment flag for [nativeNullAssertions]. static const String kNativeNullAssertions = 'NativeNullAssertions'; /// Whether to disable dynamic generation code to satisfy CSP policies. final bool csp; /// If `--dump-info` should be passed to the compiler. final bool dumpInfo; /// Whether native null assertions are enabled. final bool nativeNullAssertions; // If `--no-frequency-based-minification` should be passed to dart2js // TODO(kevmoo): consider renaming this to be "positive". Double negatives are confusing. final bool noFrequencyBasedMinification; /// `true` if the JavaScript compiler build should output source maps. final bool sourceMaps; @override CompileTarget get compileTarget => CompileTarget.js; /// Arguments to use in both phases: full JS compile and CFE-only. List<String> toSharedCommandOptions() => <String>[ if (nativeNullAssertions) '--native-null-assertions', if (!sourceMaps) '--no-source-maps', ]; /// Arguments to use in the full JS compile, but not CFE-only. /// /// Includes the contents of [toSharedCommandOptions]. List<String> toCommandOptions(BuildMode buildMode) => <String>[ if (buildMode == BuildMode.profile) '--no-minify', ...toSharedCommandOptions(), '-O$optimizationLevel', if (dumpInfo) '--dump-info', if (noFrequencyBasedMinification) '--no-frequency-based-minification', if (csp) '--csp', ]; @override String get buildKey { final Map<String, dynamic> settings = <String, dynamic>{ ...super._buildKeyMap, 'csp': csp, 'dumpInfo': dumpInfo, 'nativeNullAssertions': nativeNullAssertions, 'noFrequencyBasedMinification': noFrequencyBasedMinification, 'sourceMaps': sourceMaps, }; return jsonEncode(settings); } } /// Configuration for the Wasm compiler. class WasmCompilerConfig extends WebCompilerConfig { const WasmCompilerConfig({ super.optimizationLevel = WebCompilerConfig.kDefaultOptimizationLevel, this.stripWasm = true, super.renderer = WebRendererMode.auto, }); /// Build environment for [stripWasm]. static const String kStripWasm = 'StripWasm'; /// Whether to strip the wasm file of static symbols. final bool stripWasm; @override CompileTarget get compileTarget => CompileTarget.wasm; List<String> toCommandOptions(BuildMode buildMode) { final bool stripSymbols = buildMode == BuildMode.release && stripWasm; return <String>[ '-O$optimizationLevel', '--${stripSymbols ? 'no-' : ''}name-section', ]; } @override String get buildKey { final Map<String, dynamic> settings = <String, dynamic>{ ...super._buildKeyMap, 'stripWasm': stripWasm, }; return jsonEncode(settings); } }
flutter/packages/flutter_tools/lib/src/web/compiler_config.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/web/compiler_config.dart", "repo_id": "flutter", "token_count": 1706 }
835
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /// Creates a new string with the first occurrence of [before] replaced by /// [after]. /// /// If the [originalContents] uses CRLF line endings, the [before] and [after] /// will be converted to CRLF line endings before the replacement is made. /// This is necessary for users that have git autocrlf enabled. /// /// Example: /// ```dart /// 'a\n'.replaceFirst('a\n', 'b\n'); // 'b\n' /// 'a\r\n'.replaceFirst('a\n', 'b\n'); // 'b\r\n' /// ``` String replaceFirst(String originalContents, String before, String after) { final String result = originalContents.replaceFirst(before, after); if (result != originalContents) { return result; } final String beforeCrlf = before.replaceAll('\n', '\r\n'); final String afterCrlf = after.replaceAll('\n', '\r\n'); return originalContents.replaceFirst(beforeCrlf, afterCrlf); }
flutter/packages/flutter_tools/lib/src/windows/migrations/utils.dart/0
{ "file_path": "flutter/packages/flutter_tools/lib/src/windows/migrations/utils.dart", "repo_id": "flutter", "token_count": 306 }
836
// This is a basic Flutter integration test. {{#withPlatformChannelPluginHook}} // // Since integration tests run in a full Flutter application, they can interact // with the host side of a plugin implementation, unlike Dart unit tests. {{/withPlatformChannelPluginHook}} // // For more information about Flutter integration tests, please see // https://docs.flutter.dev/cookbook/testing/integration/introduction import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; {{#withPlatformChannelPluginHook}} import 'package:{{pluginProjectName}}/{{pluginProjectName}}.dart'; {{/withPlatformChannelPluginHook}} void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); {{#withPlatformChannelPluginHook}} testWidgets('getPlatformVersion test', (WidgetTester tester) async { final {{pluginDartClass}} plugin = {{pluginDartClass}}(); final String? version = await plugin.getPlatformVersion(); // The version string depends on the host platform running the test, so // just assert that some non-empty string is returned. expect(version?.isNotEmpty, true); }); {{/withPlatformChannelPluginHook}} }
flutter/packages/flutter_tools/templates/app_integration_test/integration_test/plugin_integration_test.dart.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/app_integration_test/integration_test/plugin_integration_test.dart.tmpl", "repo_id": "flutter", "token_count": 332 }
837
def flutterPluginVersion = "managed" apply plugin: "com.android.application" android { // Conditional for compatibility with AGP <4.2. if (project.android.hasProperty("namespace")) { namespace = "{{androidIdentifier}}.host" } compileSdk = {{compileSdkVersion}} compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } defaultConfig { applicationId = "{{androidIdentifier}}.host" minSdk = {{minSdkVersion}} targetSdk = {{targetSdkVersion}} versionCode = 1 versionName = "1.0" } buildTypes { profile { initWith debug } release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig = signingConfigs.debug } } } buildDir = new File(rootProject.projectDir, "../build/host") dependencies { implementation(project(":flutter")) implementation(fileTree(dir: "libs", include: ["*.jar"])) implementation("androidx.appcompat:appcompat:1.0.2") implementation("androidx.constraintlayout:constraintlayout:1.1.3") }
flutter/packages/flutter_tools/templates/module/android/host_app_common/app.tmpl/build.gradle.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/module/android/host_app_common/app.tmpl/build.gradle.tmpl", "repo_id": "flutter", "token_count": 500 }
838