Skip to content

Commit

Permalink
fix mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
firgia committed Nov 1, 2021
1 parent 6ff0230 commit 3b383bb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 13 deletions.
18 changes: 11 additions & 7 deletions lib/app/features/dashboard/views/components/overview_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ class _OverviewHeader extends StatelessWidget {
style: TextStyle(fontWeight: FontWeight.w600),
),
const SizedBox(height: 10),
Row(
children: _listButton(
task: task.value,
onSelected: (value) {
task.value = value;
onSelected(value);
},
SingleChildScrollView(
scrollDirection: Axis.horizontal,
physics: const BouncingScrollPhysics(),
child: Row(
children: _listButton(
task: task.value,
onSelected: (value) {
task.value = value;
onSelected(value);
},
),
),
),
],
Expand Down
1 change: 1 addition & 0 deletions lib/app/features/dashboard/views/components/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class _Sidebar extends StatelessWidget {
return Container(
color: Theme.of(context).cardColor,
child: SingleChildScrollView(
controller: ScrollController(),
child: Column(
children: [
Padding(
Expand Down
48 changes: 42 additions & 6 deletions lib/app/features/dashboard/views/screens/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:project_management/app/utils/helpers/app_helpers.dart';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter/foundation.dart' show kIsWeb;

// binding
part '../../bindings/dashboard_binding.dart';
Expand Down Expand Up @@ -49,13 +50,46 @@ class DashboardScreen extends GetView<DashboardController> {
key: controller.scaffoldKey,
drawer: (ResponsiveBuilder.isDesktop(context))
? null
: Drawer(child: _Sidebar(data: controller.getSelectedProject())),
: Drawer(
child: Padding(
padding: const EdgeInsets.only(top: kSpacing),
child: _Sidebar(data: controller.getSelectedProject()),
),
),
body: SingleChildScrollView(
child: ResponsiveBuilder(
mobileBuilder: (context, constraints) {
return const Center(
child: Text("Mobile"),
);
return Column(children: [
const SizedBox(height: kSpacing * (kIsWeb ? 1 : 2)),
_buildHeader(onPressedMenu: () => controller.openDrawer()),
const SizedBox(height: kSpacing / 2),
const Divider(),
_buildProfile(data: controller.getProfil()),
const SizedBox(height: kSpacing),
_buildProgress(axis: Axis.vertical),
const SizedBox(height: kSpacing),
_buildTeamMember(data: controller.getMember()),
const SizedBox(height: kSpacing),
Padding(
padding: const EdgeInsets.symmetric(horizontal: kSpacing),
child: GetPremiumCard(onPressed: () {}),
),
const SizedBox(height: kSpacing * 2),
_buildTaskOverview(
data: controller.getAllTask(),
headerAxis: Axis.vertical,
crossAxisCount: 6,
crossAxisCellCount: 6,
),
const SizedBox(height: kSpacing * 2),
_buildActiveProject(
data: controller.getActiveProject(),
crossAxisCount: 6,
crossAxisCellCount: 6,
),
const SizedBox(height: kSpacing),
_buildRecentMessages(data: controller.getChatting()),
]);
},
tabletBuilder: (context, constraints) {
return Row(
Expand All @@ -65,7 +99,7 @@ class DashboardScreen extends GetView<DashboardController> {
flex: (constraints.maxWidth < 950) ? 6 : 9,
child: Column(
children: [
const SizedBox(height: kSpacing),
const SizedBox(height: kSpacing * (kIsWeb ? 1 : 2)),
_buildHeader(onPressedMenu: () => controller.openDrawer()),
const SizedBox(height: kSpacing * 2),
_buildProgress(
Expand Down Expand Up @@ -104,7 +138,7 @@ class DashboardScreen extends GetView<DashboardController> {
flex: 4,
child: Column(
children: [
const SizedBox(height: kSpacing / 2),
const SizedBox(height: kSpacing * (kIsWeb ? 0.5 : 1.5)),
_buildProfile(data: controller.getProfil()),
const Divider(thickness: 1),
const SizedBox(height: kSpacing),
Expand Down Expand Up @@ -276,6 +310,7 @@ class DashboardScreen extends GetView<DashboardController> {
addAutomaticKeepAlives: false,
padding: const EdgeInsets.symmetric(horizontal: kSpacing),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return (index == 0)
? Padding(
Expand Down Expand Up @@ -308,6 +343,7 @@ class DashboardScreen extends GetView<DashboardController> {
child: _ActiveProjectCard(
onPressedSeeAll: () {},
child: StaggeredGridView.countBuilder(
physics: const NeverScrollableScrollPhysics(),
crossAxisCount: crossAxisCount,
itemCount: data.length,
addAutomaticKeepAlives: false,
Expand Down

0 comments on commit 3b383bb

Please sign in to comment.