-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
197 additions
and
9 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class StudyTypeAbstract { | ||
StudyTypeAbstract(this.studyType); | ||
|
||
static StudyTypeAbstract? _instance; | ||
|
||
static StudyTypeAbstract get instance { | ||
return _instance ??= StudyTypeAbstract(StudyType.undefined); | ||
} | ||
|
||
StudyType studyType; | ||
} | ||
|
||
enum StudyType { | ||
undefined, | ||
analytically, | ||
creatively, | ||
; | ||
} | ||
|
||
extension StudyTypeExtension on StudyType { | ||
static StudyType fromString(String typeAsString) { | ||
return StudyType.values.firstWhere( | ||
(element) => element.toString().split('.').last == typeAsString, | ||
orElse: () => StudyType.undefined, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:infinite_horizons/domain/study_type_abstract.dart'; | ||
|
||
class StudyTypeAnalytical extends StudyTypeAbstract { | ||
StudyTypeAnalytical() : super(StudyType.analytically); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:infinite_horizons/domain/study_type_abstract.dart'; | ||
|
||
class StudyTypeCreatively extends StudyTypeAbstract { | ||
StudyTypeCreatively() : super(StudyType.analytically); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export 'package:infinite_horizons/presentation/atoms/button_atom.dart'; | ||
export 'package:infinite_horizons/presentation/atoms/list_tile_atom.dart'; | ||
export 'package:infinite_horizons/presentation/atoms/text_atom.dart'; | ||
export 'package:infinite_horizons/presentation/atoms/timer_atom.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:infinite_horizons/presentation/atoms/atoms.dart'; | ||
|
||
class ListTileAtom extends StatelessWidget { | ||
const ListTileAtom(this.title, this.leading); | ||
|
||
final String title; | ||
final Widget leading; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: TextAtom(title), | ||
leading: leading, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'package:infinite_horizons/presentation/molecules/study_type_selection_molecule.dart'; |
46 changes: 46 additions & 0 deletions
46
lib/presentation/molecules/study_type_selection_molecule.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:infinite_horizons/domain/study_type_abstract.dart'; | ||
import 'package:infinite_horizons/presentation/atoms/atoms.dart'; | ||
|
||
class StudyTypeSelectionMolecule extends StatefulWidget { | ||
@override | ||
State<StudyTypeSelectionMolecule> createState() => | ||
_StudyTypeSelectionMoleculeState(); | ||
} | ||
|
||
class _StudyTypeSelectionMoleculeState | ||
extends State<StudyTypeSelectionMolecule> { | ||
StudyType selectedType = StudyType.undefined; | ||
|
||
void onChanged(StudyType? type) { | ||
setState(() { | ||
selectedType = type ?? StudyType.undefined; | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: Column( | ||
children: [ | ||
ListTileAtom( | ||
StudyType.analytically.name, | ||
Radio<StudyType>( | ||
value: StudyType.analytically, | ||
groupValue: selectedType, | ||
onChanged: onChanged, | ||
), | ||
), | ||
ListTileAtom( | ||
StudyType.creatively.name, | ||
Radio<StudyType>( | ||
value: StudyType.creatively, | ||
groupValue: selectedType, | ||
onChanged: onChanged, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class EnergyOrganism extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return const Text('asd'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class MotivationOrganism extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return const Text('asd'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:infinite_horizons/presentation/molecules/molecules.dart'; | ||
|
||
class StudyTypeOrganism extends StatefulWidget { | ||
@override | ||
State<StudyTypeOrganism> createState() => _StudyTypeOrganismState(); | ||
} | ||
|
||
class _StudyTypeOrganismState extends State<StudyTypeOrganism> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return StudyTypeSelectionMolecule(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
|
||
import 'package:flutter/cupertino.dart'; | ||
|
||
class TipsOrganism extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return const Text('asd'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class WelcomeOrganism extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Image.asset('assets/cbj_happy.png'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export 'package:infinite_horizons/presentation/organisms/intro/energy_organism.dart'; | ||
export 'package:infinite_horizons/presentation/organisms/intro/motivation_organism.dart'; | ||
export 'package:infinite_horizons/presentation/organisms/intro/study_type_organism.dart'; | ||
export 'package:infinite_horizons/presentation/organisms/intro/tips_organism.dart'; | ||
export 'package:infinite_horizons/presentation/organisms/intro/welcome_organism.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,6 @@ dev_dependencies: | |
|
||
flutter: | ||
uses-material-design: true | ||
assets: | ||
- assets/ | ||
- assets/translations/ |