mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
improve Dyn/Topic DraggableScrollableSheet
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
91
lib/common/widgets/draggable_sheet/dyn.dart
Normal file
91
lib/common/widgets/draggable_sheet/dyn.dart
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
part of 'package:PiliPlus/common/widgets/flutter/draggable_scrollable_sheet.dart';
|
||||||
|
|
||||||
|
class DynDraggableScrollableSheet extends DraggableScrollableSheet {
|
||||||
|
const DynDraggableScrollableSheet({
|
||||||
|
super.key,
|
||||||
|
super.initialChildSize,
|
||||||
|
super.minChildSize,
|
||||||
|
super.maxChildSize,
|
||||||
|
super.expand,
|
||||||
|
super.snap,
|
||||||
|
super.snapSizes,
|
||||||
|
super.snapAnimationDuration,
|
||||||
|
super.controller,
|
||||||
|
super.shouldCloseOnMinExtent,
|
||||||
|
required super.builder,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DraggableScrollableSheet> createState() =>
|
||||||
|
_DynDraggableScrollableSheetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DynDraggableScrollableSheetState extends _DraggableScrollableSheetState {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_extent = _DraggableSheetExtent(
|
||||||
|
minSize: widget.minChildSize,
|
||||||
|
maxSize: widget.maxChildSize,
|
||||||
|
snap: widget.snap,
|
||||||
|
snapSizes: _impliedSnapSizes(),
|
||||||
|
snapAnimationDuration: widget.snapAnimationDuration,
|
||||||
|
initialSize: widget.initialChildSize,
|
||||||
|
shouldCloseOnMinExtent: widget.shouldCloseOnMinExtent,
|
||||||
|
);
|
||||||
|
_scrollController = _DynDraggableScrollableSheetScrollController(
|
||||||
|
extent: _extent,
|
||||||
|
);
|
||||||
|
widget.controller?._attach(_scrollController);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DynDraggableScrollableSheetScrollController
|
||||||
|
extends _DraggableScrollableSheetScrollController {
|
||||||
|
_DynDraggableScrollableSheetScrollController({
|
||||||
|
required super.extent,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DraggableScrollableSheetScrollPosition createScrollPosition(
|
||||||
|
ScrollPhysics physics,
|
||||||
|
ScrollContext context,
|
||||||
|
ScrollPosition? oldPosition,
|
||||||
|
) {
|
||||||
|
return _DynDraggableScrollableSheetScrollPosition(
|
||||||
|
physics: physics.applyTo(const AlwaysScrollableScrollPhysics()),
|
||||||
|
context: context,
|
||||||
|
oldPosition: oldPosition,
|
||||||
|
getExtent: () => extent,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DynDraggableScrollableSheetScrollPosition
|
||||||
|
extends _DraggableScrollableSheetScrollPosition {
|
||||||
|
_DynDraggableScrollableSheetScrollPosition({
|
||||||
|
required super.physics,
|
||||||
|
required super.context,
|
||||||
|
super.oldPosition,
|
||||||
|
required super.getExtent,
|
||||||
|
});
|
||||||
|
|
||||||
|
bool _isAtTop = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get listShouldScroll => !_isAtTop || super.listShouldScroll;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void applyUserOffset(double delta) {
|
||||||
|
if (_isAtTop && pixels > 0) {
|
||||||
|
_isAtTop = false;
|
||||||
|
}
|
||||||
|
super.applyUserOffset(delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Drag drag(DragStartDetails details, VoidCallback dragCancelCallback) {
|
||||||
|
_isAtTop = pixels == 0;
|
||||||
|
return super.drag(details, dragCancelCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
74
lib/common/widgets/draggable_sheet/topic.dart
Normal file
74
lib/common/widgets/draggable_sheet/topic.dart
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
part of 'package:PiliPlus/common/widgets/flutter/draggable_scrollable_sheet.dart';
|
||||||
|
|
||||||
|
class TopicDraggableScrollableSheet extends DraggableScrollableSheet {
|
||||||
|
const TopicDraggableScrollableSheet({
|
||||||
|
super.key,
|
||||||
|
super.initialChildSize,
|
||||||
|
super.minChildSize,
|
||||||
|
super.maxChildSize,
|
||||||
|
super.expand,
|
||||||
|
super.snap,
|
||||||
|
super.snapSizes,
|
||||||
|
super.snapAnimationDuration,
|
||||||
|
super.controller,
|
||||||
|
super.shouldCloseOnMinExtent,
|
||||||
|
required super.builder,
|
||||||
|
this.initialScrollOffset = 0.0,
|
||||||
|
});
|
||||||
|
|
||||||
|
final double initialScrollOffset;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DraggableScrollableSheet> createState() =>
|
||||||
|
_TopicDraggableScrollableSheetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TopicDraggableScrollableSheetState
|
||||||
|
extends _DraggableScrollableSheetState {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_extent = _DraggableSheetExtent(
|
||||||
|
minSize: widget.minChildSize,
|
||||||
|
maxSize: widget.maxChildSize,
|
||||||
|
snap: widget.snap,
|
||||||
|
snapSizes: _impliedSnapSizes(),
|
||||||
|
snapAnimationDuration: widget.snapAnimationDuration,
|
||||||
|
initialSize: widget.initialChildSize,
|
||||||
|
shouldCloseOnMinExtent: widget.shouldCloseOnMinExtent,
|
||||||
|
);
|
||||||
|
_scrollController = _TopicDraggableScrollableSheetScrollController(
|
||||||
|
extent: _extent,
|
||||||
|
initialScrollOffset:
|
||||||
|
(widget as TopicDraggableScrollableSheet).initialScrollOffset,
|
||||||
|
);
|
||||||
|
widget.controller?._attach(_scrollController);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TopicDraggableScrollableSheetScrollController
|
||||||
|
extends _DraggableScrollableSheetScrollController {
|
||||||
|
_TopicDraggableScrollableSheetScrollController({
|
||||||
|
required super.extent,
|
||||||
|
double initialScrollOffset = 0.0,
|
||||||
|
}) : _initialScrollOffset = initialScrollOffset;
|
||||||
|
|
||||||
|
@override
|
||||||
|
double get initialScrollOffset => _initialScrollOffset;
|
||||||
|
final double _initialScrollOffset;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DraggableScrollableSheetScrollPosition createScrollPosition(
|
||||||
|
ScrollPhysics physics,
|
||||||
|
ScrollContext context,
|
||||||
|
ScrollPosition? oldPosition,
|
||||||
|
) {
|
||||||
|
return _DraggableScrollableSheetScrollPosition(
|
||||||
|
physics: physics.applyTo(const AlwaysScrollableScrollPhysics()),
|
||||||
|
context: context,
|
||||||
|
oldPosition: oldPosition,
|
||||||
|
getExtent: () => extent,
|
||||||
|
initialPixels: _initialScrollOffset,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,27 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: uri_does_not_exist_in_doc_import, depend_on_referenced_packages
|
|
||||||
|
|
||||||
/// @docImport 'package:flutter/material.dart';
|
|
||||||
/// @docImport 'package:flutter_test/flutter_test.dart';
|
|
||||||
///
|
|
||||||
/// @docImport 'primary_scroll_controller.dart';
|
|
||||||
/// @docImport 'scroll_configuration.dart';
|
|
||||||
/// @docImport 'scroll_view.dart';
|
|
||||||
/// @docImport 'scrollable.dart';
|
|
||||||
/// @docImport 'single_child_scroll_view.dart';
|
|
||||||
/// @docImport 'viewport.dart';
|
|
||||||
library;
|
|
||||||
|
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:PiliPlus/common/widgets/flutter/layout_builder.dart';
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart'
|
import 'package:flutter/material.dart' hide DraggableScrollableSheet;
|
||||||
hide DraggableScrollableSheet, LayoutBuilder;
|
|
||||||
|
part 'package:PiliPlus/common/widgets/draggable_sheet/dyn.dart';
|
||||||
|
part 'package:PiliPlus/common/widgets/draggable_sheet/topic.dart';
|
||||||
|
|
||||||
/// Controls a [DraggableScrollableSheet].
|
/// Controls a [DraggableScrollableSheet].
|
||||||
///
|
///
|
||||||
@@ -730,9 +718,7 @@ class _DraggableScrollableSheetState extends State<DraggableScrollableSheet> {
|
|||||||
/// [_DraggableScrollableSheetScrollController] as the primary controller for
|
/// [_DraggableScrollableSheetScrollController] as the primary controller for
|
||||||
/// descendants.
|
/// descendants.
|
||||||
class _DraggableScrollableSheetScrollController extends ScrollController {
|
class _DraggableScrollableSheetScrollController extends ScrollController {
|
||||||
_DraggableScrollableSheetScrollController({
|
_DraggableScrollableSheetScrollController({required this.extent});
|
||||||
required this.extent,
|
|
||||||
});
|
|
||||||
|
|
||||||
_DraggableSheetExtent extent;
|
_DraggableSheetExtent extent;
|
||||||
VoidCallback? onPositionDetached;
|
VoidCallback? onPositionDetached;
|
||||||
@@ -807,6 +793,7 @@ class _DraggableScrollableSheetScrollPosition
|
|||||||
required super.context,
|
required super.context,
|
||||||
super.oldPosition,
|
super.oldPosition,
|
||||||
required this.getExtent,
|
required this.getExtent,
|
||||||
|
super.initialPixels,
|
||||||
});
|
});
|
||||||
|
|
||||||
VoidCallback? _dragCancelCallback;
|
VoidCallback? _dragCancelCallback;
|
||||||
@@ -817,8 +804,6 @@ class _DraggableScrollableSheetScrollPosition
|
|||||||
|
|
||||||
_DraggableSheetExtent get extent => getExtent();
|
_DraggableSheetExtent get extent => getExtent();
|
||||||
|
|
||||||
bool _isAtTop = true;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void absorb(ScrollPosition other) {
|
void absorb(ScrollPosition other) {
|
||||||
super.absorb(other);
|
super.absorb(other);
|
||||||
@@ -846,9 +831,7 @@ class _DraggableScrollableSheetScrollPosition
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void applyUserOffset(double delta) {
|
void applyUserOffset(double delta) {
|
||||||
if (!_isAtTop) {
|
if (!listShouldScroll &&
|
||||||
super.applyUserOffset(delta);
|
|
||||||
} else if (!listShouldScroll &&
|
|
||||||
(!(extent.isAtMin || extent.isAtMax) ||
|
(!(extent.isAtMin || extent.isAtMax) ||
|
||||||
(extent.isAtMin && delta < 0) ||
|
(extent.isAtMin && delta < 0) ||
|
||||||
(extent.isAtMax && delta > 0))) {
|
(extent.isAtMax && delta > 0))) {
|
||||||
@@ -883,10 +866,6 @@ class _DraggableScrollableSheetScrollPosition
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void goBallistic(double velocity) {
|
void goBallistic(double velocity) {
|
||||||
if (!_isAtTop) {
|
|
||||||
super.goBallistic(velocity);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((velocity == 0.0 && !_shouldSnap()) ||
|
if ((velocity == 0.0 && !_shouldSnap()) ||
|
||||||
(velocity < 0.0 && listShouldScroll) ||
|
(velocity < 0.0 && listShouldScroll) ||
|
||||||
(velocity > 0.0 && extent.isAtMax)) {
|
(velocity > 0.0 && extent.isAtMax)) {
|
||||||
@@ -964,71 +943,12 @@ class _DraggableScrollableSheetScrollPosition
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Drag drag(DragStartDetails details, VoidCallback dragCancelCallback) {
|
Drag drag(DragStartDetails details, VoidCallback dragCancelCallback) {
|
||||||
_isAtTop = pixels == 0;
|
|
||||||
// Save this so we can call it later if we have to [goBallistic] on our own.
|
// Save this so we can call it later if we have to [goBallistic] on our own.
|
||||||
_dragCancelCallback = dragCancelCallback;
|
_dragCancelCallback = dragCancelCallback;
|
||||||
return super.drag(details, dragCancelCallback);
|
return super.drag(details, dragCancelCallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A widget that can notify a descendent [DraggableScrollableSheet] that it
|
|
||||||
/// should reset its position to the initial state.
|
|
||||||
///
|
|
||||||
/// The [Scaffold] uses this widget to notify a persistent bottom sheet that
|
|
||||||
/// the user has tapped back if the sheet has started to cover more of the body
|
|
||||||
/// than when at its initial position. This is important for users of assistive
|
|
||||||
/// technology, where dragging may be difficult to communicate.
|
|
||||||
///
|
|
||||||
/// This is just a wrapper on top of [DraggableScrollableController]. It is
|
|
||||||
/// primarily useful for controlling a sheet in a part of the widget tree that
|
|
||||||
/// the current code does not control (e.g. library code trying to affect a sheet
|
|
||||||
/// in library users' code). Generally, it's easier to control the sheet
|
|
||||||
/// directly by creating a controller and passing the controller to the sheet in
|
|
||||||
/// its constructor (see [DraggableScrollableSheet.controller]).
|
|
||||||
class DraggableScrollableActuator extends StatefulWidget {
|
|
||||||
/// Creates a widget that can notify descendent [DraggableScrollableSheet]s
|
|
||||||
/// to reset to their initial position.
|
|
||||||
///
|
|
||||||
/// The [child] parameter is required.
|
|
||||||
const DraggableScrollableActuator({super.key, required this.child});
|
|
||||||
|
|
||||||
/// This child's [DraggableScrollableSheet] descendant will be reset when the
|
|
||||||
/// [reset] method is applied to a context that includes it.
|
|
||||||
final Widget child;
|
|
||||||
|
|
||||||
/// Notifies any descendant [DraggableScrollableSheet] that it should reset
|
|
||||||
/// to its initial position.
|
|
||||||
///
|
|
||||||
/// Returns `true` if a [DraggableScrollableActuator] is available and
|
|
||||||
/// some [DraggableScrollableSheet] is listening for updates, `false`
|
|
||||||
/// otherwise.
|
|
||||||
static bool reset(BuildContext context) {
|
|
||||||
final _InheritedResetNotifier? notifier = context
|
|
||||||
.dependOnInheritedWidgetOfExactType<_InheritedResetNotifier>();
|
|
||||||
return notifier?._sendReset() ?? false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<DraggableScrollableActuator> createState() =>
|
|
||||||
_DraggableScrollableActuatorState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DraggableScrollableActuatorState
|
|
||||||
extends State<DraggableScrollableActuator> {
|
|
||||||
final _ResetNotifier _notifier = _ResetNotifier();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return _InheritedResetNotifier(notifier: _notifier, child: widget.child);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_notifier.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A [ChangeNotifier] to use with [_InheritedResetNotifier] to notify
|
/// A [ChangeNotifier] to use with [_InheritedResetNotifier] to notify
|
||||||
/// descendants that they should reset to initial state.
|
/// descendants that they should reset to initial state.
|
||||||
class _ResetNotifier extends ChangeNotifier {
|
class _ResetNotifier extends ChangeNotifier {
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -42,11 +42,7 @@ class _DynamicsPageState extends CommonPageState<DynamicsPage>
|
|||||||
theme.colorScheme.secondaryContainer,
|
theme.colorScheme.secondaryContainer,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () => CreateDynPanel.onCreateDyn(context),
|
||||||
if (_dynamicsController.accountService.isLogin.value) {
|
|
||||||
CreateDynPanel.onCreateDyn(context);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
size: 18,
|
size: 18,
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import 'package:PiliPlus/common/style.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||||
import 'package:PiliPlus/common/widgets/button/toolbar_icon_button.dart';
|
import 'package:PiliPlus/common/widgets/button/toolbar_icon_button.dart';
|
||||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||||
import 'package:PiliPlus/common/widgets/flutter/draggable_sheet/draggable_scrollable_sheet_dyn.dart'
|
import 'package:PiliPlus/common/widgets/flutter/draggable_scrollable_sheet.dart';
|
||||||
as dyn_sheet;
|
|
||||||
import 'package:PiliPlus/common/widgets/flutter/text_field/controller.dart';
|
import 'package:PiliPlus/common/widgets/flutter/text_field/controller.dart';
|
||||||
import 'package:PiliPlus/common/widgets/flutter/text_field/text_field.dart';
|
import 'package:PiliPlus/common/widgets/flutter/text_field/text_field.dart';
|
||||||
import 'package:PiliPlus/common/widgets/pair.dart';
|
import 'package:PiliPlus/common/widgets/pair.dart';
|
||||||
@@ -32,8 +31,7 @@ import 'package:PiliPlus/utils/extension/context_ext.dart';
|
|||||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||||
import 'package:PiliPlus/utils/grid.dart';
|
import 'package:PiliPlus/utils/grid.dart';
|
||||||
import 'package:PiliPlus/utils/request_utils.dart';
|
import 'package:PiliPlus/utils/request_utils.dart';
|
||||||
import 'package:flutter/material.dart'
|
import 'package:flutter/material.dart' hide showTimePicker;
|
||||||
hide DraggableScrollableSheet, showTimePicker;
|
|
||||||
import 'package:flutter/services.dart' show LengthLimitingTextInputFormatter;
|
import 'package:flutter/services.dart' show LengthLimitingTextInputFormatter;
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -78,7 +76,7 @@ class CreateDynPanel extends CommonRichTextPubPage {
|
|||||||
context: context,
|
context: context,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
builder: (context) => dyn_sheet.DraggableScrollableSheet(
|
builder: (context) => DynDraggableScrollableSheet(
|
||||||
snap: true,
|
snap: true,
|
||||||
expand: false,
|
expand: false,
|
||||||
initialChildSize: 1,
|
initialChildSize: 1,
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:PiliPlus/common/widgets/flutter/draggable_sheet/draggable_scrollable_sheet_topic.dart'
|
import 'package:PiliPlus/common/widgets/flutter/draggable_scrollable_sheet.dart';
|
||||||
as topic_sheet;
|
|
||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
import 'package:PiliPlus/common/widgets/sliver/sliver_pinned_header.dart';
|
import 'package:PiliPlus/common/widgets/sliver/sliver_pinned_header.dart';
|
||||||
@@ -39,7 +38,7 @@ class DynMentionPanel extends StatefulWidget {
|
|||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: min(600, context.mediaQueryShortestSide),
|
maxWidth: min(600, context.mediaQueryShortestSide),
|
||||||
),
|
),
|
||||||
builder: (context) => topic_sheet.DraggableScrollableSheet(
|
builder: (context) => TopicDraggableScrollableSheet(
|
||||||
expand: false,
|
expand: false,
|
||||||
snap: true,
|
snap: true,
|
||||||
minChildSize: 0,
|
minChildSize: 0,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:PiliPlus/common/widgets/flutter/draggable_sheet/draggable_scrollable_sheet_dyn.dart'
|
import 'package:PiliPlus/common/widgets/flutter/draggable_scrollable_sheet.dart';
|
||||||
show DraggableScrollableSheet;
|
|
||||||
import 'package:PiliPlus/common/widgets/flutter/text_field/text_field.dart';
|
import 'package:PiliPlus/common/widgets/flutter/text_field/text_field.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/http/dynamics.dart';
|
import 'package:PiliPlus/http/dynamics.dart';
|
||||||
@@ -12,7 +11,7 @@ import 'package:PiliPlus/pages/emote/controller.dart';
|
|||||||
import 'package:PiliPlus/pages/emote/view.dart';
|
import 'package:PiliPlus/pages/emote/view.dart';
|
||||||
import 'package:PiliPlus/utils/accounts.dart';
|
import 'package:PiliPlus/utils/accounts.dart';
|
||||||
import 'package:PiliPlus/utils/request_utils.dart';
|
import 'package:PiliPlus/utils/request_utils.dart';
|
||||||
import 'package:flutter/material.dart' hide DraggableScrollableSheet, TextField;
|
import 'package:flutter/material.dart' hide TextField;
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -117,7 +116,7 @@ class _RepostPanelState extends CommonRichTextPubPageState<RepostPanel> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Widget child() => _isMax
|
Widget child() => _isMax
|
||||||
? DraggableScrollableSheet(
|
? DynDraggableScrollableSheet(
|
||||||
snap: true,
|
snap: true,
|
||||||
expand: false,
|
expand: false,
|
||||||
initialChildSize: 1,
|
initialChildSize: 1,
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:PiliPlus/common/widgets/flutter/draggable_sheet/draggable_scrollable_sheet_topic.dart'
|
import 'package:PiliPlus/common/widgets/flutter/draggable_scrollable_sheet.dart';
|
||||||
as topic_sheet;
|
|
||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
|
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
|
||||||
@@ -36,7 +35,7 @@ class SelectTopicPanel extends StatefulWidget {
|
|||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: min(600, context.mediaQueryShortestSide),
|
maxWidth: min(600, context.mediaQueryShortestSide),
|
||||||
),
|
),
|
||||||
builder: (context) => topic_sheet.DraggableScrollableSheet(
|
builder: (context) => TopicDraggableScrollableSheet(
|
||||||
expand: false,
|
expand: false,
|
||||||
snap: true,
|
snap: true,
|
||||||
minChildSize: 0,
|
minChildSize: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user