Skip to content

Commit bc2d150

Browse files
committed
updated
1 parent 66455cc commit bc2d150

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

example/lib/generated/i18n.dart

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ class S implements WidgetsLocalizations {
1414
static S current;
1515

1616
static const GeneratedLocalizationsDelegate delegate =
17-
GeneratedLocalizationsDelegate();
17+
GeneratedLocalizationsDelegate();
1818

1919
static S of(BuildContext context) => Localizations.of<S>(context, S);
2020

2121
@override
2222
TextDirection get textDirection => TextDirection.ltr;
23-
2423
}
2524

2625
class $en extends S {
@@ -36,7 +35,8 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
3635
];
3736
}
3837

39-
LocaleListResolutionCallback listResolution({Locale fallback, bool withCountry = true}) {
38+
LocaleListResolutionCallback listResolution(
39+
{Locale fallback, bool withCountry = true}) {
4040
return (List<Locale> locales, Iterable<Locale> supported) {
4141
if (locales == null || locales.isEmpty) {
4242
return fallback ?? supported.first;
@@ -46,7 +46,8 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
4646
};
4747
}
4848

49-
LocaleResolutionCallback resolution({Locale fallback, bool withCountry = true}) {
49+
LocaleResolutionCallback resolution(
50+
{Locale fallback, bool withCountry = true}) {
5051
return (Locale locale, Iterable<Locale> supported) {
5152
return _resolve(locale, fallback, supported, withCountry);
5253
};
@@ -61,7 +62,7 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
6162
S.current = const $en();
6263
return SynchronousFuture<S>(S.current);
6364
default:
64-
// NO-OP.
65+
// NO-OP.
6566
}
6667
}
6768
S.current = const S();
@@ -77,7 +78,8 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
7778
///
7879
/// Internal method to resolve a locale from a list of locales.
7980
///
80-
Locale _resolve(Locale locale, Locale fallback, Iterable<Locale> supported, bool withCountry) {
81+
Locale _resolve(Locale locale, Locale fallback, Iterable<Locale> supported,
82+
bool withCountry) {
8183
if (locale == null || !_isSupported(locale, withCountry)) {
8284
return fallback ?? supported.first;
8385
}
@@ -110,7 +112,9 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
110112
}
111113

112114
// If no country requirement is requested, check if this locale has no country.
113-
if (true != withCountry && (supportedLocale.countryCode == null || supportedLocale.countryCode.isEmpty)) {
115+
if (true != withCountry &&
116+
(supportedLocale.countryCode == null ||
117+
supportedLocale.countryCode.isEmpty)) {
114118
return true;
115119
}
116120
}
@@ -119,8 +123,9 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
119123
}
120124
}
121125

122-
String getLang(Locale l) => l == null
123-
? null
124-
: l.countryCode != null && l.countryCode.isEmpty
125-
? l.languageCode
126-
: l.toString();
126+
String getLang(Locale l) =>
127+
l == null
128+
? null
129+
: l.countryCode != null && l.countryCode.isEmpty
130+
? l.languageCode
131+
: l.toString();

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class _MyHomePageState extends State<MyHomePage> {
8383
),
8484
body: FutureBuilder<Map<String, int>>(
8585
builder: (context, snapshot) {
86-
if(snapshot.hasError){
86+
if (snapshot.hasError) {
8787
Center(
8888
child: Text(snapshot.error.toString()),
8989
);

example/lib/openapi_config.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ import 'package:openapi_generator_annotations/openapi_generator_annotations.dart
77
generatorName: 'dart-jaguar',
88
alwaysRun: true,
99
outputDirectory: 'api/petstore_api')
10-
class OpenapiConfig extends OpenapiGeneratorConfig {
11-
}
10+
class OpenapiConfig extends OpenapiGeneratorConfig {}

openapi-generator/lib/src/openapi_generator_runner.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class OpenapiGenerator extends GeneratorForAnnotation<annots.Openapi> {
255255
String getMapAsString(Map<dynamic, dynamic> data) {
256256
return data.entries
257257
.map((entry) =>
258-
'${entry.key.toStringValue()}=${entry.value.toStringValue()}')
258+
'${entry.key.toStringValue()}=${entry.value.toStringValue()}')
259259
.join(',');
260260
}
261261

openapi-generator/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ environment:
88

99
dependencies:
1010
build: '>=1.3.0 <=1.10.3'
11-
source_gen: ^0.9.10
11+
source_gen: ^0.9.10+1
1212
path: ^1.7.0
1313
openapi_generator_annotations: ^1.1.4
1414
analyzer: ^0.41.1
1515
openapi_generator_cli: ^1.1.4
16-
# generic_reader: ^0.1.5
1716

1817
dev_dependencies:
1918
pedantic: ^1.9.2

0 commit comments

Comments
 (0)