Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(flutter_mobile): linked grid cannot be displayed in document #7162

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:appflowy/plugins/database/application/database_controller.dart';
import 'package:appflowy/plugins/database/application/field/field_info.dart';
import 'package:appflowy/plugins/database/application/row/row_service.dart';
import 'package:appflowy/plugins/database/grid/application/grid_bloc.dart';
import 'package:appflowy/plugins/database/grid/presentation/widgets/shortcuts.dart';
import 'package:appflowy/plugins/database/tab_bar/tab_bar_view.dart';
import 'package:appflowy/shared/flowy_error_page.dart';
import 'package:appflowy/startup/startup.dart';
Expand Down Expand Up @@ -42,6 +41,7 @@ class MobileGridTabBarBuilderImpl extends DatabaseTabBarItemBuilder {
view: view,
databaseController: controller,
initialRowId: initialRowId,
shrinkWrap: shrinkWrap,
);
}

Expand All @@ -68,12 +68,14 @@ class MobileGridPage extends StatefulWidget {
required this.databaseController,
this.onDeleted,
this.initialRowId,
this.shrinkWrap = false,
});

final ViewPB view;
final DatabaseController databaseController;
final VoidCallback? onDeleted;
final String? initialRowId;
final bool shrinkWrap;

@override
State<MobileGridPage> createState() => _MobileGridPageState();
Expand Down Expand Up @@ -104,7 +106,10 @@ class _MobileGridPageState extends State<MobileGridPage> {
finish: (result) {
_openRow(context, widget.initialRowId, true);
return result.successOrFail.fold(
(_) => GridShortcuts(child: GridPageContent(view: widget.view)),
(_) => GridPageContent(
view: widget.view,
shrinkWrap: widget.shrinkWrap,
),
(err) => Center(
child: AppFlowyErrorPage(
error: err,
Expand Down Expand Up @@ -145,9 +150,11 @@ class GridPageContent extends StatefulWidget {
const GridPageContent({
super.key,
required this.view,
this.shrinkWrap = false,
});

final ViewPB view;
final bool shrinkWrap;

@override
State<GridPageContent> createState() => _GridPageContentState();
Expand Down Expand Up @@ -196,6 +203,7 @@ class _GridPageContentState extends State<GridPageContent> {
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_GridHeader(
contentScrollController: contentScrollController,
Expand All @@ -207,11 +215,12 @@ class _GridPageContentState extends State<GridPageContent> {
),
],
),
Positioned(
bottom: 16,
right: 16,
child: getGridFabs(context),
),
if (!widget.shrinkWrap)
Positioned(
bottom: 16,
right: 16,
child: getGridFabs(context),
),
],
),
);
Expand Down Expand Up @@ -256,7 +265,7 @@ class _GridRows extends StatelessWidget {
buildWhen: (previous, current) => previous.fields != current.fields,
builder: (context, state) {
final double contentWidth = getMobileGridContentWidth(state.fields);
return Expanded(
return Flexible(
child: _WrapScrollView(
scrollController: scrollController,
contentWidth: contentWidth,
Expand Down Expand Up @@ -305,6 +314,7 @@ class _GridRows extends StatelessWidget {
return ReorderableListView.builder(
scrollController: scrollController.verticalController,
buildDefaultDragHandles: false,
shrinkWrap: true,
proxyDecorator: (child, index, animation) => Material(
color: Colors.transparent,
child: child,
Expand Down
Loading