mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-09-27 01:10:13 +00:00
fix: some UI issues (#3403)
This commit is contained in:
parent
759cb27a43
commit
f6f80b48c9
@ -167,6 +167,29 @@ class EventCard extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
renderHook.addTimestampCellHook((cellData, cardData, _) {
|
||||||
|
return Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 2),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
flex: 3,
|
||||||
|
child: FlowyText.regular(
|
||||||
|
cellData.dateTime,
|
||||||
|
fontSize: 10,
|
||||||
|
color: Theme.of(context).hintColor,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
renderHook.addSelectOptionHook((selectedOptions, cardData, _) {
|
renderHook.addSelectOptionHook((selectedOptions, cardData, _) {
|
||||||
if (selectedOptions.isEmpty) {
|
if (selectedOptions.isEmpty) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
|
@ -114,7 +114,7 @@ class _GridCreateFilterListState extends State<GridCreateFilterList> {
|
|||||||
class _FilterTextFieldDelegate extends SliverPersistentHeaderDelegate {
|
class _FilterTextFieldDelegate extends SliverPersistentHeaderDelegate {
|
||||||
_FilterTextFieldDelegate();
|
_FilterTextFieldDelegate();
|
||||||
|
|
||||||
double fixHeight = 46;
|
double fixHeight = 36;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(
|
Widget build(
|
||||||
@ -123,7 +123,7 @@ class _FilterTextFieldDelegate extends SliverPersistentHeaderDelegate {
|
|||||||
bool overlapsContent,
|
bool overlapsContent,
|
||||||
) {
|
) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
height: fixHeight,
|
height: fixHeight,
|
||||||
child: FlowyTextField(
|
child: FlowyTextField(
|
||||||
hintText: LocaleKeys.grid_settings_filterBy.tr(),
|
hintText: LocaleKeys.grid_settings_filterBy.tr(),
|
||||||
|
@ -105,7 +105,6 @@ class _AddFilterButtonState extends State<AddFilterButton> {
|
|||||||
return AppFlowyPopover(
|
return AppFlowyPopover(
|
||||||
controller: popoverController,
|
controller: popoverController,
|
||||||
constraints: BoxConstraints.loose(const Size(200, 300)),
|
constraints: BoxConstraints.loose(const Size(200, 300)),
|
||||||
margin: const EdgeInsets.all(6),
|
|
||||||
triggerActions: PopoverTriggerFlags.none,
|
triggerActions: PopoverTriggerFlags.none,
|
||||||
child: child,
|
child: child,
|
||||||
popupBuilder: (BuildContext context) {
|
popupBuilder: (BuildContext context) {
|
||||||
|
@ -114,7 +114,7 @@ class _GridCreateSortListState extends State<GridCreateSortList> {
|
|||||||
class _SortTextFieldDelegate extends SliverPersistentHeaderDelegate {
|
class _SortTextFieldDelegate extends SliverPersistentHeaderDelegate {
|
||||||
_SortTextFieldDelegate();
|
_SortTextFieldDelegate();
|
||||||
|
|
||||||
double fixHeight = 46;
|
double fixHeight = 36;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(
|
Widget build(
|
||||||
@ -123,7 +123,7 @@ class _SortTextFieldDelegate extends SliverPersistentHeaderDelegate {
|
|||||||
bool overlapsContent,
|
bool overlapsContent,
|
||||||
) {
|
) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
height: fixHeight,
|
height: fixHeight,
|
||||||
child: FlowyTextField(
|
child: FlowyTextField(
|
||||||
hintText: LocaleKeys.grid_settings_sortBy.tr(),
|
hintText: LocaleKeys.grid_settings_sortBy.tr(),
|
||||||
|
@ -4,6 +4,7 @@ import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart'
|
|||||||
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
|
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
|
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
|
||||||
import 'package:appflowy_backend/log.dart';
|
import 'package:appflowy_backend/log.dart';
|
||||||
|
import 'package:appflowy_backend/protobuf/flowy-database2/timestamp_entities.pb.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
typedef CellRenderHook<C, CustomCardData> = Widget? Function(
|
typedef CellRenderHook<C, CustomCardData> = Widget? Function(
|
||||||
@ -50,6 +51,16 @@ class RowCardRenderHook<CustomCardData> {
|
|||||||
renderHook[FieldType.DateTime] = _typeSafeHook<DateCellDataPB>(hook);
|
renderHook[FieldType.DateTime] = _typeSafeHook<DateCellDataPB>(hook);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add a render hook for [FieldType.LastEditedTime] and [FieldType.CreatedTime]
|
||||||
|
void addTimestampCellHook(
|
||||||
|
CellRenderHook<TimestampCellDataPB, CustomCardData?> hook,
|
||||||
|
) {
|
||||||
|
renderHook[FieldType.LastEditedTime] =
|
||||||
|
_typeSafeHook<TimestampCellDataPB>(hook);
|
||||||
|
renderHook[FieldType.CreatedTime] =
|
||||||
|
_typeSafeHook<TimestampCellDataPB>(hook);
|
||||||
|
}
|
||||||
|
|
||||||
CellRenderHook<dynamic, CustomCardData> _typeSafeHook<C>(
|
CellRenderHook<dynamic, CustomCardData> _typeSafeHook<C>(
|
||||||
CellRenderHook<C, CustomCardData?> hook,
|
CellRenderHook<C, CustomCardData?> hook,
|
||||||
) {
|
) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user