Closed RodrigoRodriguez1 closed 6 months ago
I need to insert an external id in the username
class NewCustomWidget extends StatefulWidget { const NewCustomWidget({ super.key, this.width, this.height, this.onPressed, });
final double? width; final double? height; final Function()? onPressed;
@override State createState() => _NewCustomWidgetState(); }
class _NewCustomWidgetState extends State { @override Widget build(BuildContext context) { // Define container decoration (optional) final BoxDecoration decoration = BoxDecoration( color: FlutterFlowTheme.of(context).primaryColor, borderRadius: BorderRadius.circular(10.0), ); return GestureDetector( onTap: widget.onPressed ?? () => showDialog( context: context, builder: (context) => AlertDialog( title: Text('Alert'), content: Text('teste'), actions: [ TextButton( onPressed: () { OneSignal.Notifications.requestPermission(true); OneSignal.LiveActivities.setupDefault();
var id = OneSignal.User.pushSubscription.id; // it would be here OneSignal.User.setExternalUserId(externalUserId); OneSignal.User.addAlias( OneSignal.User.pushSubscription.id.toString(), "1341524"); Navigator.pop(context); }, child: Text('OK'), ), ], ), ), child: Container( width: widget.width, height: widget.height, decoration: decoration, child: Container(), ));
} }
Use the "login" function instead.
How can we help?
I need to insert an external id in the username
class NewCustomWidget extends StatefulWidget { const NewCustomWidget({ super.key, this.width, this.height, this.onPressed, });
final double? width; final double? height; final Function()? onPressed;
@override State createState() => _NewCustomWidgetState();
}
class _NewCustomWidgetState extends State {
@override
Widget build(BuildContext context) {
// Define container decoration (optional)
final BoxDecoration decoration = BoxDecoration(
color: FlutterFlowTheme.of(context).primaryColor,
borderRadius: BorderRadius.circular(10.0),
);
return GestureDetector(
onTap: widget.onPressed ??
() => showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Alert'),
content: Text('teste'),
actions: [
TextButton(
onPressed: () {
OneSignal.Notifications.requestPermission(true);
OneSignal.LiveActivities.setupDefault();
} }
Code of Conduct