mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-11-27 06:35:53 +03:00
[flutter]: modify action item's gesture behaviour
This commit is contained in:
parent
d8487fcc16
commit
efc1adecdf
@ -40,7 +40,7 @@ class ApplicationBlocObserver extends BlocObserver {
|
||||
@override
|
||||
// ignore: unnecessary_overrides
|
||||
void onTransition(Bloc bloc, Transition transition) {
|
||||
Log.debug("[current]: ${transition.currentState} \n[next]: ${transition.nextState}");
|
||||
// Log.debug("[current]: ${transition.currentState} \n[next]: ${transition.nextState}");
|
||||
super.onTransition(bloc, transition);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_quill/flutter_quill.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
import 'package:flowy_infra/theme.dart';
|
||||
|
||||
@ -7,8 +8,10 @@ DefaultStyles customStyles(BuildContext context) {
|
||||
const baseSpacing = Tuple2<double, double>(6, 0);
|
||||
final defaultTextStyle = DefaultTextStyle.of(context);
|
||||
final baseStyle = defaultTextStyle.style.copyWith(
|
||||
fontSize: 16,
|
||||
fontSize: 18,
|
||||
height: 1.3,
|
||||
fontWeight: FontWeight.w400,
|
||||
letterSpacing: 0.6,
|
||||
);
|
||||
final theme = context.watch<AppTheme>();
|
||||
final themeData = theme.themeData;
|
||||
|
@ -63,6 +63,7 @@ class ActionItem extends StatelessWidget {
|
||||
config: HoverDisplayConfig(hoverColor: theme.hover),
|
||||
builder: (context, onHover) {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () => onSelected(action),
|
||||
child: Row(
|
||||
children: [
|
||||
|
@ -2,16 +2,14 @@ use crate::{
|
||||
entities::doc::{RevId, Revision},
|
||||
errors::DocResult,
|
||||
services::doc::{
|
||||
edit::{
|
||||
message::{DocumentMsg, TransformDeltas},
|
||||
},
|
||||
edit::message::{DocumentMsg, TransformDeltas},
|
||||
Document,
|
||||
},
|
||||
};
|
||||
use async_stream::stream;
|
||||
use flowy_ot::core::{Delta, OperationTransformable};
|
||||
use futures::stream::StreamExt;
|
||||
use std::{convert::TryFrom, sync::Arc};
|
||||
use std::{convert::TryFrom, sync::Arc, thread};
|
||||
use tokio::sync::{mpsc, RwLock};
|
||||
|
||||
pub struct DocumentActor {
|
||||
@ -20,10 +18,7 @@ pub struct DocumentActor {
|
||||
}
|
||||
|
||||
impl DocumentActor {
|
||||
pub fn new(
|
||||
delta: Delta,
|
||||
receiver: mpsc::UnboundedReceiver<DocumentMsg>,
|
||||
) -> Self {
|
||||
pub fn new(delta: Delta, receiver: mpsc::UnboundedReceiver<DocumentMsg>) -> Self {
|
||||
let document = Arc::new(RwLock::new(Document::from_delta(delta)));
|
||||
Self {
|
||||
document,
|
||||
@ -116,12 +111,16 @@ impl DocumentActor {
|
||||
}
|
||||
|
||||
async fn compose_delta(&self, delta: Delta) -> DocResult<()> {
|
||||
let result = self.document.write().await.compose_delta(&delta);
|
||||
// log::debug!("{:?} thread handle_message", thread::current(),);
|
||||
let mut document = self.document.write().await;
|
||||
let result = document.compose_delta(&delta);
|
||||
log::debug!(
|
||||
"Client compose push delta: {}. result: {}",
|
||||
delta.to_json(),
|
||||
self.document.read().await.to_json()
|
||||
document.to_json()
|
||||
);
|
||||
drop(document);
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user