TF-2116 Create Mobile/Tablet container view

(cherry picked from commit a8f9993913b1c4a42eb58506c4b350ec8dc4252f)
This commit is contained in:
dab246
2023-09-07 09:47:11 +07:00
committed by Dat H. Pham
parent f7772e0ba7
commit cbba97279a
4 changed files with 214 additions and 0 deletions
@@ -0,0 +1,13 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/utils/platform_info.dart';
import 'package:flutter/material.dart';
class MobileContainerViewStyle {
static const Color outSideBackgroundColor = Colors.white;
static const Color backgroundColor = Colors.white;
static final Color keyboardToolbarBackgroundColor = PlatformInfo.isIOS
? AppColor.colorBackgroundKeyboard
: AppColor.colorBackgroundKeyboardAndroid;
static const EdgeInsets keyboardToolbarPadding = EdgeInsets.only(bottom: 64);
}
@@ -0,0 +1,41 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/utils/platform_info.dart';
import 'package:flutter/material.dart';
class TabletContainerViewStyle {
static const double radius = 28;
static const double elevation = 16;
static const Color backgroundColor = Colors.white;
static const Color outSideBackgroundColor = Colors.black38;
static final Color keyboardToolbarBackgroundColor = PlatformInfo.isIOS
? AppColor.colorBackgroundKeyboard
: AppColor.colorBackgroundKeyboardAndroid;
static const EdgeInsets keyboardToolbarPadding = EdgeInsets.only(bottom: 64);
static EdgeInsetsGeometry getMargin(
BuildContext context,
ResponsiveUtils responsiveUtils
) {
if (responsiveUtils.isTablet(context)) {
return const EdgeInsetsDirectional.all(24);
} else {
return const EdgeInsetsDirectional.symmetric(vertical: 24);
}
}
static double getWidth(
BuildContext context,
ResponsiveUtils responsiveUtils
) {
final currentWidth = responsiveUtils.getSizeScreenWidth(context);
if (responsiveUtils.isTablet(context)) {
return currentWidth;
} else {
return currentWidth * 0.7;
}
}
}