我不知道我的代码出了什么问题,PopupMenuButton
它不工作,
我已经运行了扑动更新,然而,它似乎没有工作。
下面是我的代码
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:oga_bliss/screen/add_prop_page.dart';
import '../widget/notice_me.dart';
import '../widget/property_app_bar.dart';
import '../widget/property_tile_widget.dart';
enum SampleItem { itemOne, itemTwo, itemThree }
class ProductPropertyPage extends StatefulWidget {
const ProductPropertyPage({Key? key}) : super(key: key);
@override
State<ProductPropertyPage> createState() => _ProductPropertyPageState();
}
class _ProductPropertyPageState extends State<ProductPropertyPage> {
final GlobalKey _menuKey = GlobalKey();
SampleItem? selectedMenu;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
const PropertyAppBar(title: 'Property'),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
NoticeMe(
title: 'Oops!',
desc: 'Your bank account is not yet verify!',
icon: Icons.warning,
icon_color: Colors.red,
border_color: Colors.red,
btnTitle: 'Verify Now',
btnColor: Colors.blue,
onTap: () {},
),
PropertyTileWidget(
props_image_name:
'https://ogabliss.com/project_dir/property/45164d94bc96f243362af5468841cd44.jpg',
props_name: 'Newly Built 3 Bedroom flat',
props_desc:
'this newly built bedroom flat its covered with the latest and later type of euqipment that will keep your day going well',
props_price: '90000000000000',
props_type: 'Buy',
props_bedroom: '100',
props_bathroom: '290',
props_toilet: '100',
onTap: () {
_popUpBUtton();
},
),
PropertyTileWidget(
props_image_name:
'https://ogabliss.com/project_dir/property/45164d94bc96f243362af5468841cd44.jpg',
props_name: 'Newly Built 3 Bedroom flat',
props_desc:
'this newly built bedroom flat its covered with the latest and later type of euqipment that will keep your day going well',
props_price: '90000000000000',
props_type: 'Rent',
props_bedroom: '100',
props_bathroom: '290',
props_toilet: '100',
onTap: () {
_popUpBUtton();
},
),
],
),
),
)
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Get.to(
() => AddPropertyPage(),
transition: Transition.upToDown,
);
},
child: const Icon(Icons.add),
),
);
}
Widget _popUpBUtton() => PopupMenuButton<String>(
enabled: true,
itemBuilder: (context) {
return [
const PopupMenuItem(
child: Text('Submit'),
value: "One",
),
const PopupMenuItem(
child: Text('Edit'),
value: "Two",
),
const PopupMenuItem(
child: Text('Delete'),
value: "Three",
),
];
},
);
}
1条答案
按热度按时间c3frrgcw1#
您不能通过点击其他微件来打开任何微件...而应尝试此操作