Skip to content

Commit

Permalink
The model classes moved to models folder in the lib folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Maheen-Ilyas committed May 19, 2024
1 parent 96b65b6 commit fca4f66
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 100 deletions.
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,
});
}
16 changes: 1 addition & 15 deletions lib/pages/modules/animals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,8 @@ 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
16 changes: 1 addition & 15 deletions lib/pages/modules/birds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,11 @@ 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 {


final FlutterTts flutterTts = FlutterTts();
final AudioPlayer audioPlayer = AudioPlayer();

Expand Down
15 changes: 1 addition & 14 deletions lib/pages/modules/colours.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:flutter_svg/flutter_svg.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,
});
}
import 'package:learn/models/colours_model.dart';

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
15 changes: 1 addition & 14 deletions lib/pages/modules/planets.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
15 changes: 1 addition & 14 deletions lib/pages/modules/seasons.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
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);

Expand Down
6 changes: 6 additions & 0 deletions lib/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
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 'package:learn/pages/modules/colours.dart';
Expand Down

0 comments on commit fca4f66

Please sign in to comment.