Skip to content

Commit

Permalink
TW-984: Add appbar size for web app
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed Mar 11, 2024
1 parent 94de1fa commit 372fb93
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 29 deletions.
3 changes: 2 additions & 1 deletion config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"render_html": true,
"hide_redacted_events": false,
"hide_unknown_events": false,
"issue_id": ""
"issue_id": "",
"app_grid_dashboard_available": true
}
6 changes: 3 additions & 3 deletions configurations/app_dashboard.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"apps": [
{
"appName": "TMail",
"appName": "Twake Mail",
"icon": "ic_twake_mail.svg",
"appLink": "http://tmail.linagora.com/"
},
{
"appName": "Twake",
"appName": "Twake Chat",
"icon": "ic_twake_chat.svg",
"appLink": "https://beta.twake.app/"
},
{
"appName": "TDrive",
"appName": "Twake Drive",
"icon": "ic_twake_drive.svg",
"appLink": "https://tdrive.linagora.com/"
},
Expand Down
2 changes: 1 addition & 1 deletion lib/config/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ abstract class AppConfig {
static bool separateChatTypes = false;
static bool autoplayImages = true;
static bool experimentalVoip = false;
static bool appGridDashboardAvailable = false;
static bool appGridDashboardAvailable = true;
static const bool hideTypingUsernames = false;
static const bool hideAllStateEvents = false;
static const String inviteLinkPrefix = 'https://matrix.to/#/';
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/app_grid/app_grid_dashboard_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AppGridDashboardItem extends StatelessWidget {
textAlign: TextAlign.center,
softWrap: true,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.titleSmall,
),
),
],
Expand Down
8 changes: 4 additions & 4 deletions lib/pages/app_grid/app_grid_dashboard_overlay_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import 'package:flutter/cupertino.dart';
class AppGridDashboardOverlayStyle {
static double widthAppGrid(LinagoraApplications linagoraApplications) {
if (linagoraApplications.apps.length >= 3) {
return 342;
return 326;
} else if (linagoraApplications.apps.length == 2) {
return 244;
return 228;
} else if (linagoraApplications.apps.length == 1) {
return 146;
return 130;
} else {
return 0;
}
}

static const double borderRadius = 24;

static const EdgeInsets padding = EdgeInsets.all(24);
static const EdgeInsets padding = EdgeInsets.all(16);

static const EdgeInsets margin = EdgeInsets.only(right: 16);
}
14 changes: 0 additions & 14 deletions lib/pages/app_grid/app_grid_dashboard_view_style.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
import 'package:fluffychat/domain/model/app_grid/linagora_applications.dart';

class AppGridDashboardViewStyle {
static const double sizIcAppGrid = 48.0;

static double widthAppGrid(LinagoraApplications linagoraApplications) {
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:fluffychat/resource/image_paths.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_appbar_style.dart';
import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_view_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
import 'package:flutter_svg/svg.dart';
Expand All @@ -21,6 +22,7 @@ class AdaptiveScaffoldAppBar extends StatelessWidget {
key: AdaptiveScaffoldAppBarStyle.adaptiveAppBarKey,
builder: (_) {
return Container(
height: AppScaffoldViewStyle.appBarSize,
decoration: BoxDecoration(
color: LinagoraSysColors.material().onPrimary,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:fluffychat/utils/extension/build_context_extension.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_appbar.dart';
import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_route_style.dart';
import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_view_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
import 'package:flutter_portal/flutter_portal.dart';
Expand Down Expand Up @@ -36,10 +35,7 @@ class AppAdaptiveScaffold extends StatelessWidget {
backgroundColor: Theme.of(context).colorScheme.surface,
body: Column(
children: [
const SizedBox(
height: AppScaffoldViewStyle.appBarSize,
child: AdaptiveScaffoldAppBar(),
),
const AdaptiveScaffoldAppBar(),
Expanded(
child: AdaptiveLayout(
internalAnimations: false,
Expand Down

0 comments on commit 372fb93

Please sign in to comment.