some test code to quickly fill te database
This commit is contained in:
parent
bb89cfd2c0
commit
d81de96800
1 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ohthatsa/pages/practice/PracticeDatabase.dart';
|
||||
import 'package:ohthatsa/pages/practice/PracticeSetup.dart';
|
||||
|
@ -226,7 +228,19 @@ class _PracticeState extends State<PracticePage> {
|
|||
practiceThing.next()
|
||||
});
|
||||
if((_startCount - _count) == 0) {
|
||||
|
||||
|
||||
var random = Random();
|
||||
for(var i = 0 ; i < 100 ; i++) {
|
||||
var pa = PracticeAnswer(0, 0, random.nextBool());
|
||||
pa.dateTime = pa.dateTime.add(
|
||||
Duration(days: random.nextInt(90) - 45)
|
||||
);
|
||||
practiceThing.answers.add(pa);
|
||||
}
|
||||
|
||||
PracticeDatabase.insertAnswers(practiceThing.answers, practiceType);
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
child: finishedPracticeDialog()
|
||||
|
|
Loading…
Add table
Reference in a new issue