cognition_package 1.3.2 cognition_package: ^1.3.2 copied to clipboard
A Flutter framework for cognitive testing. Contains 14 pre-defined cognitive tests and an API for creating your own.
import 'package:cognition_package/cognition_package.dart';
import 'package:flutter/material.dart';
import 'package:cognition_package_demo_app/user_demographics_page.dart';
Future main() async => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
title: 'Cognition Package Demo',
home: MyHomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
// initialize cognition package
// only used if you load a cognition configuration from a json file
CognitionPackage();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xff003F6E),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(height: 50),
Padding(
padding: const EdgeInsets.all(22.0),
child: Image.asset(
"assets/images/mcat-logo.png",
height: 80,
),
),
Padding(
padding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 25),
child: Column(
children: <Widget>[
Text(
"Welcome to the demo of the Cognition Package, developed by the Copenhagen Center for Health Technology.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, color: Colors.white),
),
Container(height: 5),
Text(
"If you have any questions feel free to contact us at",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, color: Colors.white),
),
Container(height: 5),
Text(
"cph_cachet@gmail.com",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.white,
decoration: TextDecoration.underline),
),
//Container(height: 50),
],
)),
Padding(
padding: const EdgeInsets.only(top: 50),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xffC32C39),
fixedSize: const Size(300, 60),
),
child: Text(
"Get started",
style: TextStyle(fontSize: 18),
),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute<dynamic>(
builder: (context) => UserDemographicsPage()));
},
),
),
],
),
),
bottomNavigationBar: SafeArea(
child: Padding(
padding: const EdgeInsets.all(22.0),
child: Image.asset(
"assets/images/cachet-logo-white.png",
height: 50,
),
)),
);
}
}