W/Choreographer(11277): Frame time is 13.988632 ms in the future! Check that graphics HAL is generating vsync timestamps using the correct timebase.
This is the error produce at run time.
Flutter is not updating setState content and giving this error,
The code is given below
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
runApp(
MaterialApp(
home: Scaffold(
backgroundColor: Colors.redAccent,
appBar: AppBar(
backgroundColor: Colors.red,
title: Center(child: Text('Dicee')),
),
body: MyApp(),
),
),
);
}
class MyApp extends StatefulWidget {
@override
MyAppState createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
int leftDiceNumber = 1;
@override
Widget build(BuildContext context) {
leftDiceNumber = 4;
return Center(
child: Row(
children: <Widget>[
Expanded(
child: FlatButton(
onPressed: () {
setState(() {
leftDiceNumber = (Random().nextInt(6) + 1);
print('images/dice$leftDiceNumber.png');
});
},
child: Image.asset('images/dice$leftDiceNumber.png'),
),
),
Expanded(
child: FlatButton(
onPressed: () {
setState(() {
leftDiceNumber = 5;
});
},
child: Image.asset('images/dice6.png'),
),
),
],
),
);
}
}
please help me out of this