TextStyle error
yakppal opened this issue · 4 comments
`import 'package:flutter/material.dart';
class MyApp extends StatefulWidget {
const MyApp({super.key});
@OverRide
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
int number = 0;
void incrementNumber() {
setState(() {
number += 2;
});
}
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Number Incrementer'),
),
body: Center(
child: Text(
'$number',
style: TextStyle(fontSize: 48)
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
incrementNumber();
},
child: const Icon(Icons.add),
),
),
);
}
}
`
- When I insert the code above, it crashes. If I remove style: TextStyle(fontSize: 48), it runs OK. I tried both CompilerWidget and EvalWidget. What could be the issue?
Hi,
This is a bug that I'll fix in the next release.
In the meantime you should be able to work around it by specifying inherit: true
in the TextStyle constructor.
Thank you for such a quick response. I'm testing out both dartpad and flutter_eval. Is there any other known issues like TextStyle?
This wasn't a known issue actually, I just looked into it because you opened this issue and figured out what was going on. There's nothing else that I know of.
Fixed in v0.6.0