mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: mobile improvements for calendar (#4027)
This commit is contained in:
@ -185,8 +185,8 @@ class _EventIndicator extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 6,
|
||||
height: 6,
|
||||
width: 7,
|
||||
height: 7,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).hintColor,
|
||||
@ -303,8 +303,10 @@ class _DayBadge extends StatelessWidget {
|
||||
dayTextColor = Theme.of(context).colorScheme.onPrimary;
|
||||
}
|
||||
|
||||
final double size = PlatformExtension.isMobile ? 20 : 18;
|
||||
|
||||
return SizedBox(
|
||||
height: 18,
|
||||
height: size,
|
||||
child: Row(
|
||||
mainAxisAlignment: PlatformExtension.isMobile
|
||||
? MainAxisAlignment.center
|
||||
@ -322,12 +324,12 @@ class _DayBadge extends StatelessWidget {
|
||||
color: isToday ? Theme.of(context).colorScheme.primary : null,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
width: isToday ? 18 : null,
|
||||
height: isToday ? 18 : null,
|
||||
width: isToday ? size : null,
|
||||
height: isToday ? size : null,
|
||||
child: Center(
|
||||
child: FlowyText.medium(
|
||||
dayString,
|
||||
fontSize: 11,
|
||||
fontSize: PlatformExtension.isMobile ? 12 : 11,
|
||||
color: dayTextColor,
|
||||
),
|
||||
),
|
||||
|
@ -34,6 +34,7 @@ class EventCard extends StatefulWidget {
|
||||
required this.constraints,
|
||||
required this.autoEdit,
|
||||
this.isDraggable = true,
|
||||
this.padding = EdgeInsets.zero,
|
||||
});
|
||||
|
||||
final FieldController fieldController;
|
||||
@ -43,6 +44,7 @@ class EventCard extends StatefulWidget {
|
||||
final BoxConstraints constraints;
|
||||
final bool autoEdit;
|
||||
final bool isDraggable;
|
||||
final EdgeInsets padding;
|
||||
|
||||
@override
|
||||
State<EventCard> createState() => _EventCardState();
|
||||
@ -180,9 +182,12 @@ class _EventCardState extends State<EventCard> {
|
||||
layoutSettings: settings,
|
||||
);
|
||||
},
|
||||
child: DecoratedBox(
|
||||
decoration: decoration,
|
||||
child: card,
|
||||
child: Padding(
|
||||
padding: widget.padding,
|
||||
child: DecoratedBox(
|
||||
decoration: decoration,
|
||||
child: card,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -194,10 +194,9 @@ class _CalendarPageState extends State<CalendarPage> {
|
||||
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
|
||||
child: MonthView(
|
||||
key: _calendarState,
|
||||
// TODO(Xazin): Border Color on Mobile
|
||||
controller: _eventController,
|
||||
width: constraints.maxWidth,
|
||||
cellAspectRatio: PlatformExtension.isMobile ? 1 : 0.6,
|
||||
cellAspectRatio: PlatformExtension.isMobile ? 0.9 : 0.6,
|
||||
startDay: _weekdayFromInt(firstDayOfWeek),
|
||||
showBorder: false,
|
||||
headerBuilder: _headerNavigatorBuilder,
|
||||
|
@ -1,8 +1,10 @@
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_database_field_editor.dart';
|
||||
import 'package:appflowy/mobile/presentation/widgets/flowy_paginated_bottom_sheet.dart';
|
||||
import 'package:appflowy/plugins/database_view/application/field/field_info.dart';
|
||||
import 'package:appflowy/plugins/database_view/grid/application/grid_bloc.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
@ -42,12 +44,15 @@ class MobileFieldButton extends StatelessWidget {
|
||||
),
|
||||
child: TextButton(
|
||||
onLongPress: () {
|
||||
showMobileBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => MobileDBBottomSheetFieldEditor(
|
||||
viewId: viewId,
|
||||
field: field.field,
|
||||
fieldController: fieldController,
|
||||
showPaginatedBottomSheet(
|
||||
context,
|
||||
page: SheetPage(
|
||||
title: LocaleKeys.grid_field_editProperty.tr(),
|
||||
body: MobileDBBottomSheetFieldEditor(
|
||||
viewId: viewId,
|
||||
field: field.field,
|
||||
fieldController: fieldController,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -190,7 +190,10 @@ extension DatabaseSettingActionExtension on DatabaseSettingAction {
|
||||
layout.name,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
const Icon(Icons.chevron_right),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
],
|
||||
),
|
||||
_ => null,
|
||||
|
@ -23,12 +23,14 @@ class MobileDatabasePropertyEditor extends StatefulWidget {
|
||||
required this.fieldInfo,
|
||||
required this.fieldController,
|
||||
required this.bloc,
|
||||
this.padding = const EdgeInsets.all(16),
|
||||
});
|
||||
|
||||
final String viewId;
|
||||
final FieldInfo fieldInfo;
|
||||
final FieldController fieldController;
|
||||
final DatabasePropertyBloc bloc;
|
||||
final EdgeInsets padding;
|
||||
|
||||
@override
|
||||
State<MobileDatabasePropertyEditor> createState() =>
|
||||
@ -67,7 +69,7 @@ class _MobileDatabasePropertyEditorState
|
||||
context.read<FieldEditorBloc>().typeOptionController;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: widget.padding,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
@ -196,6 +196,7 @@ class _MobileDatabasePropertyCellState
|
||||
fieldInfo: widget.fieldInfo,
|
||||
fieldController: widget.fieldController,
|
||||
bloc: widget.bloc,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user