TF-1665 Remove blank in the app grip
(cherry picked from commit 3913bb611b3200022a1b4d05f8337fe57101563a)
This commit is contained in:
+36
-30
@@ -17,40 +17,46 @@ class AppGridDashboardItem extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return LinkBrowserWidget(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
uri: app.appUri,
|
||||||
child: LinkBrowserWidget(
|
child: Material(
|
||||||
uri: app.appUri,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: _openApp,
|
onTap: _openApp,
|
||||||
child: Column(children: [
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
app.iconName.endsWith("svg")
|
hoverColor: AppColor.colorItemSelected,
|
||||||
? SvgPicture.asset(
|
child: Container(
|
||||||
_imagePaths.getConfigurationImagePath(app.iconName),
|
width: 98,
|
||||||
width: 56,
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
height: 56,
|
child: Column(children: [
|
||||||
fit: BoxFit.fill)
|
app.iconName.endsWith("svg")
|
||||||
: Image.asset(
|
? SvgPicture.asset(
|
||||||
_imagePaths.getConfigurationImagePath(app.iconName),
|
_imagePaths.getConfigurationImagePath(app.iconName),
|
||||||
width: 56,
|
width: 56,
|
||||||
height: 56,
|
height: 56,
|
||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill)
|
||||||
Padding(
|
: Image.asset(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
_imagePaths.getConfigurationImagePath(app.iconName),
|
||||||
child: Text(
|
width: 56,
|
||||||
app.appName,
|
height: 56,
|
||||||
maxLines: 1,
|
fit: BoxFit.fill),
|
||||||
textAlign: TextAlign.center,
|
Padding(
|
||||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
padding: const EdgeInsets.only(top: 8),
|
||||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
child: Text(
|
||||||
style: const TextStyle(
|
app.appName,
|
||||||
color: AppColor.colorNameEmail,
|
maxLines: 1,
|
||||||
fontSize: 15
|
textAlign: TextAlign.center,
|
||||||
|
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||||
|
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: AppColor.colorNameEmail,
|
||||||
|
fontSize: 15
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
]),
|
||||||
]),
|
),
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-21
@@ -1,5 +1,4 @@
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/presentation/views/list/sliver_grid_delegate_fixed_height.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/app_dashboard/linagora_applications.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/app_dashboard/linagora_applications.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/app_dashboard/app_grid_dashboard_item.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/app_dashboard/app_grid_dashboard_item.dart';
|
||||||
@@ -14,36 +13,38 @@ class AppDashboardOverlay extends StatelessWidget {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 342,
|
width: _widthAppGrid,
|
||||||
height: 244,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(24),
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.colorShadowComposer,
|
color: AppColor.colorShadowLayerBottom,
|
||||||
blurRadius: 32,
|
blurRadius: 96,
|
||||||
offset: Offset.zero),
|
offset: Offset.zero),
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.colorDropShadow,
|
color: AppColor.colorShadowLayerTop,
|
||||||
blurRadius: 4,
|
blurRadius: 2,
|
||||||
offset: Offset.zero),
|
offset: Offset.zero),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
child: GridView.builder(
|
padding: const EdgeInsets.all(24),
|
||||||
padding: const EdgeInsets.all(24),
|
child: Wrap(children: _linagoraApplications.apps
|
||||||
itemBuilder: (context, i) {
|
.map((app) => AppGridDashboardItem(app))
|
||||||
final app = _linagoraApplications.apps[i];
|
.toList()),
|
||||||
return AppGridDashboardItem(app);
|
|
||||||
},
|
|
||||||
primary: true,
|
|
||||||
itemCount: _linagoraApplications.apps.length,
|
|
||||||
gridDelegate: const SliverGridDelegateFixedHeight(
|
|
||||||
height: 98,
|
|
||||||
crossAxisCount: 3,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double get _widthAppGrid {
|
||||||
|
if (_linagoraApplications.apps.length >= 3) {
|
||||||
|
return 342;
|
||||||
|
} else if (_linagoraApplications.apps.length == 2) {
|
||||||
|
return 244;
|
||||||
|
} else if (_linagoraApplications.apps.length == 1) {
|
||||||
|
return 146;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user