Hello , please help me to show a popup message in the marker of flutter map. On this page it was going to another page .But,I want to show popup on the same page
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 Scaffold(
appBar: AppBar(
title: Text( place + " Footage", style: TextStyle(
fontFamily: AppTheme.fontname,
fontWeight: FontWeight.w700,
color: AppTheme.spacer,
)),
centerTitle: true,
backgroundColor: AppTheme.background,
),
body: Center(
child: Text("IP Address : " + ip + " Port : " + port,style: new TextStyle(fontSize: 20.0,fontWeight: FontWeight.bold),)
),
);
}
}