ethanblake4 / flutter_eval

Code push for Flutter, powered by dart_eval

Home Page:https://pub.dev/packages/flutter_eval

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TextStyle error

yakppal opened this issue · comments

commented

`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),
),
),
);
}
}
`

  1. 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?

Screenshot 2023-03-10 at 11 07 27 PM
Screenshot 2023-03-10 at 11 07 40 PM

commented

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.

commented

Thank you for such a quick response. I'm testing out both dartpad and flutter_eval. Is there any other known issues like TextStyle?

commented

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.

commented

Fixed in v0.6.0