feat: Add formula input screen with unit conversion support
Co-authored-by: aider (openrouter/deepseek/deepseek-r1:free) <aider@aider.chat>
This commit is contained in:
parent
4a4131da7d
commit
45a9a89c3e
1 changed files with 26 additions and 0 deletions
|
|
@ -43,6 +43,32 @@ class _UnitListState extends State<UnitList> {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Units List'),
|
title: const Text('Units List'),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.functions),
|
||||||
|
onPressed: () {
|
||||||
|
final sampleFormula = Formula(
|
||||||
|
name: "Kinetic Energy",
|
||||||
|
input: [
|
||||||
|
VariableSpec(name: 'mass', magnitude: 'kilograms'),
|
||||||
|
VariableSpec(name: 'velocity', magnitude: 'meters_per_second'),
|
||||||
|
],
|
||||||
|
output: VariableSpec(name: 'energy', magnitude: 'joules'),
|
||||||
|
d4rtCode: "main() {\n return 0.5 * mass * velocity * velocity;\n}",
|
||||||
|
);
|
||||||
|
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => FormulaScreen(
|
||||||
|
formula: sampleFormula,
|
||||||
|
corpus: widget.corpus,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue