fix: android toast style

This commit is contained in:
Lucas.Xu 2024-08-30 22:24:58 +08:00
parent 8139065113
commit 85aba663d7
5 changed files with 64 additions and 21 deletions

View File

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/home/mobile_home_page_header.dart'; import 'package:appflowy/mobile/presentation/home/mobile_home_page_header.dart';
import 'package:appflowy/mobile/presentation/home/tab/mobile_space_tab.dart'; import 'package:appflowy/mobile/presentation/home/tab/mobile_space_tab.dart';
@ -197,10 +195,10 @@ class _HomePageState extends State<_HomePage> {
children: [ children: [
// Header // Header
Padding( Padding(
padding: EdgeInsets.only( padding: const EdgeInsets.only(
left: HomeSpaceViewSizes.mHorizontalPadding, left: HomeSpaceViewSizes.mHorizontalPadding,
right: 8.0, right: 8.0,
top: Platform.isAndroid ? 8.0 : 0.0,
), ),
child: MobileHomePageHeader( child: MobileHomePageHeader(
userProfile: widget.userProfile, userProfile: widget.userProfile,

View File

@ -5,6 +5,7 @@ import 'package:appflowy/mobile/presentation/widgets/widgets.dart';
import 'package:appflowy/shared/af_role_pb_extension.dart'; import 'package:appflowy/shared/af_role_pb_extension.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart'; import 'package:appflowy/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart';
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart' show PlatformExtension;
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -72,10 +73,10 @@ class _MemberItem extends StatelessWidget {
final canDelete = myRole.canDelete && member.email != userProfile.email; final canDelete = myRole.canDelete && member.email != userProfile.email;
final textColor = member.role.isOwner ? Theme.of(context).hintColor : null; final textColor = member.role.isOwner ? Theme.of(context).hintColor : null;
Widget child = Container( Widget child;
height: 48,
padding: const EdgeInsets.symmetric(horizontal: 16.0), if (PlatformExtension.isDesktop) {
child: Row( child = Row(
children: [ children: [
Expanded( Expanded(
child: FlowyText.medium( child: FlowyText.medium(
@ -93,7 +94,33 @@ class _MemberItem extends StatelessWidget {
), ),
), ),
], ],
), );
} else {
child = Row(
children: [
Expanded(
child: FlowyText.medium(
member.name,
color: textColor,
fontSize: 15.0,
overflow: TextOverflow.ellipsis,
),
),
const HSpace(36.0),
FlowyText.medium(
member.role.description,
color: textColor,
fontSize: 15.0,
textAlign: TextAlign.end,
),
],
);
}
child = Container(
height: 48,
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: child,
); );
if (canDelete) { if (canDelete) {

View File

@ -1506,7 +1506,7 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
if (items.isNotEmpty) { if (items.isNotEmpty) {
var popUpAnimationStyle = widget.popUpAnimationStyle; var popUpAnimationStyle = widget.popUpAnimationStyle;
if (popUpAnimationStyle == null && if (popUpAnimationStyle == null &&
Theme.of(context).platform == TargetPlatform.iOS) { defaultTargetPlatform == TargetPlatform.iOS) {
popUpAnimationStyle = AnimationStyle( popUpAnimationStyle = AnimationStyle(
curve: Curves.easeInOut, curve: Curves.easeInOut,
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),

View File

@ -321,11 +321,14 @@ class _ConfirmPopupState extends State<ConfirmPopup> {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
}, },
child: Padding( child: Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
vertical: 20.0, vertical: 20.0,
horizontal: 20.0, horizontal: 20.0,
), ),
color: PlatformExtension.isDesktop
? null
: Theme.of(context).colorScheme.surface,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -258,17 +258,32 @@ class FlowyButton extends StatelessWidget {
child = IntrinsicWidth(child: child); child = IntrinsicWidth(child: child);
} }
final decoration = this.decoration ?? var decoration = this.decoration;
if (decoration == null &&
(showDefaultBoxDecorationOnMobile && (showDefaultBoxDecorationOnMobile &&
(Platform.isIOS || Platform.isAndroid) (Platform.isIOS || Platform.isAndroid))) {
? BoxDecoration( decoration = BoxDecoration(
border: Border.all( color: backgroundColor ?? Theme.of(context).colorScheme.surface,
color: borderColor ?? Theme.of(context).colorScheme.outline, );
width: 1.0, }
),
borderRadius: radius, if (decoration == null && (Platform.isIOS || Platform.isAndroid)) {
) if (showDefaultBoxDecorationOnMobile) {
: null); decoration = BoxDecoration(
border: Border.all(
color: borderColor ?? Theme.of(context).colorScheme.outline,
width: 1.0,
),
borderRadius: radius,
);
} else if (backgroundColor != null) {
decoration = BoxDecoration(
color: backgroundColor,
borderRadius: radius,
);
}
}
return Container( return Container(
decoration: decoration, decoration: decoration,