I have a string like that :
Date:X/X/XX
Time:XX:XX:XX
Speed:Xkm/h
Altitude:XX.Xm
Bat:XX%
maps:google.com/maps?q=YY.YYYYYY,-Z,ZZZZZZ
currently this regex is ok :https://regex101.com/r/5JVdgR/1
But I don't know how I can display Y (latitude variable) and Z (longitude variable) ?
here is an idea of what I search :
var input = "Date:X/X/XX" //Here is my input variable
"Time:XX:XX:XX"
"Speed:Xkm/h"
"Altitude:XX.Xm"
"Bat:XX%"
"maps:google.com/maps?q=14.215465,-1.256584";
void test() { //On push, I want to extract group1 (lat ) and group 2 (long) into two variable
setState(() {
RegExp regExp = new RegExp( //Here is the regex fonction to extract long, lat
r"maps:google\.com\/maps\?q=(-?[0-9]+.[0-9]+),(-?[0-9]+.[0-9]+)",
);
}
);
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
$group1,$group2 //I want to display each variables extracted by regex
),
],
),
),
floatingActionButton: new FloatingActionButton(
onPressed: test,
tooltip: 'test',
child: new Icon(Icons.add),
),
);
}
}