Skip to content

Commit 6ce10b8

Browse files
committed
add tool calling support with typed output aka something that gemini doesn't support out of the box!
1 parent 037ccdc commit 6ce10b8

File tree

4 files changed

+205
-134
lines changed

4 files changed

+205
-134
lines changed

crossword_companion/lib/screens/crossword_screen.dart

Lines changed: 72 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -17,87 +17,84 @@ class CrosswordScreen extends StatelessWidget {
1717

1818
@override
1919
Widget build(BuildContext context) => Consumer<AppStepState>(
20-
builder: (context, appStepState, child) {
21-
final steps = [
22-
Step(
23-
title: const Text('Select crossword image'),
24-
content: StepOneSelectImage(
25-
isActive: appStepState.currentStep == 0,
26-
),
27-
),
28-
Step(
29-
title: const Text('Verify grid size'),
30-
content: StepTwoVerifyGridSize(
31-
isActive: appStepState.currentStep == 1,
32-
),
20+
builder: (context, appStepState, child) {
21+
final steps = [
22+
Step(
23+
title: const Text('Select crossword image'),
24+
content: StepOneSelectImage(isActive: appStepState.currentStep == 0),
25+
),
26+
Step(
27+
title: const Text('Verify grid size'),
28+
content: StepTwoVerifyGridSize(
29+
isActive: appStepState.currentStep == 1,
3330
),
34-
Step(
35-
title: const Text('Verify grid contents'),
36-
content: StepThreeVerifyGridContents(
37-
isActive: appStepState.currentStep == 2,
38-
),
31+
),
32+
Step(
33+
title: const Text('Verify grid contents'),
34+
content: StepThreeVerifyGridContents(
35+
isActive: appStepState.currentStep == 2,
3936
),
40-
Step(
41-
title: const Text('Verify grid clues'),
42-
content: StepFourVerifyClueText(
43-
isActive: appStepState.currentStep == 3,
44-
),
45-
),
46-
Step(
47-
title: const Text('Solve the puzzle'),
48-
content: StepFiveSolvePuzzle(
49-
isActive: appStepState.currentStep == 4,
50-
),
37+
),
38+
Step(
39+
title: const Text('Verify grid clues'),
40+
content: StepFourVerifyClueText(
41+
isActive: appStepState.currentStep == 3,
5142
),
52-
];
43+
),
44+
Step(
45+
title: const Text('Solve the puzzle'),
46+
content: StepFiveSolvePuzzle(isActive: appStepState.currentStep == 4),
47+
),
48+
];
5349

54-
return Scaffold(
55-
body: Column(
56-
children: [
57-
const Padding(
58-
padding: EdgeInsets.only(left: 32, right: 32, top: 64),
59-
child: SvgPicture(
60-
AssetBytesLoader('assets/cc-title.svg.vec'),
61-
height: 100,
62-
),
50+
return Scaffold(
51+
body: Column(
52+
children: [
53+
const Padding(
54+
padding: EdgeInsets.only(left: 32, right: 32, top: 64),
55+
child: SvgPicture(
56+
AssetBytesLoader('assets/cc-title.svg.vec'),
57+
height: 100,
6358
),
64-
Expanded(
65-
child: Stepper(
66-
currentStep: appStepState.currentStep,
67-
onStepTapped: null,
68-
onStepContinue: null,
69-
onStepCancel: null,
70-
// Hide the default buttons
71-
controlsBuilder: (_, _) => const SizedBox.shrink(),
72-
steps: steps.asMap().entries.map((entry) {
73-
final index = entry.key;
74-
final step = entry.value;
75-
return Step(
76-
title: step.title,
77-
content: step.content,
78-
state: appStepState.currentStep > index
79-
? StepState.complete
80-
: StepState.indexed,
81-
isActive: appStepState.currentStep == index,
82-
);
83-
}).toList(),
84-
),
59+
),
60+
Expanded(
61+
child: Stepper(
62+
currentStep: appStepState.currentStep,
63+
onStepTapped: null,
64+
onStepContinue: null,
65+
onStepCancel: null,
66+
// Hide the default buttons
67+
controlsBuilder: (_, _) => const SizedBox.shrink(),
68+
steps: steps.asMap().entries.map((entry) {
69+
final index = entry.key;
70+
final step = entry.value;
71+
return Step(
72+
title: step.title,
73+
content: step.content,
74+
state: appStepState.currentStep > index
75+
? StepState.complete
76+
: StepState.indexed,
77+
isActive: appStepState.currentStep == index,
78+
);
79+
}).toList(),
8580
),
86-
if (_showScreenWidth)
87-
Container(
88-
color: Colors.grey[200],
89-
padding: const EdgeInsets.all(8),
90-
child: LayoutBuilder(
91-
builder: (context, constraints) => Center(
92-
child: Text(
93-
'Screen width: '
94-
'${constraints.maxWidth.toStringAsFixed(0)}px',
95-
),
81+
),
82+
if (_showScreenWidth)
83+
Container(
84+
color: Colors.grey[200],
85+
padding: const EdgeInsets.all(8),
86+
child: LayoutBuilder(
87+
builder: (context, constraints) => Center(
88+
child: Text(
89+
'Screen width: '
90+
'${constraints.maxWidth.toStringAsFixed(0)}px',
9691
),
9792
),
9893
),
99-
],
100-
),
101-
);
102-
},
103-
);}
94+
),
95+
],
96+
),
97+
);
98+
},
99+
);
100+
}

0 commit comments

Comments
 (0)