Skip to content

Commit 7cd904a

Browse files
committed
🎨 Format files
1 parent 0ff58ad commit 7cd904a

File tree

7 files changed

+57
-29
lines changed

7 files changed

+57
-29
lines changed

analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include: package:flutter_lints/flutter.yaml
22

3+
formatter:
4+
trailing_commas: preserve
5+
36
linter:
47
rules:
58
always_declare_return_types: true

example/analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include: ../analysis_options.yaml
22

3+
formatter:
4+
trailing_commas: preserve
5+
36
analyzer:
47
exclude:
58
- lib/l10n/gen/*.dart

example/lib/l10n/gen/app_localizations.dart

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,17 @@ import 'app_localizations_zh.dart';
6262
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
6363
/// property.
6464
abstract class AppLocalizations {
65-
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
65+
AppLocalizations(String locale)
66+
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
6667

6768
final String localeName;
6869

6970
static AppLocalizations? of(BuildContext context) {
7071
return Localizations.of<AppLocalizations>(context, AppLocalizations);
7172
}
7273

73-
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
74+
static const LocalizationsDelegate<AppLocalizations> delegate =
75+
_AppLocalizationsDelegate();
7476

7577
/// A list of this localizations delegate along with the default localizations
7678
/// delegates.
@@ -82,7 +84,8 @@ abstract class AppLocalizations {
8284
/// Additional delegates can be added by appending to this list in
8385
/// MaterialApp. This list does not have to be used at all if a custom list
8486
/// of delegates is preferred or required.
85-
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
87+
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
88+
<LocalizationsDelegate<dynamic>>[
8689
delegate,
8790
GlobalMaterialLocalizations.delegate,
8891
GlobalCupertinoLocalizations.delegate,
@@ -282,7 +285,8 @@ abstract class AppLocalizations {
282285
String get pickMethodForegroundBuilderDescription;
283286
}
284287

285-
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
288+
class _AppLocalizationsDelegate
289+
extends LocalizationsDelegate<AppLocalizations> {
286290
const _AppLocalizationsDelegate();
287291

288292
@override
@@ -291,25 +295,25 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
291295
}
292296

293297
@override
294-
bool isSupported(Locale locale) => <String>['en', 'zh'].contains(locale.languageCode);
298+
bool isSupported(Locale locale) =>
299+
<String>['en', 'zh'].contains(locale.languageCode);
295300

296301
@override
297302
bool shouldReload(_AppLocalizationsDelegate old) => false;
298303
}
299304

300305
AppLocalizations lookupAppLocalizations(Locale locale) {
301-
302-
303306
// Lookup logic when only language code is specified.
304307
switch (locale.languageCode) {
305-
case 'en': return AppLocalizationsEn();
306-
case 'zh': return AppLocalizationsZh();
308+
case 'en':
309+
return AppLocalizationsEn();
310+
case 'zh':
311+
return AppLocalizationsZh();
307312
}
308313

309314
throw FlutterError(
310-
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
311-
'an issue with the localizations generation tool. Please file an issue '
312-
'on GitHub with a reproducible sample app and the gen-l10n configuration '
313-
'that was used.'
314-
);
315+
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
316+
'an issue with the localizations generation tool. Please file an issue '
317+
'on GitHub with a reproducible sample app and the gen-l10n configuration '
318+
'that was used.');
315319
}

example/lib/l10n/gen/app_localizations_en.dart

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'app_localizations.dart';
24

35
// ignore_for_file: type=lint
@@ -35,7 +37,8 @@ class AppLocalizationsEn extends AppLocalizations {
3537
String get pickMethodPhotosAndVideosName => 'Taking photos and videos';
3638

3739
@override
38-
String get pickMethodPhotosAndVideosDescription => 'Use cameras to take photos and videos.';
40+
String get pickMethodPhotosAndVideosDescription =>
41+
'Use cameras to take photos and videos.';
3942

4043
@override
4144
String get pickMethodVideosName => 'Taking videos';
@@ -47,7 +50,8 @@ class AppLocalizationsEn extends AppLocalizations {
4750
String get pickMethodVideosByTapName => 'Taking videos by tap';
4851

4952
@override
50-
String get pickMethodVideosByTapDescription => 'Use cameras only to take videos, but not with long-press, just a single tap.';
53+
String get pickMethodVideosByTapDescription =>
54+
'Use cameras only to take videos, but not with long-press, just a single tap.';
5155

5256
@override
5357
String get pickMethodSilenceRecordingName => 'Silence recording';
@@ -59,47 +63,56 @@ class AppLocalizationsEn extends AppLocalizations {
5963
String get pickMethodNoDurationLimitName => 'No duration limit';
6064

6165
@override
62-
String get pickMethodNoDurationLimitDescription => 'Record as long as you with (if your device stays alive)...';
66+
String get pickMethodNoDurationLimitDescription =>
67+
'Record as long as you with (if your device stays alive)...';
6368

6469
@override
65-
String get pickMethodCustomizableThemeName => 'Customizable theme (ThemeData)';
70+
String get pickMethodCustomizableThemeName =>
71+
'Customizable theme (ThemeData)';
6672

6773
@override
68-
String get pickMethodCustomizableThemeDescription => 'Picking assets with the light theme or with a different color.';
74+
String get pickMethodCustomizableThemeDescription =>
75+
'Picking assets with the light theme or with a different color.';
6976

7077
@override
7178
String get pickMethodRotateInTurnsName => 'Rotate picker in turns';
7279

7380
@override
74-
String get pickMethodRotateInTurnsDescription => 'Rotate the picker layout in quarter turns, without the camera preview.';
81+
String get pickMethodRotateInTurnsDescription =>
82+
'Rotate the picker layout in quarter turns, without the camera preview.';
7583

7684
@override
7785
String get pickMethodScalingPreviewName => 'Scaling for camera preview';
7886

7987
@override
80-
String get pickMethodScalingPreviewDescription => 'Camera preview will be scaled to cover the whole screen of the device with the original aspect ratio.';
88+
String get pickMethodScalingPreviewDescription =>
89+
'Camera preview will be scaled to cover the whole screen of the device with the original aspect ratio.';
8190

8291
@override
8392
String get pickMethodLowerResolutionName => 'Lower resolutions';
8493

8594
@override
86-
String get pickMethodLowerResolutionDescription => 'Use a lower resolution preset might be helpful in some specific scenarios.';
95+
String get pickMethodLowerResolutionDescription =>
96+
'Use a lower resolution preset might be helpful in some specific scenarios.';
8797

8898
@override
8999
String get pickMethodPreferFrontCameraName => 'Prefer front camera';
90100

91101
@override
92-
String get pickMethodPreferFrontCameraDescription => 'Use the front camera as the preferred lens direction if the device supports.';
102+
String get pickMethodPreferFrontCameraDescription =>
103+
'Use the front camera as the preferred lens direction if the device supports.';
93104

94105
@override
95106
String get pickMethodPreferFlashlightOnName => 'Prefer flashlight always on';
96107

97108
@override
98-
String get pickMethodPreferFlashlightOnDescription => 'Prefer to keep using the flashlight during captures.';
109+
String get pickMethodPreferFlashlightOnDescription =>
110+
'Prefer to keep using the flashlight during captures.';
99111

100112
@override
101113
String get pickMethodForegroundBuilderName => 'Foreground builder';
102114

103115
@override
104-
String get pickMethodForegroundBuilderDescription => 'Build your widgets with the given CameraController on the top of the camera preview.';
116+
String get pickMethodForegroundBuilderDescription =>
117+
'Build your widgets with the given CameraController on the top of the camera preview.';
105118
}

example/lib/l10n/gen/app_localizations_zh.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'app_localizations.dart';
24

35
// ignore_for_file: type=lint
@@ -77,7 +79,8 @@ class AppLocalizationsZh extends AppLocalizations {
7779
String get pickMethodScalingPreviewName => '缩放相机预览';
7880

7981
@override
80-
String get pickMethodScalingPreviewDescription => '相机预览视图会被放大到覆盖整个屏幕且保持原始的预览比例。';
82+
String get pickMethodScalingPreviewDescription =>
83+
'相机预览视图会被放大到覆盖整个屏幕且保持原始的预览比例。';
8184

8285
@override
8386
String get pickMethodLowerResolutionName => '低分辨率拍照';
@@ -101,5 +104,6 @@ class AppLocalizationsZh extends AppLocalizations {
101104
String get pickMethodForegroundBuilderName => '构建前景';
102105

103106
@override
104-
String get pickMethodForegroundBuilderDescription => '通过 CameraController 构建在相机预览部分的前景 widget。';
107+
String get pickMethodForegroundBuilderDescription =>
108+
'通过 CameraController 构建在相机预览部分的前景 widget。';
105109
}

example/lib/widgets/selected_assets_list_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class SelectedAssetsListView extends StatelessWidget {
110110
curve: Curves.easeInOut,
111111
height: assets.isNotEmpty
112112
? value
113-
? 120.0
114-
: 80.0
113+
? 120.0
114+
: 80.0
115115
: 40.0,
116116
child: Column(
117117
children: <Widget>[

example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ dev_dependencies:
2525

2626
flutter:
2727
uses-material-design: true
28+
generate: true
2829
assets:
2930
- assets/

0 commit comments

Comments
 (0)