feat: date picker ui revamp (#4044)

* feat: date picker editor

* feat: refactor date picker on mobile

* chore: update background color

* feat: date picker UI revamp

* feat: optimize the scroll behavior

* chore: remove unused code
This commit is contained in:
Lucas.Xu
2023-11-29 21:02:04 +08:00
committed by GitHub
parent 551e012147
commit 8665a25b39
18 changed files with 640 additions and 335 deletions

View File

@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
class FlowyOptionDecorateBox extends StatelessWidget {
const FlowyOptionDecorateBox({
super.key,
this.showTopBorder = true,
this.showBottomBorder = true,
required this.child,
});
final bool showTopBorder;
final bool showBottomBorder;
final Widget child;
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
border: Border(
top: showTopBorder
? BorderSide(
color: Theme.of(context).dividerColor,
)
: BorderSide.none,
bottom: showBottomBorder
? BorderSide(
color: Theme.of(context).dividerColor,
)
: BorderSide.none,
),
),
child: child,
);
}
}

View File

@ -0,0 +1,53 @@
import 'package:appflowy/mobile/presentation/widgets/widgets.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
// used in cell editor
class FlowyOptionTile extends StatelessWidget {
const FlowyOptionTile({
super.key,
this.showTopBorder = true,
this.showBottomBorder = true,
required this.text,
this.leftIcon,
this.onTap,
this.leading,
});
final bool showTopBorder;
final bool showBottomBorder;
final String text;
final void Function()? onTap;
final Widget? leftIcon;
final Widget? leading;
@override
Widget build(BuildContext context) {
return FlowyOptionDecorateBox(
showTopBorder: showTopBorder,
showBottomBorder: showBottomBorder,
child: Row(
children: [
FlowyButton(
useIntrinsicWidth: true,
text: FlowyText(
text,
fontSize: 16.0,
),
margin: const EdgeInsets.symmetric(
horizontal: 12.0,
vertical: 16.0,
),
leftIcon: leftIcon,
leftIconSize: const Size.square(24.0),
iconPadding: 8.0,
onTap: onTap,
),
const Spacer(),
leading ?? const SizedBox.shrink(),
const HSpace(12.0),
],
),
);
}
}

View File

@ -1,3 +1,5 @@
export 'show_flowy_mobile_confirm_dialog.dart';
export 'show_flowy_mobile_bottom_sheet.dart';
export 'flowy_mobile_option_decorate_box.dart';
export 'flowy_mobile_state_container.dart';
export 'flowy_option_tile.dart';
export 'show_flowy_mobile_bottom_sheet.dart';
export 'show_flowy_mobile_confirm_dialog.dart';