feat: new UI design for number format list (#4537)

This commit is contained in:
Lucas.Xu
2024-01-29 16:34:19 +08:00
committed by GitHub
parent 63c22feb8f
commit 8937856d36
5 changed files with 17 additions and 20 deletions

View File

@ -26,7 +26,7 @@ class FlowySearchTextField extends StatelessWidget {
onSubmitted: onSubmitted, onSubmitted: onSubmitted,
placeholder: hintText, placeholder: hintText,
prefixIcon: const FlowySvg(FlowySvgs.m_search_m), prefixIcon: const FlowySvg(FlowySvgs.m_search_m),
prefixInsets: const EdgeInsets.only(left: 16.0), prefixInsets: const EdgeInsets.only(left: 16.0, right: 2.0),
suffixIcon: const Icon(Icons.close), suffixIcon: const Icon(Icons.close),
suffixInsets: const EdgeInsets.only(right: 16.0), suffixInsets: const EdgeInsets.only(right: 16.0),
placeholderStyle: Theme.of(context).textTheme.titleSmall?.copyWith( placeholderStyle: Theme.of(context).textTheme.titleSmall?.copyWith(

View File

@ -3,6 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/base/flowy_search_text_field.dart';
import 'package:appflowy/mobile/presentation/base/option_color_list.dart'; import 'package:appflowy/mobile/presentation/base/option_color_list.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart'; import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
import 'package:appflowy/mobile/presentation/database/card/card_detail/widgets/widgets.dart'; import 'package:appflowy/mobile/presentation/database/card/card_detail/widgets/widgets.dart';
@ -19,7 +20,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/uuid.dart'; import 'package:flowy_infra/uuid.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:protobuf/protobuf.dart'; import 'package:protobuf/protobuf.dart';
@ -654,8 +654,7 @@ class _NumberOption extends StatelessWidget {
return DraggableScrollableSheet( return DraggableScrollableSheet(
expand: false, expand: false,
snap: true, snap: true,
initialChildSize: 0.6, minChildSize: 0.5,
minChildSize: 0.6,
builder: (context, scrollController) => _NumberFormatList( builder: (context, scrollController) => _NumberFormatList(
scrollController: scrollController, scrollController: scrollController,
selectedFormat: selectedFormat, selectedFormat: selectedFormat,
@ -701,16 +700,7 @@ class _NumberFormatListState extends State<_NumberFormatList> {
Container( Container(
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
height: 44.0, height: 44.0,
child: CupertinoSearchTextField( child: FlowySearchTextField(
prefixIcon: const FlowySvg(FlowySvgs.m_search_m),
prefixInsets: const EdgeInsets.only(left: 16.0),
suffixIcon: const Icon(Icons.close),
suffixInsets: const EdgeInsets.only(right: 16.0),
placeholderStyle: Theme.of(context).textTheme.titleSmall?.copyWith(
color: Theme.of(context).hintColor,
fontWeight: FontWeight.w400,
fontSize: 14.0,
),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
formats = NumberFormatPB.values formats = NumberFormatPB.values
@ -732,19 +722,21 @@ class _NumberFormatListState extends State<_NumberFormatList> {
child: Row( child: Row(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.fromLTRB(
horizontal: 4.0, 4.0,
vertical: 16.0, 16.0,
12.0,
16.0,
), ),
child: FlowyText( child: FlowyText(
element.title(), element.title(),
fontSize: 16, fontSize: 16,
), ),
), ),
const Spacer(),
FlowyText( FlowyText(
element.iconSymbol(), element.iconSymbol(),
fontSize: 16, fontSize: 16,
color: Theme.of(context).hintColor,
), ),
widget.selectedFormat != element widget.selectedFormat != element
? const HSpace(30.0) ? const HSpace(30.0)

View File

@ -111,8 +111,7 @@ class FlowyOptionTile extends StatelessWidget {
leading: leftIcon, leading: leftIcon,
trailing: isSelected trailing: isSelected
? const FlowySvg( ? const FlowySvg(
FlowySvgs.blue_check_s, FlowySvgs.m_blue_check_s,
size: Size.square(24.0),
blendMode: null, blendMode: null,
) )
: null, : null,

View File

@ -65,6 +65,7 @@ Future<bool?> showAddBlockMenu(
showHeader: true, showHeader: true,
showDragHandle: true, showDragHandle: true,
showDoneButton: true, showDoneButton: true,
showCloseButton: true,
barrierColor: Colors.transparent, barrierColor: Colors.transparent,
backgroundColor: theme.toolbarMenuBackgroundColor, backgroundColor: theme.toolbarMenuBackgroundColor,
elevation: 20, elevation: 20,

View File

@ -0,0 +1,5 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Icons 16 / Check">
<path id="Vector" d="M3 10.3L7.76923 16L17 4" stroke="#00BCF0" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 265 B