TF-2116 Create Mobile/Tablet container view
(cherry picked from commit a8f9993913b1c4a42eb58506c4b350ec8dc4252f)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user