Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Models folder created and module models added #99

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/models/animal_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Animal {
final String name;
final String svgAsset;
final String soundAsset;
final Color backgroundColor;

Animal({
required this.name,
required this.svgAsset,
required this.soundAsset,
required this.backgroundColor,
});
}
15 changes: 15 additions & 0 deletions lib/models/bird_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Bird {
final String name;
final String svgAsset;
final String soundAsset;
final Color backgroundColor;

Bird({
required this.name,
required this.svgAsset,
required this.soundAsset,
required this.backgroundColor,
});
}
15 changes: 15 additions & 0 deletions lib/models/colours_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Colours {
final String name;
final String jpgAsset;
final Color bgColor;
final Color fontColor;

Colours({
required this.name,
required this.jpgAsset,
required this.bgColor,
required this.fontColor,
});
}
15 changes: 15 additions & 0 deletions lib/models/itemdata_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class ItemData {
final String iconAsset;
final String title;
final String description;
final Color backgroundColor;

ItemData({
required this.iconAsset,
required this.title,
required this.description,
required this.backgroundColor,
});
}
15 changes: 15 additions & 0 deletions lib/models/occupation_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Occupation {
final String name;
final String description;
final String svgAsset;
final Color backgroundColor;

Occupation({
required this.name,
required this.description,
required this.svgAsset,
required this.backgroundColor,
});
}
15 changes: 15 additions & 0 deletions lib/models/planet_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Planet {
final String name;
final String svgAsset;
final String description;
final Color backgroundColor;

Planet({
required this.name,
required this.svgAsset,
required this.description,
required this.backgroundColor,
});
}
15 changes: 15 additions & 0 deletions lib/models/season_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Season {
final String name;
final String description;
final String imageAsset;
final Color backgroundColor;

Season({
required this.name,
required this.description,
required this.imageAsset,
required this.backgroundColor,
});
}
15 changes: 1 addition & 14 deletions lib/pages/modules/animals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:just_audio/just_audio.dart';
import 'package:learn/models/animal_model.dart';
import 'package:learn/utils/constants.dart';

class Animal {
final String name;
final String svgAsset;
final String soundAsset;
final Color backgroundColor;

Animal({
required this.name,
required this.svgAsset,
required this.soundAsset,
required this.backgroundColor,
});
}

class AnimalsPage extends StatelessWidget {


Expand Down
15 changes: 1 addition & 14 deletions lib/pages/modules/atoz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dart:async';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:learn/models/itemdata_model.dart';

class ItemTile extends StatelessWidget {
final int index;
Expand Down Expand Up @@ -222,20 +223,6 @@ class _PopupDialogState extends State<_PopupDialog> {
}
}

class ItemData {
final String iconAsset;
final String title;
final String description;
final Color backgroundColor;

ItemData({
required this.iconAsset,
required this.title,
required this.description,
required this.backgroundColor,
});
}

class AtoZ extends StatefulWidget {
const AtoZ({Key? key}) : super(key: key);

Expand Down
15 changes: 1 addition & 14 deletions lib/pages/modules/birds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:just_audio/just_audio.dart';
import 'package:learn/models/bird_model.dart';
import 'package:learn/utils/constants.dart';

class Bird {
final String name;
final String svgAsset;
final String soundAsset;
final Color backgroundColor;

Bird({
required this.name,
required this.svgAsset,
required this.soundAsset,
required this.backgroundColor,
});
}

class BirdsPage extends StatelessWidget {


Expand Down
14 changes: 1 addition & 13 deletions lib/pages/modules/colours.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:learn/models/colours_model.dart';

class Colours {
final String name;
final String jpgAsset;
final Color bgColor;
final Color fontColor;

Colours({
required this.name,
required this.jpgAsset,
required this.bgColor,
required this.fontColor,
});
}

class ColoursPage extends StatefulWidget {
const ColoursPage({Key? key}) : super(key: key);
Expand Down
15 changes: 1 addition & 14 deletions lib/pages/modules/occupation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:just_audio/just_audio.dart';
import 'package:learn/models/occupation_model.dart';
import 'package:learn/utils/constants.dart';

class Occupation {
final String name;
final String description;
final String svgAsset;
final Color backgroundColor;

Occupation({
required this.name,
required this.description,
required this.svgAsset,
required this.backgroundColor,
});
}

class OccupationPage extends StatelessWidget {
final FlutterTts flutterTts = FlutterTts();
final AudioPlayer audioPlayer = AudioPlayer();
Expand Down
19 changes: 3 additions & 16 deletions lib/pages/modules/seasons.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:learn/models/season_model.dart';
import 'package:learn/utils/constants.dart';

class Season {
final String name;
final String description;
final String imageAsset;
final Color backgroundColor;

Season({
required this.name,
required this.description,
required this.imageAsset,
required this.backgroundColor,
});
}

class SeasonsPage extends StatelessWidget {
SeasonsPage({Key? key}) : super(key: key);
const SeasonsPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -86,7 +73,7 @@ class SeasonPopup extends StatefulWidget {
final int currentIndex;
final List<Season> seasons;

SeasonPopup({
const SeasonPopup({
required this.currentIndex,
required this.seasons,
});
Expand Down
15 changes: 1 addition & 14 deletions lib/pages/modules/solar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:just_audio/just_audio.dart';

class Planet {
final String name;
final String svgAsset;
final String description;
final Color backgroundColor;

Planet({
required this.name,
required this.svgAsset,
required this.description,
required this.backgroundColor,
});
}
import 'package:learn/models/planet_model.dart';

class PlanetsPage extends StatelessWidget {
final List<Planet> planets = [
Expand Down
12 changes: 7 additions & 5 deletions lib/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import 'dart:ui';

import 'package:learn/models/animal_model.dart';
import 'package:learn/models/bird_model.dart';
import 'package:learn/models/itemdata_model.dart';
import 'package:learn/models/occupation_model.dart';
import 'package:learn/models/season_model.dart';

import '../explore/quiz.dart';
import 'package:flutter/material.dart';
import '../pages/modules/animals.dart';
import '../pages/modules/atoz.dart';
import '../pages/modules/birds.dart';
import '../pages/modules/seasons.dart';
import '../pages/modules/occupation.dart';


class AppConstants {
static const List<String> candidates = [
Expand Down