Popup message in flutter map

43 views
Skip to first unread message

sona

unread,
Dec 9, 2020, 4:33:12 AM12/9/20
to Flutter Development (flutter-dev)
Hello , please help me to show a popup message in the marker of  flutter map.

builder: (ctx) =>
new Container(
child: IconButton(icon: Icon(Icons.camera_alt,
color: AppTheme.PrimaryColor,
), onPressed: () => {
Navigator.push(context,MaterialPageRoute(builder: (context) => cctv(place: cctvList[i]['place'],
ip: cctvList[i]['ipaddress'],

port: cctvList[i]['port']
)))
}
),
),
));
}
return y;
}

var infoWindowVisible = false;
GlobalKey<State> key = new GlobalKey();


Stack _buildCustomMarker() {
return Stack(
children: <Widget>[popup(), marker()],
);
}

Opacity popup() {
return Opacity(
opacity: infoWindowVisible ? 1.0 : 0.0,
child: Container(
alignment: Alignment.bottomCenter,
width: 279.0,
height: 256.0,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/ic_info_window.png"),
fit: BoxFit.cover)),
),
);
}

Opacity marker() {
return Opacity(
child: Container(
alignment: Alignment.bottomCenter,
child: Image.asset(
'assets/images/ic_marker.png',
width: 49,
height: 65,
)),
opacity: infoWindowVisible ? 0.0 : 1.0,
);
}



class cctv extends StatelessWidget {


final String place;
final String ip;
final String port;

const cctv({Key key, this.place, this.ip, this.port}) : super(key: key);

@override
Widget build(BuildContext context) {
return AlertDialog(backgroundColor:AppTheme.background,


title: Text( place + " Footage"+"IP Address : " + ip + " Port : " + port,style: TextStyle(
fontFamily: AppTheme.fontname,
fontWeight: FontWeight.w700,
color: AppTheme.spacer,
)),


);
}
}


1

Suzuki Tomohiro

unread,
Dec 9, 2020, 8:35:02 AM12/9/20
to Flutter Development (flutter-dev)
You seem to know how to create popup message. Are you having problems?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/CAD04MMCHVSJc3kV1ky6-kzDNrLnBx0u_DLs7fO8biuO5SyJd9g%40mail.gmail.com.

Suzuki Tomohiro

unread,
Dec 9, 2020, 11:16:55 AM12/9/20
to Flutter Development (flutter-dev)
(Respond to the mailing list, not me)

Why don’t you make it stateful?


On Wed, Dec 9, 2020 at 10:10 sona <pson...@gmail.com> wrote:
On this page it was going to another page .But,I want to show popup on the same page  and I have tried using this Maps with Flutter: Custom and dynamic popup over the marker | by Loredana Petrea | Zipper Studios | Medium 

But my widget is stateless .So,It shows error. 
Reply all
Reply to author
Forward
0 new messages