mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: mobile page issues and improvements (#3809)
* chore: update connectivity plus to 5.0.1 * feat: update favorite status on time * fix: text overflow * feat: implement ... button in editor page * fix: align the icon and the text on the favorite page * feat: enable feedback when tapping icons
This commit is contained in:
parent
c0446d7a96
commit
59e0a1325e
@ -147,7 +147,7 @@ EXTERNAL SOURCES:
|
||||
SPEC CHECKSUMS:
|
||||
app_links: 5ef33d0d295a89d9d16bb81b0e3b0d5f70d6c875
|
||||
appflowy_backend: 144c20d8bfb298c4e10fa3fa6701a9f41bf98b88
|
||||
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a
|
||||
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
|
||||
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
|
||||
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
|
||||
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||
|
@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppBarBackButton extends StatelessWidget {
|
||||
const AppBarBackButton({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBarButton(
|
||||
onTap: onTap,
|
||||
child: const Icon(Icons.arrow_back_ios_new),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppBarMoreButton extends StatelessWidget {
|
||||
const AppBarMoreButton({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final void Function(BuildContext context) onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBarButton(
|
||||
onTap: () => onTap(context),
|
||||
child: const Icon(
|
||||
// replace with flowy icon
|
||||
Icons.more_horiz_sharp,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppBarButton extends StatelessWidget {
|
||||
const AppBarButton({
|
||||
super.key,
|
||||
this.extent = 16.0,
|
||||
required this.onTap,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
// used to extend the hit area of the more button
|
||||
final double extent;
|
||||
|
||||
final VoidCallback onTap;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
enableFeedback: true,
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(extent),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FlowyBoxContainer extends StatelessWidget {
|
||||
const FlowyBoxContainer({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 6.0,
|
||||
vertical: 8.0,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.onSecondary,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
@ -1,5 +1,10 @@
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/app_bar_actions.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart';
|
||||
import 'package:appflowy/mobile/presentation/error/error_page.dart';
|
||||
import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart';
|
||||
import 'package:appflowy/workspace/application/view/view_bloc.dart';
|
||||
import 'package:appflowy/workspace/application/view/view_ext.dart';
|
||||
import 'package:appflowy/workspace/application/view/view_service.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
||||
@ -8,6 +13,7 @@ import 'package:dartz/dartz.dart' hide State;
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class MobileViewPage extends StatefulWidget {
|
||||
@ -43,7 +49,8 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
||||
future: future,
|
||||
builder: (context, state) {
|
||||
Widget body;
|
||||
String? title;
|
||||
ViewPB? viewPB;
|
||||
final actions = <Widget>[];
|
||||
if (state.connectionState != ConnectionState.done) {
|
||||
body = const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
@ -54,7 +61,8 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
||||
);
|
||||
} else {
|
||||
body = state.data!.fold((view) {
|
||||
title = view.name;
|
||||
viewPB = view;
|
||||
actions.add(_buildAppBarMoreButton(view));
|
||||
return view.plugin().widgetBuilder.buildWidget(shrinkWrap: false);
|
||||
}, (error) {
|
||||
return MobileErrorPage(
|
||||
@ -62,22 +70,114 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
||||
);
|
||||
});
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
title: FlowyText(
|
||||
title ?? widget.title ?? '',
|
||||
fontSize: 14.0,
|
||||
|
||||
if (viewPB != null) {
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider(
|
||||
create: (_) =>
|
||||
FavoriteBloc()..add(const FavoriteEvent.initial()),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (_) =>
|
||||
ViewBloc(view: viewPB!)..add(const ViewEvent.initial()),
|
||||
),
|
||||
],
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
final view = context.watch<ViewBloc>().state.view;
|
||||
return _buildApp(
|
||||
view,
|
||||
actions,
|
||||
body,
|
||||
);
|
||||
},
|
||||
),
|
||||
leading: BackButton(
|
||||
onPressed: () => context.pop(),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: body,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return _buildApp(
|
||||
null,
|
||||
[],
|
||||
body,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildApp(ViewPB? view, List<Widget> actions, Widget child) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
title: FlowyText.semibold(
|
||||
view?.name ?? widget.title ?? '',
|
||||
fontSize: 14.0,
|
||||
),
|
||||
leading: AppBarBackButton(
|
||||
onTap: () => context.pop(),
|
||||
),
|
||||
actions: actions,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAppBarMoreButton(ViewPB view) {
|
||||
return AppBarMoreButton(
|
||||
onTap: (context) {
|
||||
showMobileBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => _buildViewPageBottomSheet(context),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildViewPageBottomSheet(BuildContext context) {
|
||||
final view = context.read<ViewBloc>().state.view;
|
||||
return ViewPageBottomSheet(
|
||||
view: view,
|
||||
onAction: (action) {
|
||||
switch (action) {
|
||||
case MobileViewBottomSheetBodyAction.duplicate:
|
||||
context.pop();
|
||||
context.read<ViewBloc>().add(const ViewEvent.duplicate());
|
||||
// show toast
|
||||
break;
|
||||
case MobileViewBottomSheetBodyAction.share:
|
||||
// unimplemented
|
||||
context.pop();
|
||||
break;
|
||||
case MobileViewBottomSheetBodyAction.delete:
|
||||
// pop to home page
|
||||
context
|
||||
..pop()
|
||||
..pop();
|
||||
context.read<ViewBloc>().add(const ViewEvent.delete());
|
||||
break;
|
||||
case MobileViewBottomSheetBodyAction.addToFavorites:
|
||||
case MobileViewBottomSheetBodyAction.removeFromFavorites:
|
||||
context.pop();
|
||||
context.read<FavoriteBloc>().add(FavoriteEvent.toggle(view));
|
||||
break;
|
||||
case MobileViewBottomSheetBodyAction.undo:
|
||||
case MobileViewBottomSheetBodyAction.redo:
|
||||
case MobileViewBottomSheetBodyAction.helpCenter:
|
||||
// unimplemented
|
||||
context.pop();
|
||||
break;
|
||||
case MobileViewBottomSheetBodyAction.rename:
|
||||
throw UnimplementedError();
|
||||
}
|
||||
},
|
||||
onRename: (name) {
|
||||
if (name != view.name) {
|
||||
context.read<ViewBloc>().add(ViewEvent.rename(name));
|
||||
}
|
||||
context.pop();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class _MobileViewItemBottomSheetState extends State<MobileViewItemBottomSheet> {
|
||||
|
||||
// body
|
||||
_buildBody(),
|
||||
const VSpace(24.0),
|
||||
const VSpace(12.0),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -109,23 +109,24 @@ class _MobileViewItemBottomSheetState extends State<MobileViewItemBottomSheet> {
|
||||
});
|
||||
break;
|
||||
case MobileViewItemBottomSheetBodyAction.duplicate:
|
||||
context.read<ViewBloc>().add(const ViewEvent.duplicate());
|
||||
context.pop();
|
||||
context.read<ViewBloc>().add(const ViewEvent.duplicate());
|
||||
break;
|
||||
case MobileViewItemBottomSheetBodyAction.share:
|
||||
// unimplemented
|
||||
context.pop();
|
||||
break;
|
||||
case MobileViewItemBottomSheetBodyAction.delete:
|
||||
context.read<ViewBloc>().add(const ViewEvent.delete());
|
||||
context.pop();
|
||||
context.read<ViewBloc>().add(const ViewEvent.delete());
|
||||
|
||||
break;
|
||||
case MobileViewItemBottomSheetBodyAction.addToFavorites:
|
||||
case MobileViewItemBottomSheetBodyAction.removeFromFavorites:
|
||||
context.pop();
|
||||
context
|
||||
.read<FavoriteBloc>()
|
||||
.add(FavoriteEvent.toggle(widget.view));
|
||||
context.pop();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/box_container.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@ -16,21 +17,14 @@ class BottomSheetActionWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
return FlowyBoxContainer(
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
enableFeedback: true,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 12.0,
|
||||
horizontal: 16.0,
|
||||
vertical: 10.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@ -38,7 +32,7 @@ class BottomSheetActionWidget extends StatelessWidget {
|
||||
children: [
|
||||
FlowySvg(
|
||||
svg,
|
||||
size: const Size.square(22.0),
|
||||
size: const Size.square(24.0),
|
||||
blendMode: BlendMode.dst,
|
||||
),
|
||||
const HSpace(6.0),
|
||||
|
@ -65,14 +65,14 @@ class _AddNewPageBody extends StatelessWidget {
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.documents_s,
|
||||
text: LocaleKeys.newDocumentText.tr(),
|
||||
text: LocaleKeys.document_menuName.tr(),
|
||||
onTap: () => onAction(ViewLayoutPB.Document),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.grid_s,
|
||||
text: LocaleKeys.newGridText.tr(),
|
||||
text: LocaleKeys.grid_menuName.tr(),
|
||||
onTap: () => onAction(ViewLayoutPB.Grid),
|
||||
),
|
||||
),
|
||||
@ -86,14 +86,14 @@ class _AddNewPageBody extends StatelessWidget {
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.board_s,
|
||||
text: LocaleKeys.newBoardText.tr(),
|
||||
text: LocaleKeys.board_menuName.tr(),
|
||||
onTap: () => onAction(ViewLayoutPB.Board),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.date_s,
|
||||
text: LocaleKeys.newCalendarText.tr(),
|
||||
text: LocaleKeys.calendar_menuName.tr(),
|
||||
onTap: () => onAction(ViewLayoutPB.Calendar),
|
||||
),
|
||||
),
|
||||
|
@ -6,13 +6,13 @@ class MobileBottomSheetDragHandler extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Container(
|
||||
width: 64,
|
||||
width: 60,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(2.0),
|
||||
color: Colors.grey,
|
||||
color: Theme.of(context).colorScheme.onSecondary,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -0,0 +1,232 @@
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_action_widget.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_drag_handler.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_rename_widget.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_view_item.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_view_item_header.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum MobileViewBottomSheetBodyAction {
|
||||
undo,
|
||||
redo,
|
||||
share,
|
||||
rename,
|
||||
duplicate,
|
||||
delete,
|
||||
addToFavorites,
|
||||
removeFromFavorites,
|
||||
helpCenter;
|
||||
}
|
||||
|
||||
typedef MobileViewBottomSheetBodyActionCallback = void Function(
|
||||
MobileViewBottomSheetBodyAction action,
|
||||
);
|
||||
|
||||
class ViewPageBottomSheet extends StatefulWidget {
|
||||
const ViewPageBottomSheet({
|
||||
super.key,
|
||||
required this.view,
|
||||
required this.onAction,
|
||||
required this.onRename,
|
||||
});
|
||||
|
||||
final ViewPB view;
|
||||
final MobileViewBottomSheetBodyActionCallback onAction;
|
||||
final void Function(String name) onRename;
|
||||
|
||||
@override
|
||||
State<ViewPageBottomSheet> createState() => _ViewPageBottomSheetState();
|
||||
}
|
||||
|
||||
class _ViewPageBottomSheetState extends State<ViewPageBottomSheet> {
|
||||
MobileBottomSheetType type = MobileBottomSheetType.view;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// drag handler
|
||||
const MobileBottomSheetDragHandler(),
|
||||
|
||||
// header
|
||||
_buildHeader(),
|
||||
const VSpace(8.0),
|
||||
const Divider(),
|
||||
|
||||
// body
|
||||
_buildBody(),
|
||||
const VSpace(24.0),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeader() {
|
||||
switch (type) {
|
||||
case MobileBottomSheetType.view:
|
||||
case MobileBottomSheetType.rename:
|
||||
// header
|
||||
return MobileViewItemBottomSheetHeader(
|
||||
showBackButton: type != MobileBottomSheetType.view,
|
||||
view: widget.view,
|
||||
onBack: () {
|
||||
setState(() {
|
||||
type = MobileBottomSheetType.view;
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
switch (type) {
|
||||
case MobileBottomSheetType.view:
|
||||
return MobileViewBottomSheetBody(
|
||||
view: widget.view,
|
||||
onAction: (action) {
|
||||
switch (action) {
|
||||
case MobileViewBottomSheetBodyAction.rename:
|
||||
setState(() {
|
||||
type = MobileBottomSheetType.rename;
|
||||
});
|
||||
break;
|
||||
default:
|
||||
widget.onAction(action);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
case MobileBottomSheetType.rename:
|
||||
return MobileBottomSheetRenameWidget(
|
||||
name: widget.view.name,
|
||||
onRename: (name) {
|
||||
widget.onRename(name);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MobileViewBottomSheetBody extends StatelessWidget {
|
||||
const MobileViewBottomSheetBody({
|
||||
super.key,
|
||||
required this.view,
|
||||
required this.onAction,
|
||||
});
|
||||
|
||||
final ViewPB view;
|
||||
final MobileViewBottomSheetBodyActionCallback onAction;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isFavorite = view.isFavorite;
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
// undo, redo
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_undo_m,
|
||||
text: LocaleKeys.toolbar_undo.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.undo,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_redo_m,
|
||||
text: LocaleKeys.toolbar_redo.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.redo,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// rename, duplicate
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_rename_m,
|
||||
text: LocaleKeys.button_rename.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.rename,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_duplicate_m,
|
||||
text: LocaleKeys.button_duplicate.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.duplicate,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// share, delete
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_share_m,
|
||||
text: LocaleKeys.button_share.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.share,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_delete_m,
|
||||
text: LocaleKeys.button_delete.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.delete,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// favorites
|
||||
BottomSheetActionWidget(
|
||||
svg: isFavorite
|
||||
? FlowySvgs.m_favorite_selected_lg
|
||||
: FlowySvgs.m_favorite_unselected_lg,
|
||||
text: isFavorite
|
||||
? LocaleKeys.button_removeFromFavorites.tr()
|
||||
: LocaleKeys.button_addToFavorites.tr(),
|
||||
onTap: () => onAction(
|
||||
isFavorite
|
||||
? MobileViewBottomSheetBodyAction.removeFromFavorites
|
||||
: MobileViewBottomSheetBodyAction.addToFavorites,
|
||||
),
|
||||
),
|
||||
|
||||
// help center
|
||||
BottomSheetActionWidget(
|
||||
svg: FlowySvgs.m_help_center_m,
|
||||
text: LocaleKeys.button_helpCenter.tr(),
|
||||
onTap: () => onAction(
|
||||
MobileViewBottomSheetBodyAction.helpCenter,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ enum MobilePaneActionType {
|
||||
);
|
||||
case MobilePaneActionType.removeFromFavorites:
|
||||
return MobileSlideActionButton(
|
||||
backgroundColor: Colors.red,
|
||||
backgroundColor: Colors.orange,
|
||||
svg: FlowySvgs.favorite_s,
|
||||
onPressed: (context) => context
|
||||
.read<FavoriteBloc>()
|
||||
@ -61,7 +61,7 @@ enum MobilePaneActionType {
|
||||
child: BlocBuilder<ViewBloc, ViewState>(
|
||||
builder: (context, state) {
|
||||
return MobileViewItemBottomSheet(
|
||||
view: viewBloc.view,
|
||||
view: viewBloc.state.view,
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -58,16 +58,20 @@ class MobileFavoritePageFolder extends StatelessWidget {
|
||||
message: LocaleKeys.favorite_noFavoriteHintText.tr(),
|
||||
);
|
||||
}
|
||||
return SlidableAutoCloseBehavior(
|
||||
child: Column(
|
||||
children: [
|
||||
MobileFavoriteFolder(
|
||||
showHeader: false,
|
||||
forceExpanded: true,
|
||||
views: favoriteState.views,
|
||||
return Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
child: SlidableAutoCloseBehavior(
|
||||
child: Column(
|
||||
children: [
|
||||
MobileFavoriteFolder(
|
||||
showHeader: false,
|
||||
forceExpanded: true,
|
||||
views: favoriteState.views,
|
||||
),
|
||||
const VSpace(100.0),
|
||||
],
|
||||
),
|
||||
const VSpace(100.0),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -82,15 +82,11 @@ class MobileFavoritePage extends StatelessWidget {
|
||||
|
||||
// Folder
|
||||
Expanded(
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: MobileFavoritePageFolder(
|
||||
userProfile: userProfile,
|
||||
workspaceSetting: workspaceSetting,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: MobileFavoritePageFolder(
|
||||
userProfile: userProfile,
|
||||
workspaceSetting: workspaceSetting,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -3,7 +3,6 @@ import 'package:appflowy/mobile/presentation/bottom_sheet/default_mobile_action_
|
||||
import 'package:appflowy/mobile/presentation/home/favorite_folder/mobile_home_favorite_folder_header.dart';
|
||||
import 'package:appflowy/mobile/presentation/page_item/mobile_view_item.dart';
|
||||
import 'package:appflowy/workspace/application/sidebar/folder/folder_bloc.dart';
|
||||
import 'package:appflowy/workspace/application/view/view_bloc.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -67,7 +66,7 @@ class MobileFavoriteFolder extends StatelessWidget {
|
||||
await context.pushView(view);
|
||||
},
|
||||
endActionPane: (context) => buildEndActionPane(context, [
|
||||
context.read<ViewBloc>().view.isFavorite
|
||||
view.isFavorite
|
||||
? MobilePaneActionType.removeFromFavorites
|
||||
: MobilePaneActionType.addToFavorites,
|
||||
MobilePaneActionType.more,
|
||||
|
@ -70,7 +70,9 @@ class MobileHomePageHeader extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
FlowyText.regular(
|
||||
userProfile.email,
|
||||
userProfile.email.isNotEmpty
|
||||
? userProfile.email
|
||||
: userProfile.name,
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.onSurface,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
@ -58,7 +58,9 @@ class MobilePersonalFolder extends StatelessWidget {
|
||||
},
|
||||
endActionPane: (context) => buildEndActionPane(context, [
|
||||
MobilePaneActionType.delete,
|
||||
MobilePaneActionType.addToFavorites,
|
||||
view.isFavorite
|
||||
? MobilePaneActionType.removeFromFavorites
|
||||
: MobilePaneActionType.addToFavorites,
|
||||
MobilePaneActionType.more,
|
||||
]),
|
||||
),
|
||||
|
@ -23,6 +23,7 @@ class MobileBottomNavigationBar extends StatelessWidget {
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
showSelectedLabels: false,
|
||||
showUnselectedLabels: false,
|
||||
enableFeedback: true,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
items: <BottomNavigationBarItem>[
|
||||
BottomNavigationBarItem(
|
||||
|
@ -144,7 +144,6 @@ class InnerMobileViewItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget child = SingleMobileInnerViewItem(
|
||||
key: ValueKey('${categoryType.name} ${view.id} $isExpanded'),
|
||||
view: view,
|
||||
parentView: parentView,
|
||||
level: level,
|
||||
@ -362,7 +361,7 @@ class _SingleMobileInnerViewItemState extends State<SingleMobileInnerViewItem> {
|
||||
|
||||
return GestureDetector(
|
||||
child: AnimatedRotation(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
duration: const Duration(milliseconds: 250),
|
||||
turns: widget.isExpanded ? 0 : -0.25,
|
||||
child: const Icon(
|
||||
Icons.keyboard_arrow_down_rounded,
|
||||
@ -396,12 +395,6 @@ class _SingleMobileInnerViewItemState extends State<SingleMobileInnerViewItem> {
|
||||
},
|
||||
),
|
||||
);
|
||||
// context.read<ViewBloc>().add(
|
||||
// ViewEvent.createView(
|
||||
// LocaleKeys.menuAppHeader_defaultNewPageName.tr(),
|
||||
// ViewLayoutPB.Document,
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -245,10 +245,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: connectivity_plus
|
||||
sha256: "8599ae9edca5ff96163fca3e36f8e481ea917d1e71cdad912c084b5579913f34"
|
||||
sha256: b502a681ba415272ecc41400bd04fe543ed1a62632137dc84d25a91e7746f55f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
version: "5.0.1"
|
||||
connectivity_plus_platform_interface:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -70,8 +70,8 @@ dependencies:
|
||||
package_info_plus: ^4.0.1
|
||||
url_launcher: ^6.1.11
|
||||
clipboard: ^0.1.3
|
||||
connectivity_plus: ^4.0.1
|
||||
connectivity_plus_platform_interface: ^1.2.2
|
||||
connectivity_plus: ^5.0.1
|
||||
connectivity_plus_platform_interface: ^1.2.4
|
||||
easy_localization: ^3.0.2
|
||||
textfield_tags: ^2.0.2
|
||||
device_info_plus: ^9.0.1
|
||||
|
3
frontend/resources/flowy_icons/16x/three-dots.svg
Normal file
3
frontend/resources/flowy_icons/16x/three-dots.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.4 10.1001C3.35025 10.1001 2.5 10.9503 2.5 12.0001C2.5 13.0498 3.35025 13.9001 4.4 13.9001C5.44975 13.9001 6.3 13.0498 6.3 12.0001C6.3 10.9503 5.44975 10.1001 4.4 10.1001ZM12 10.1001C10.9502 10.1001 10.1 10.9503 10.1 12.0001C10.1 13.0498 10.9502 13.9001 12 13.9001C13.0498 13.9001 13.9 13.0498 13.9 12.0001C13.9 10.9503 13.0498 10.1001 12 10.1001ZM19.6 10.1001C18.5502 10.1001 17.7 10.9503 17.7 12.0001C17.7 13.0498 18.5502 13.9001 19.6 13.9001C20.6497 13.9001 21.5 13.0498 21.5 12.0001C21.5 10.9503 20.6497 10.1001 19.6 10.1001Z" fill="#C5C7CB"/>
|
||||
</svg>
|
After Width: | Height: | Size: 662 B |
3
frontend/resources/flowy_icons/24x/back.svg
Normal file
3
frontend/resources/flowy_icons/24x/back.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.7789 5.0217C13.5289 5.0717 13.2779 5.1977 13.1259 5.4277L9.13991 11.4277C8.91691 11.7637 8.91691 12.2167 9.13991 12.5527L13.1259 18.5527C13.4309 19.0117 14.0689 19.1407 14.5269 18.8337C14.9839 18.5277 15.1119 17.8867 14.8069 17.4277L11.1949 11.9897L14.8069 6.5527C15.1119 6.0927 14.9839 5.4527 14.5269 5.1467C14.2979 4.9927 14.0289 4.9707 13.7789 5.0217Z" fill="#C5C7CB"/>
|
||||
</svg>
|
After Width: | Height: | Size: 489 B |
3
frontend/resources/flowy_icons/24x/m_help_center.svg
Normal file
3
frontend/resources/flowy_icons/24x/m_help_center.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.9961 3.90625C9.78709 3.90625 7.99609 5.69725 7.99609 7.90625C7.99609 8.45825 8.44409 8.90625 8.99609 8.90625C9.54809 8.90625 9.99609 8.45825 9.99609 7.90625C9.99609 6.80125 10.8911 5.90625 11.9961 5.90625C13.1011 5.90625 13.9961 6.80125 13.9961 7.90625C13.9961 8.87525 13.6861 9.47526 12.6841 10.8123C11.4361 12.4753 10.9961 13.3752 10.9961 14.9062C10.9961 15.4583 11.4441 15.9062 11.9961 15.9062C12.5481 15.9062 12.9961 15.4583 12.9961 14.9062C12.9961 13.9373 13.3061 13.3372 14.3081 12.0002C15.5561 10.3372 15.9961 9.43725 15.9961 7.90625C15.9961 5.69725 14.2051 3.90625 11.9961 3.90625ZM11.9961 17.9062C11.4441 17.9062 10.9961 18.3542 10.9961 18.9062C10.9961 19.4583 11.4441 19.9062 11.9961 19.9062C12.5481 19.9062 12.9961 19.4583 12.9961 18.9062C12.9961 18.3542 12.5481 17.9062 11.9961 17.9062Z" fill="#2F3030"/>
|
||||
</svg>
|
After Width: | Height: | Size: 933 B |
3
frontend/resources/flowy_icons/24x/m_redo.svg
Normal file
3
frontend/resources/flowy_icons/24x/m_redo.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.9902 17.3967L21.7092 12.7097C22.0992 12.3187 22.0992 11.6627 21.7092 11.2717L16.9902 6.58471L15.5842 7.99072L18.5522 10.9907L7.02124 10.9597C5.89724 10.9597 4.99023 10.0777 4.99023 8.99072V3.99072C4.99023 3.43872 4.54223 2.99072 3.99023 2.99072C3.43823 2.99072 2.99023 3.43872 2.99023 3.99072V8.99072C2.99023 11.1947 4.80724 12.9597 7.02124 12.9597L18.5522 12.9907L15.5842 15.9907L16.9902 17.3967Z" fill="#2F3030"/>
|
||||
</svg>
|
After Width: | Height: | Size: 532 B |
3
frontend/resources/flowy_icons/24x/m_undo.svg
Normal file
3
frontend/resources/flowy_icons/24x/m_undo.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.99587 18.3967L2.27688 13.7097C1.88687 13.3187 1.88687 12.6627 2.27688 12.2717L6.99587 7.58471L8.40188 8.99072L5.43287 11.9907L16.9649 11.9597C18.0889 11.9597 18.9959 11.0777 18.9959 9.99072V4.99072C18.9959 4.43872 19.4439 3.99072 19.9959 3.99072C20.5479 3.99072 20.9959 4.43872 20.9959 4.99072V9.99072C20.9959 12.1947 19.1789 13.9597 16.9649 13.9597L5.43287 13.9907L8.40188 16.9907L6.99587 18.3967Z" fill="#2F3030"/>
|
||||
</svg>
|
After Width: | Height: | Size: 532 B |
@ -222,7 +222,8 @@
|
||||
"share": "Share",
|
||||
"removeFromFavorites": "Remove from favorites",
|
||||
"addToFavorites": "Add to favorites",
|
||||
"rename": "Rename"
|
||||
"rename": "Rename",
|
||||
"helpCenter": "Help Center"
|
||||
},
|
||||
"label": {
|
||||
"welcome": "Welcome!",
|
||||
@ -1008,6 +1009,6 @@
|
||||
},
|
||||
"favorite": {
|
||||
"noFavorite": "No favorite page",
|
||||
"noFavoriteHintText": "slide the page to the left to add it to favorites"
|
||||
"noFavoriteHintText": "Swipe the page to the left to add it to your favorites"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user