Home > Enterprise >  creating a selection menu with flutter
creating a selection menu with flutter

Time:10-24

I would like to know how to make a selection menu as shown in the image (when pressed, the text of the selected menu item is repainted into another one) image is here

CodePudding user response:

From what I am able to understand, I believe you'll need to use action sheets.

The flutter framework comes bundled with a material and a Cupertino action sheet -

CodePudding user response:

You can use a Column to layout that type of view, with a selector for every child.

class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
 return Column(
   children: [
     GestureDetector(
       onTap: (){
         //Take an action like navegate to another route with pressed info
         /*Navigator.push(
               context,
               MaterialPageRoute(builder: (_) => const NextRoute(text : 'girl\boy friend')),);*/
       },
       child: Text(
         'girl/boy friend',
       ),
     ),
     Divider(),
      Text(
       'Just friend',
     ),
     Divider(),
      Text(
       'Mother/father',
     ),
   ],
 );
}
}

Result of that code

  • Related