I want to create car selling app. I want use car start/stop button on onboarding screen & on tap play car engine start sound? Could you help for creating this widget?
Car start/stop button widget
Creating car start/stop button
I want to create car selling app. I want use car start/stop button on onboarding screen & on tap play car engine start sound? Could you help for creating this widget?
Car start/stop button widget
Creating car start/stop button
You could do something like:
import 'package:flutter/material.dart';
class CarButton extends StatelessWidget {
const CarButton({super.key});
@override
Widget build(BuildContext context) {
bool isPressed = false;
return GestureDetector(
onTap: () {
isPressed = !isPressed;
},
child: Column(
children: [
isPressed
? Container(
height: 10,
width: 30,
color: Colors.green,
)
: Container(
height: 10,
width: 30,
color: Colors.grey,
),
Text('Start'),
Text('Stop')
],
),
);
}
}