Skip to content

Instantly share code, notes, and snippets.

@choiks14
Created May 10, 2023 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save choiks14/75676ca2bf87cf291ca0b56c7fe1d8bf to your computer and use it in GitHub Desktop.
Save choiks14/75676ca2bf87cf291ca0b56c7fe1d8bf to your computer and use it in GitHub Desktop.
Container(
color: Colors.transparent,
height: 200,
width: 200,
child: GridView.count(
primary: false,
padding: const EdgeInsets.all(0),
crossAxisSpacing: 8,
mainAxisSpacing: 8,
crossAxisCount: 2,
children: [
ElevatedButton(
onPressed: isEnabled == false ? null : () {
onMenuClick(MenuType.up);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
disabledBackgroundColor: disabledColor,
foregroundColor: activeColor,
elevation: 2
),
child: Align(
child: Transform.rotate(
angle: (math.pi / 180) * 315,
child: SvgUtil(isEnabled ? 'ic_arrow_active' : 'ic_arrow').image()
)
)
),
ElevatedButton(
onPressed: isEnabled == false ? null : () {
onMenuClick(MenuType.right);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
disabledBackgroundColor: disabledColor,
foregroundColor: activeColor,
elevation: 2
),
child: Align(
child: Transform.rotate(
angle: (math.pi / 180) * 45,
child: SvgUtil(isEnabled ? 'ic_arrow_active' : 'ic_arrow').image()
)
)
),
ElevatedButton(
onPressed: isEnabled == false ? null : () {
onMenuClick(MenuType.down);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
disabledBackgroundColor: disabledColor,
foregroundColor: activeColor,
elevation: 2
),
child: Align(
child: Transform.rotate(
angle: (math.pi / 180) * 225,
child: SvgUtil(isEnabled ? 'ic_arrow_active' : 'ic_arrow').image()
)
)
),
ElevatedButton(
onPressed: isEnabled == false ? null : () {
onMenuClick(MenuType.left);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
disabledBackgroundColor: disabledColor,
foregroundColor: activeColor,
elevation: 2
),
child: Align(
child: Transform.rotate(
angle: (math.pi / 180) * 135,
child: SvgUtil(isEnabled ? 'ic_arrow_active' : 'ic_arrow').image()
)
)
)
]
)
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment