Skip to content

Commit

Permalink
hot-fix: wrong responsive when size of screen is small (#1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn authored Jul 10, 2024
1 parent 174926b commit b8006f6
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:fluffychat/pages/chat/events/message/message_style.dart';
import 'package:fluffychat/pages/chat_adaptive_scaffold/chat_adaptive_scaffold_style.dart';
import 'package:fluffychat/presentation/enum/chat/right_column_type_enum.dart';
import 'package:fluffychat/utils/platform_infos.dart';
Expand Down Expand Up @@ -71,7 +72,7 @@ class ChatAdaptiveScaffoldBuilderController

@override
Widget build(BuildContext context) {
final breakpoint = responsiveUtils.getMinDesktopWidth(context);
final breakpoint = getBreakpoint(context);
return ValueListenableBuilder(
valueListenable: rightColumnTypeNotifier,
builder: (context, rightColumnType, body) {
Expand Down Expand Up @@ -145,4 +146,13 @@ class ChatAdaptiveScaffoldBuilderController
child: widget.bodyBuilder(this),
);
}

double getBreakpoint(BuildContext context) {
var breakpoint = responsiveUtils.getMinDesktopWidth(context);
if (breakpoint < 0) {
breakpoint = ResponsiveUtils.minTabletWidth +
MessageStyle.messageBubbleDesktopMaxWidth;
}
return breakpoint;
}
}

0 comments on commit b8006f6

Please sign in to comment.