fbmobile/lib/ui/shared/ui_helpers.dart

52 lines
1.6 KiB
Dart
Raw Permalink Normal View History

2021-02-02 14:33:23 +00:00
import 'package:flutter/material.dart';
class UIHelper {
2023-01-04 20:17:54 +00:00
static const double _verticalSpaceSmall = 10.0;
static const double _verticalSpaceMedium = 20.0;
static const double _verticalSpaceLarge = 60.0;
2021-02-02 14:33:23 +00:00
2023-01-04 20:17:54 +00:00
static const double _horizontalSpaceSmall = 10.0;
static const double _horizontalSpaceMedium = 20.0;
static const double _horizontalSpaceLarge = 60.0;
2021-02-02 14:33:23 +00:00
2023-01-04 20:17:54 +00:00
/// Returns a vertical space with height set to [_verticalSpaceSmall]
2021-02-02 14:33:23 +00:00
static Widget verticalSpaceSmall() {
2023-01-04 20:17:54 +00:00
return verticalSpace(_verticalSpaceSmall);
2021-02-02 14:33:23 +00:00
}
2023-01-04 20:17:54 +00:00
/// Returns a vertical space with height set to [_verticalSpaceMedium]
2021-02-02 14:33:23 +00:00
static Widget verticalSpaceMedium() {
2023-01-04 20:17:54 +00:00
return verticalSpace(_verticalSpaceMedium);
2021-02-02 14:33:23 +00:00
}
2023-01-04 20:17:54 +00:00
/// Returns a vertical space with height set to [_verticalSpaceLarge]
2021-02-02 14:33:23 +00:00
static Widget verticalSpaceLarge() {
2023-01-04 20:17:54 +00:00
return verticalSpace(_verticalSpaceLarge);
2021-02-02 14:33:23 +00:00
}
/// Returns a vertical space equal to the [height] supplied
static Widget verticalSpace(double height) {
return Container(height: height);
}
2023-01-04 20:17:54 +00:00
/// Returns a vertical space with height set to [_horizontalSpaceSmall]
2021-02-02 14:33:23 +00:00
static Widget horizontalSpaceSmall() {
2023-01-04 20:17:54 +00:00
return horizontalSpace(_horizontalSpaceSmall);
2021-02-02 14:33:23 +00:00
}
2023-01-04 20:17:54 +00:00
/// Returns a vertical space with height set to [_horizontalSpaceMedium]
2021-02-02 14:33:23 +00:00
static Widget horizontalSpaceMedium() {
2023-01-04 20:17:54 +00:00
return horizontalSpace(_horizontalSpaceMedium);
2021-02-02 14:33:23 +00:00
}
2023-01-04 20:17:54 +00:00
/// Returns a vertical space with height set to [_horizontalSpaceLarge]
2021-02-02 14:33:23 +00:00
static Widget horizontalSpaceLarge() {
2023-01-04 20:17:54 +00:00
return horizontalSpace(_horizontalSpaceLarge);
2021-02-02 14:33:23 +00:00
}
/// Returns a vertical space equal to the [width] supplied
static Widget horizontalSpace(double width) {
return Container(width: width);
}
}