Теперь, как я могу показать изображение захвата на следующей странице, которое я маршрутизирую с loginPage Активировать кнопку
class LoginFormState extends State<LoginForm> {
File imagefile;
_openCamera(BuildContext context)async{
var picture = await ImagePicker.pickImage(source: ImageSource.camera);
setState(() {
imagefile = picture;
});
}
showImage(){
if(imagefile == null){
return Text("No Image selected here");
}else {
Image.file(imagefile,width:400,height:400);
}
}
var textLength = 6;
var mobileLength = 10;
@override
Widget build(context) {
return Container(
margin: EdgeInsets.only(
top: 0.0,
right: 43.0,
left: 43),
child: Column(
children: [
userField(),
Container(margin: EdgeInsets.only(top: 40.0)),
numberField(),
Container(margin: EdgeInsets.only(top: 60.0, )),
activateButton(),
Container(margin: EdgeInsets.only(top: 60.0, )),
showImage(),
],
),
);
}
Widget activateButton() {
return RaisedButton(
color: Color(0xFFF4D3AE),
child: Text('Activate',
style: TextStyle(
fontFamily: 'Californian FB',
color: Colors.black, //Color(0xFF425c5a),
fontWeight: FontWeight.normal, //bold
letterSpacing: 2.0,
fontSize: 17.0,
)),
padding: EdgeInsets.symmetric(
horizontal: 75.0,
vertical:
15.0), //Activate button box will take more space horizontally & vertically.
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
topRight: Radius.circular(20),
topLeft: Radius.circular(20),
),
),
onPressed: () {
_openCamera(context);
Navigator.of(context).pushNamed("/CameraAccess");
},
);
}
}