Skip to content

Commit

Permalink
work
Browse files Browse the repository at this point in the history
  • Loading branch information
guyluz11 committed Apr 14, 2024
1 parent 161d9c1 commit 5a46990
Show file tree
Hide file tree
Showing 17 changed files with 197 additions and 9 deletions.
Binary file added assets/cbj_happy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions lib/domain/study_type_abstract.dart
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,
);
}
}
5 changes: 5 additions & 0 deletions lib/domain/study_type_analytical.dart
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);
}
5 changes: 5 additions & 0 deletions lib/domain/study_type_creatively.dart
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);
}
1 change: 1 addition & 0 deletions lib/presentation/atoms/atoms.dart
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';
17 changes: 17 additions & 0 deletions lib/presentation/atoms/list_tile_atom.dart
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,
);
}
}
1 change: 1 addition & 0 deletions lib/presentation/molecules/molecules.dart
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 lib/presentation/molecules/study_type_selection_molecule.dart
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,
),
),
],
),
);
}
}
8 changes: 8 additions & 0 deletions lib/presentation/organisms/intro/energy_organism.dart
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');
}
}
8 changes: 8 additions & 0 deletions lib/presentation/organisms/intro/motivation_organism.dart
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');
}
}
14 changes: 14 additions & 0 deletions lib/presentation/organisms/intro/study_type_organism.dart
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();
}
}
12 changes: 12 additions & 0 deletions lib/presentation/organisms/intro/tips_organism.dart
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');
}

}
8 changes: 8 additions & 0 deletions lib/presentation/organisms/intro/welcome_organism.dart
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');
}
}
5 changes: 5 additions & 0 deletions lib/presentation/organisms/organisms.dart
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';
21 changes: 15 additions & 6 deletions lib/presentation/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ class HomePage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Center(
child: TimerAtom(controller),
),
ButtonAtom(
variant: ButtonVariant.primary,
onPressed: () => controller.start(),
const TextAtom('Maximize Study efficiency'),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: TimerAtom(controller),
),
ButtonAtom(
variant: ButtonVariant.primary,
onPressed: () => controller.start(),
),
],
),
),
],
),
Expand Down
25 changes: 22 additions & 3 deletions lib/presentation/pages/intro_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:infinite_horizons/presentation/organisms/organisms.dart';
import 'package:infinite_horizons/presentation/pages/home_page.dart';
import 'package:introduction_screen/introduction_screen.dart';

class IntroPage extends StatelessWidget {
Expand All @@ -8,11 +10,28 @@ class IntroPage extends StatelessWidget {
body: IntroductionScreen(
pages: [
PageViewModel(
title: "Fractional shares",
bodyWidget: const Text('wow'),
title: 'Let’s Study Efficiently',
bodyWidget: WelcomeOrganism(),
),
PageViewModel(
title: 'Study Type',
bodyWidget: StudyTypeOrganism(),
),
PageViewModel(
title: 'Efficient Creativity study',
bodyWidget: TipsOrganism(),
),
PageViewModel(
title: 'Energy',
bodyWidget: EnergyOrganism(),
),
PageViewModel(
title: 'Let’s Start',
bodyWidget: MotivationOrganism(),
),
],
onDone: () {},
onDone: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => HomePage())),
showBackButton: true,
//rtl: true, // Display as right-to-left
back: const Icon(Icons.arrow_back),
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ dev_dependencies:

flutter:
uses-material-design: true
assets:
- assets/
- assets/translations/

0 comments on commit 5a46990

Please sign in to comment.