Home > Back-end >  How to fire SMS API in Flutter?
How to fire SMS API in Flutter?

Time:03-04

const String url =
    'http://message.smartwave.co.in/rest/services/sendSMS/sendGroupSms?AUTH_KEY=e&message=&senderId=MyClas&routeId=8&mobileNos=$mobi&smsContentType=';

This is giving me error : Const variables must be initialized with a constant value. Try changing the initializer to be a constant expression

Also Please Guide How to fire this POST API in FLUTTER.

CodePudding user response:

A const variable is processed at compile time. The $mobi in the string is dynamic string interpolation, which can't be combined together with the const keyword. Try removing the const keyword and then, using the url.

Reading more about the const keyword in Dart should clear this up for you.

  • Related