mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: notification test (#5440)
* fix: notification test * fix: use default emoji font family on iOS * fix: unable to delete duplicated recent view
This commit is contained in:
parent
a1395cb54a
commit
8b04506ac4
@ -8,8 +8,8 @@ import '../../shared/util.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
group('board add row test', () {
|
group('notification test', () {
|
||||||
testWidgets('Add card from header', (tester) async {
|
testWidgets('enable notification', (tester) async {
|
||||||
await tester.initializeAppFlowy();
|
await tester.initializeAppFlowy();
|
||||||
await tester.tapAnonymousSignInButton();
|
await tester.tapAnonymousSignInButton();
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ void main() {
|
|||||||
await tester.openSettingsPage(SettingsPage.notifications);
|
await tester.openSettingsPage(SettingsPage.notifications);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
final switchFinder = find.byType(Switch);
|
final switchFinder = find.byType(Switch).first;
|
||||||
|
|
||||||
// Defaults to enabled
|
// Defaults to enabled
|
||||||
Switch switchWidget = tester.widget(switchFinder);
|
Switch switchWidget = tester.widget(switchFinder);
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
import 'package:appflowy/mobile/application/mobile_router.dart';
|
import 'package:appflowy/mobile/application/mobile_router.dart';
|
||||||
import 'package:appflowy/mobile/presentation/bottom_sheet/default_mobile_action_pane.dart';
|
|
||||||
import 'package:appflowy/mobile/presentation/home/section_folder/mobile_home_section_folder_header.dart';
|
import 'package:appflowy/mobile/presentation/home/section_folder/mobile_home_section_folder_header.dart';
|
||||||
import 'package:appflowy/mobile/presentation/page_item/mobile_view_item.dart';
|
import 'package:appflowy/mobile/presentation/page_item/mobile_view_item.dart';
|
||||||
import 'package:appflowy/workspace/application/menu/sidebar_sections_bloc.dart';
|
import 'package:appflowy/workspace/application/menu/sidebar_sections_bloc.dart';
|
||||||
import 'package:appflowy/workspace/application/sidebar/folder/folder_bloc.dart';
|
import 'package:appflowy/workspace/application/sidebar/folder/folder_bloc.dart';
|
||||||
import 'package:appflowy/workspace/application/view/view_bloc.dart';
|
|
||||||
import 'package:appflowy/workspace/presentation/home/home_sizes.dart';
|
import 'package:appflowy/workspace/presentation/home/home_sizes.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
@ -71,16 +69,6 @@ class MobileSectionFolder extends StatelessWidget {
|
|||||||
leftPadding: HomeSpaceViewSizes.leftPadding,
|
leftPadding: HomeSpaceViewSizes.leftPadding,
|
||||||
isFeedback: false,
|
isFeedback: false,
|
||||||
onSelected: context.pushView,
|
onSelected: context.pushView,
|
||||||
endActionPane: (context) {
|
|
||||||
final view = context.read<ViewBloc>().state.view;
|
|
||||||
return buildEndActionPane(context, [
|
|
||||||
MobilePaneActionType.delete,
|
|
||||||
view.isFavorite
|
|
||||||
? MobilePaneActionType.removeFromFavorites
|
|
||||||
: MobilePaneActionType.addToFavorites,
|
|
||||||
MobilePaneActionType.more,
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -154,6 +154,9 @@ class MobileViewCard extends StatelessWidget {
|
|||||||
Widget _buildTitle(BuildContext context, RecentViewState state) {
|
Widget _buildTitle(BuildContext context, RecentViewState state) {
|
||||||
final name = state.name;
|
final name = state.name;
|
||||||
final icon = state.icon;
|
final icon = state.icon;
|
||||||
|
final fontFamily = Platform.isAndroid || Platform.isLinux
|
||||||
|
? GoogleFonts.notoColorEmoji().fontFamily
|
||||||
|
: null;
|
||||||
return RichText(
|
return RichText(
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@ -164,10 +167,10 @@ class MobileViewCard extends StatelessWidget {
|
|||||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||||
fontSize: 17.0,
|
fontSize: 17.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontFamily: GoogleFonts.notoColorEmoji().fontFamily,
|
fontFamily: fontFamily,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const TextSpan(text: ' '),
|
if (icon.isNotEmpty) const WidgetSpan(child: HSpace(2.0)),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: name,
|
text: name,
|
||||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||||
|
@ -48,13 +48,22 @@ class CachedRecentService {
|
|||||||
Future<FlowyResult<void, FlowyError>> updateRecentViews(
|
Future<FlowyResult<void, FlowyError>> updateRecentViews(
|
||||||
List<String> viewIds,
|
List<String> viewIds,
|
||||||
bool addInRecent,
|
bool addInRecent,
|
||||||
) async =>
|
) async {
|
||||||
FolderEventUpdateRecentViews(
|
final List<String> duplicatedViewIds = [];
|
||||||
UpdateRecentViewPayloadPB(
|
for (final viewId in viewIds) {
|
||||||
viewIds: viewIds,
|
for (final view in _recentViews) {
|
||||||
addInRecent: addInRecent,
|
if (view.item.id == viewId) {
|
||||||
),
|
duplicatedViewIds.add(viewId);
|
||||||
).send();
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FolderEventUpdateRecentViews(
|
||||||
|
UpdateRecentViewPayloadPB(
|
||||||
|
viewIds: addInRecent ? viewIds : duplicatedViewIds,
|
||||||
|
addInRecent: addInRecent,
|
||||||
|
),
|
||||||
|
).send();
|
||||||
|
}
|
||||||
|
|
||||||
Future<FlowyResult<RepeatedRecentViewPB, FlowyError>> _readRecentViews() =>
|
Future<FlowyResult<RepeatedRecentViewPB, FlowyError>> _readRecentViews() =>
|
||||||
FolderEventReadRecentViews().send();
|
FolderEventReadRecentViews().send();
|
||||||
|
@ -138,7 +138,7 @@ class FlowyText extends StatelessWidget {
|
|||||||
|
|
||||||
var fontFamily = this.fontFamily;
|
var fontFamily = this.fontFamily;
|
||||||
var fallbackFontFamily = this.fallbackFontFamily;
|
var fallbackFontFamily = this.fallbackFontFamily;
|
||||||
if (isEmoji) {
|
if (isEmoji && (Platform.isLinux || Platform.isAndroid)) {
|
||||||
fontFamily = _loadEmojiFontFamilyIfNeeded();
|
fontFamily = _loadEmojiFontFamilyIfNeeded();
|
||||||
if (fontFamily != null && fallbackFontFamily == null) {
|
if (fontFamily != null && fallbackFontFamily == null) {
|
||||||
fallbackFontFamily = [fontFamily];
|
fallbackFontFamily = [fontFamily];
|
||||||
|
Loading…
Reference in New Issue
Block a user