skip to Main Content
 TextButton CameraOpeningButton() {
    return TextButton(
      onPressed: () {
        initCamera();
      },
      child: Image(
        image: AssetImage('assets/SVG/CameraButton.png'),
        height: 70,
        width: 70,
      ),
    );
  }
}

This image represents what happens when the button is clicked. A blue animation comes till the button is clicked. And I want to remove it.
This Blue background is to be removed from the button

2

Answers


  1. try this

     TextButton CameraOpeningButton() {
    return TextButton(
      onPressed: () {
        initCamera();
      },
     style: ButtonStyle(
            splashFactory: NoSplash.splashFactory, // this line will help you
          ),
      child: Image(
        image: AssetImage('assets/SVG/CameraButton.png'),
        height: 70,
        width: 70,
      ),
    );
    }
    }
    

    EDIT:
    to make the button circular use this code:

    style: ButtonStyle(
                            shape: MaterialStateProperty.all(
                              CircleBorder(),
                            ),
                          ),
    
    Login or Signup to reply.
  2. Add this code snippet inside your TextButton instance

    style: const ButtonStyle(
      splashFactory: NoSplash.splashFactory
    ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search