skip to Main Content
builder: (context, state) {
          if(state.status == RecievingState.success && state.userData != null){
            return  Column(
            children: [  Vibration.vibrate(); //error
            ],)
            },
            }

as soon as the data is changed from API. I want the phone to vibrate within same page…

2

Answers


  1. Column children should be widget only like this

    Column(
    children: <Widget>[
    const Text('hello'),
    const Text('world'),
    ] )
    

    if you want to use vibrate please refer

    Login or Signup to reply.
  2. If you like vibrate every time the if condition get satisfied, you can do :

    builder: (context, state) {
         if(state.status == RecievingState.success && state.userData != null){
            Vibration.vibrate();
            return  Column(
              children: [  
    

    You can add another bool to control the vibrate on the build method.

    If you like to check the state, Use FutureBuilder.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search