mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
25 lines
447 B
Dart
25 lines
447 B
Dart
import 'package:spotube/hooks/use_breakpoints.dart';
|
|
|
|
useBreakpointValue<T>({
|
|
T? sm,
|
|
T? md,
|
|
T? lg,
|
|
T? xl,
|
|
T? xxl,
|
|
T? others,
|
|
}) {
|
|
final breakpoint = useBreakpoints();
|
|
|
|
if (breakpoint.isSm) {
|
|
return sm ?? others;
|
|
} else if (breakpoint.isMd) {
|
|
return md ?? others;
|
|
} else if (breakpoint.isXl) {
|
|
return xl ?? others;
|
|
} else if (breakpoint.isXxl) {
|
|
return xxl ?? others;
|
|
} else {
|
|
return lg ?? others;
|
|
}
|
|
}
|