我正在AppBar()小部件中创建一个AppBar。检索列表中的元素,以生成PopupMenuButton。
final List<String> entries = <String>['Choose a category','Verbs','Nouns','Adjectives','Adverbs','Determiners','Prepositions','Pronouns','Conjunctions',
我有一个自定义按钮,它接受一个项目的列表。当它被按下时,它会打开一个模态底部工作表,并将该列表传递给底部工作表。 但是,当按钮项发生变化时,它不会更新底部工作表中的项。 怎样才能达到这样的效果。 简单的例子 ButtonsPage
|
Button(items: initialItems)
|
BottomSheet(items: initialItems)
** After a delay, setState is called in ButtonsPage with newItems, thereby sending newItems to the button
我需要获得PopupMenuButton的大小,因为它有一个属性offset,它控制下拉菜单在屏幕上呈现的位置,我希望这个属性能够使下拉菜单的左上角与PopupMenuButton的左下角对齐(见下图)。
我现在的做法是:
extension TextExtension on Text {
/// Calculates the size of the text inside this text widget.
/// note: this method supposes ltr direction of text, which is not always true, but it do