feat: support select / multi select option (#4039)

* feat: implement select option cell

* feat: support adding new select option

* feat: support selecting / deselecting option

* feat: clear search field after adding new property

* feat: support updating option name
This commit is contained in:
Lucas.Xu
2023-11-29 09:38:53 +08:00
committed by GitHub
parent 8036d070ad
commit 7da759c662
9 changed files with 778 additions and 26 deletions

View File

@ -0,0 +1,49 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
// include single select and multiple select
class EditSelectField extends StatefulWidget {
const EditSelectField({super.key});
@override
State<EditSelectField> createState() => _EditSelectFieldState();
}
class _EditSelectFieldState extends State<EditSelectField> {
@override
Widget build(BuildContext context) {
return Column(
children: [
_SearchField(
hintText: LocaleKeys.grid_selectOption_searchOrCreateOption.tr(),
),
],
);
}
}
class _SearchField extends StatelessWidget {
const _SearchField({
required this.hintText,
});
final String hintText;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 12,
),
child: SizedBox(
height: 44, // the height is fixed.
child: FlowyTextField(
hintText: hintText,
),
),
);
}
}