Skip to content

Commit 69a4047

Browse files
committed
fix lint
1 parent d45bc4b commit 69a4047

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

lib/src/widgets/adaptive_app.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,14 @@ class AdaptiveApp extends StatelessWidget {
255255

256256
// Prepare light and dark themes
257257
// If Cupertino theme is not provided, try to derive primaryColor from Material theme
258-
final effectiveLightTheme = cupertinoLightTheme ??
258+
final effectiveLightTheme =
259+
cupertinoLightTheme ??
259260
CupertinoThemeData(
260261
brightness: Brightness.light,
261262
primaryColor: materialLightTheme?.colorScheme.primary,
262263
);
263-
final effectiveDarkTheme = cupertinoDarkTheme ??
264+
final effectiveDarkTheme =
265+
cupertinoDarkTheme ??
264266
CupertinoThemeData(
265267
brightness: Brightness.dark,
266268
primaryColor: materialDarkTheme?.colorScheme.primary,
@@ -287,13 +289,10 @@ class AdaptiveApp extends StatelessWidget {
287289
final theme = isDark ? effectiveDarkTheme : effectiveLightTheme;
288290

289291
return MediaQuery(
290-
data: MediaQuery.of(context).copyWith(
291-
platformBrightness: effectiveBrightness,
292-
),
293-
child: CupertinoTheme(
294-
data: theme,
295-
child: child!,
296-
),
292+
data: MediaQuery.of(
293+
context,
294+
).copyWith(platformBrightness: effectiveBrightness),
295+
child: CupertinoTheme(data: theme, child: child!),
297296
);
298297
}
299298

@@ -319,7 +318,8 @@ class AdaptiveApp extends StatelessWidget {
319318
title: title,
320319
onGenerateTitle: onGenerateTitle,
321320
color: config.color,
322-
theme: effectiveLightTheme, // Default theme (will be overridden by builder)
321+
theme:
322+
effectiveLightTheme, // Default theme (will be overridden by builder)
323323
locale: locale,
324324
localizationsDelegates: localizationsDelegates,
325325
localeListResolutionCallback: localeListResolutionCallback,
@@ -351,7 +351,8 @@ class AdaptiveApp extends StatelessWidget {
351351
title: title,
352352
onGenerateTitle: onGenerateTitle,
353353
color: config.color,
354-
theme: effectiveLightTheme, // Default theme (will be overridden by builder)
354+
theme:
355+
effectiveLightTheme, // Default theme (will be overridden by builder)
355356
locale: locale,
356357
localizationsDelegates: localizationsDelegates,
357358
localeListResolutionCallback: localeListResolutionCallback,

lib/src/widgets/adaptive_button.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ class AdaptiveButton extends StatelessWidget {
287287

288288
case AdaptiveButtonStyle.plain:
289289
// For plain style, color parameter affects text/icon color
290-
final effectiveColor = color ?? textColor ?? CupertinoTheme.of(context).primaryColor;
290+
final effectiveColor =
291+
color ?? textColor ?? CupertinoTheme.of(context).primaryColor;
291292

292293
Widget buttonChild;
293294
if (sfSymbol != null) {
@@ -463,14 +464,13 @@ class AdaptiveButton extends StatelessWidget {
463464

464465
case AdaptiveButtonStyle.plain:
465466
// Explicitly use primary color if no color is provided
466-
final effectiveColor = color ?? textColor ?? Theme.of(context).colorScheme.primary;
467+
final effectiveColor =
468+
color ?? textColor ?? Theme.of(context).colorScheme.primary;
467469
return TextButton(
468470
onPressed: effectiveOnPressed,
469471
style: ButtonStyle(
470472
foregroundColor: WidgetStateProperty.all(effectiveColor),
471-
padding: padding != null
472-
? WidgetStateProperty.all(padding)
473-
: null,
473+
padding: padding != null ? WidgetStateProperty.all(padding) : null,
474474
minimumSize: minSize != null
475475
? WidgetStateProperty.all(minSize)
476476
: null,
@@ -490,8 +490,12 @@ class AdaptiveButton extends StatelessWidget {
490490
return FilledButton(
491491
onPressed: effectiveOnPressed,
492492
style: FilledButton.styleFrom(
493-
backgroundColor: isDark ? Colors.grey.shade800 : Colors.grey.shade300,
494-
foregroundColor: isDark ? Colors.grey.shade300 : Colors.grey.shade800,
493+
backgroundColor: isDark
494+
? Colors.grey.shade800
495+
: Colors.grey.shade300,
496+
foregroundColor: isDark
497+
? Colors.grey.shade300
498+
: Colors.grey.shade800,
495499
padding: padding ?? _getDefaultPadding(),
496500
minimumSize: minSize ?? Size.zero,
497501
shape: RoundedRectangleBorder(

lib/src/widgets/adaptive_checkbox.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ class _IOSCheckbox extends StatelessWidget {
166166
borderRadius: BorderRadius.circular(6),
167167
),
168168
child: value == true
169-
? Icon(CupertinoIcons.checkmark, size: 14, color: effectiveCheckColor)
169+
? Icon(
170+
CupertinoIcons.checkmark,
171+
size: 14,
172+
color: effectiveCheckColor,
173+
)
170174
: value == null
171175
? Center(
172176
child: Container(

lib/src/widgets/adaptive_switch.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ class AdaptiveSwitch extends StatelessWidget {
7373
return CupertinoSwitch(
7474
value: value,
7575
onChanged: onChanged,
76-
activeTrackColor: activeColor ?? CupertinoTheme.of(context).primaryColor,
76+
activeTrackColor:
77+
activeColor ?? CupertinoTheme.of(context).primaryColor,
7778
thumbColor: thumbColor,
7879
);
7980
}

0 commit comments

Comments
 (0)