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