sample json fix
This commit is contained in:
@@ -348,6 +348,7 @@ class _DeckImportScreenState extends State<DeckImportScreen> {
|
|||||||
'prompt': 'Sample Question $i?',
|
'prompt': 'Sample Question $i?',
|
||||||
'answers': ['Answer A', 'Answer B', 'Answer C', 'Answer D'],
|
'answers': ['Answer A', 'Answer B', 'Answer C', 'Answer D'],
|
||||||
'correctAnswerIndices': [i % 4],
|
'correctAnswerIndices': [i % 4],
|
||||||
|
if (i == 0) 'explanation': 'Optional explanation shown when viewing question details after an attempt.',
|
||||||
'isKnown': i < 5,
|
'isKnown': i < 5,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
@@ -502,24 +503,18 @@ class _DeckImportScreenState extends State<DeckImportScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Wrap(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
spacing: 8,
|
||||||
children: [
|
runSpacing: 4,
|
||||||
Text(
|
|
||||||
'Deck JSON',
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: _pickJsonFile,
|
onPressed: _pickJsonFile,
|
||||||
icon: const Icon(Icons.folder_open),
|
icon: const Icon(Icons.folder_open, size: 20),
|
||||||
label: const Text('Select file'),
|
label: const Text('Select file'),
|
||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: _loadSampleDeck,
|
onPressed: _loadSampleDeck,
|
||||||
icon: const Icon(Icons.description),
|
icon: const Icon(Icons.description, size: 20),
|
||||||
label: const Text('Load Sample'),
|
label: const Text('Load Sample'),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -529,8 +524,6 @@ class _DeckImportScreenState extends State<DeckImportScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
TextField(
|
TextField(
|
||||||
controller: _jsonController,
|
controller: _jsonController,
|
||||||
|
|||||||
Reference in New Issue
Block a user