Skip to content

Commit

Permalink
Merge pull request #6 from mario-bermonti:self-paced-start
Browse files Browse the repository at this point in the history
Implement self-paced begin screen
  • Loading branch information
mario-bermonti committed Aug 19, 2023
2 parents a12cc73 + 5d2b542 commit 185bcfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/activity/begin_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import 'package:mdigits/common/centeredbox.dart';
import 'package:mdigits/common/default_appbar.dart';
import 'package:mdigits/common/default_text.dart';
import 'package:mdigits/common/spacing_holder.dart';
import 'package:mdigits/mdigits.dart';

/// Screen that allows participants to indicate when to start task.
class BeginView extends StatelessWidget {
const BeginView({Key? key}) : super(key: key);
final Function beginFunction;

const BeginView({Key? key, required this.beginFunction}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -21,12 +24,12 @@ class BeginView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const DefaultText(
'Comencemos',
'Comenzar',
),
const BetweenWidgetsSpace(),
ElevatedButton(
onPressed: () {
// Get.put(MDigits());
beginFunction();
},
child: const DefaultText('Seguir'),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/mdigits.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MDigits extends GetxController {

@override
onReady() {
run();
Get.to(() => BeginView(beginFunction: run));
}

/// Add trial data to the db
Expand Down

0 comments on commit 185bcfe

Please sign in to comment.