here is my code,
class ProfileOthers extends StatefulWidget {
const ProfileOthers({super.key, required this.data});
final Map<String, dynamic> data; //I am hoping to make use of this data
@override
State<ProfileOthers> createState() => _ProfileOthersState();
}
Want to pass arguments in stateless widget from another screen, I’m new in flutter.
3
Answers
one simple way to access variables passed through initializing that widget within the build method would be using
where you want like displaying it within a string.
Using the code you provided you could write something like this:
you can access this parameter as shown below,
use this parameter