diff --git a/android/app/build.gradle b/android/app/build.gradle index d707b80..75e57c3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -24,7 +24,7 @@ if (flutterVersionName == null) { def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { - keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } android { @@ -54,25 +54,26 @@ android { applicationId "vdrs.sappu.lafk.learn" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 21 + minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + multiDexEnabled true } signingConfigs { - release { - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null - storePassword keystoreProperties['storePassword'] - } - } - buildTypes { - release { - signingConfig signingConfigs.release - } - } + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } + buildTypes { + release { + signingConfig signingConfigs.release + } + } } @@ -80,4 +81,6 @@ flutter { source '../..' } -dependencies {} +dependencies { + implementation 'com.android.support:multidex:1.0.3' +} diff --git a/assets/seasons/autumn.svg b/assets/seasons/autumn.svg new file mode 100644 index 0000000..b072158 --- /dev/null +++ b/assets/seasons/autumn.svg @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/assets/seasons/spring.svg b/assets/seasons/spring.svg new file mode 100644 index 0000000..4f70f0b --- /dev/null +++ b/assets/seasons/spring.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/assets/seasons/summer.svg b/assets/seasons/summer.svg new file mode 100644 index 0000000..3c4add6 --- /dev/null +++ b/assets/seasons/summer.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/seasons/winter.svg b/assets/seasons/winter.svg new file mode 100644 index 0000000..e3f87ac --- /dev/null +++ b/assets/seasons/winter.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/lib/main.dart b/lib/main.dart index 95a9fe7..51f21ec 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,6 +9,7 @@ import 'package:learn/pages/modules/animals.dart'; import 'package:learn/pages/explore.dart'; import 'package:learn/pages/favorite.dart'; import 'package:learn/pages/modules/parts.dart'; +import 'package:learn/pages/modules/seasons.dart'; import 'package:learn/pages/modules/shapes.dart'; import 'package:learn/pages/modules/solar.dart'; import 'package:learn/utils/routes.dart'; @@ -68,6 +69,7 @@ class MyApp extends StatelessWidget { AllRoutes.flowerRoute: (context) => const FlowerPage(), AllRoutes.exploreRoute: (context) => const ExplorePage(), AllRoutes.favoriteRoute: (context) => const FavoritePage(), + AllRoutes.seasonRoute: (context) => SeasonsPage(), }, ); }, @@ -76,6 +78,3 @@ class MyApp extends StatelessWidget { ); } } - - - diff --git a/lib/pages/modules/seasons.dart b/lib/pages/modules/seasons.dart new file mode 100644 index 0000000..1de3e79 --- /dev/null +++ b/lib/pages/modules/seasons.dart @@ -0,0 +1,178 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.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); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text( + 'Seasons Serenade', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + body: ListView.builder( + itemCount: AppConstants.seasons.length, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + _showSeasonPopup(context, index); + }, + child: Container( + margin: const EdgeInsets.all(5.0), + padding: const EdgeInsets.all(8.0), + decoration: BoxDecoration( + border: Border.all(color: Colors.black, width: 1.0), + borderRadius: BorderRadius.circular(8.0), + color: AppConstants.seasons[index].backgroundColor, + ), + child: Row( + children: [ + SizedBox( + width: 50, + height: 50, + child: SvgPicture.asset( + AppConstants.seasons[index].imageAsset), + ), + const SizedBox(width: 28.0), + Text( + AppConstants.seasons[index].name, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 30.0, + fontFamily: 'Comic', + ), + ), + ], + ), + ), + ); + }, + ), + ); + } + + void _showSeasonPopup(BuildContext context, int index) { + showDialog( + context: context, + builder: (BuildContext context) { + return SeasonPopup( + currentIndex: index, + seasons: AppConstants.seasons, + ); + }, + ); + } +} + +class SeasonPopup extends StatefulWidget { + final int currentIndex; + final List seasons; + + SeasonPopup({ + required this.currentIndex, + required this.seasons, + }); + + @override + _SeasonPopupState createState() => _SeasonPopupState(); +} + +class _SeasonPopupState extends State { + late int currentIndex; + + @override + void initState() { + super.initState(); + currentIndex = widget.currentIndex; + } + + @override + Widget build(BuildContext context) { + Season currentSeason = widget.seasons[currentIndex]; + + return AlertDialog( + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + currentSeason.name, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 200, + height: 200, + child: SvgPicture.asset(currentSeason.imageAsset), + ), + const SizedBox(height: 16), + Text( + currentSeason.description, + style: const TextStyle(fontSize: 16.0), + ), + ], + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + onPressed: _navigateToPreviousSeason, + icon: const Icon(Icons.arrow_back), + ), + ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.red), + ), + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text( + 'Close', + style: TextStyle(color: Colors.white), + ), + ), + IconButton( + onPressed: _navigateToNextSeason, + icon: const Icon(Icons.arrow_forward), + ), + ], + ), + ], + ); + } + + void _navigateToPreviousSeason() { + setState(() { + currentIndex = + (currentIndex - 1 + widget.seasons.length) % widget.seasons.length; + }); + } + + void _navigateToNextSeason() { + setState(() { + currentIndex = (currentIndex + 1) % widget.seasons.length; + }); + } +} diff --git a/lib/pages/modules/solar.dart b/lib/pages/modules/solar.dart index ad6e3f7..4780968 100644 --- a/lib/pages/modules/solar.dart +++ b/lib/pages/modules/solar.dart @@ -2,14 +2,13 @@ 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/main.dart'; - + class Planet { final String name; final String svgAsset; final String description; final Color backgroundColor; - + Planet({ required this.name, required this.svgAsset, @@ -17,7 +16,7 @@ class Planet { required this.backgroundColor, }); } - + class PlanetsPage extends StatelessWidget { final List planets = [ Planet( @@ -75,12 +74,12 @@ class PlanetsPage extends StatelessWidget { backgroundColor: const Color.fromARGB(255, 64, 90, 200), ), ]; - + final FlutterTts flutterTts = FlutterTts(); final AudioPlayer audioPlayer = AudioPlayer(); - + PlanetsPage({Key? key}) : super(key: key); - + @override Widget build(BuildContext context) { return Scaffold( @@ -106,28 +105,28 @@ class PlanetsPage extends StatelessWidget { ); } } - + class PlanetWidget extends StatefulWidget { final List planets; final FlutterTts flutterTts; final AudioPlayer audioPlayer; - + const PlanetWidget({ Key? key, required this.planets, required this.flutterTts, required this.audioPlayer, }) : super(key: key); - + @override _PlanetWidgetState createState() => _PlanetWidgetState(); } - + class _PlanetWidgetState extends State { int currentIndex = 0; - + final _animationDuration = const Duration(milliseconds: 500); - + @override Widget build(BuildContext context) { Planet planet = widget.planets[currentIndex]; @@ -190,22 +189,22 @@ class _PlanetWidgetState extends State { ], ); } - + void _navigateToNextPlanet() { setState(() { currentIndex = (currentIndex + 1) % widget.planets.length; }); } - + void _navigateToPreviousPlanet() { setState(() { currentIndex = (currentIndex - 1 + widget.planets.length) % widget.planets.length; }); } - + Future _playPlanetName(String name) async { await widget.flutterTts.setLanguage("en-US"); await widget.flutterTts.speak(name); } -} \ No newline at end of file +} diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index b2c4175..1ad9203 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -1,8 +1,11 @@ import 'dart:ui'; +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'; class AppConstants { static const List candidates = [ @@ -449,6 +452,37 @@ class AppConstants { ), ]; + static List seasons = [ + Season( + name: 'Spring', + description: + 'Spring is the season of new beginnings. Fresh buds bloom and animals awaken.', + imageAsset: 'assets/seasons/spring.svg', + backgroundColor: Colors.lightGreen, + ), + Season( + name: 'Summer', + description: + 'Summer is the hottest of the four temperate seasons, falling after spring and before autumn.', + imageAsset: 'assets/seasons/summer.svg', + backgroundColor: Colors.yellowAccent.shade400, + ), + Season( + name: 'Autumn', + description: + 'Autumn is the season of the year between summer and winter, during which temperatures gradually decrease.', + imageAsset: 'assets/seasons/autumn.svg', + backgroundColor: Colors.orangeAccent, + ), + Season( + name: 'Winter', + description: + 'Winter is the coldest season of the year in polar and temperate zones.', + imageAsset: 'assets/seasons/winter.svg', + backgroundColor: Colors.lightBlue, + ), + ]; + static const String underConstruction = 'Page Under Construction.\nIt will not take much time.'; diff --git a/lib/utils/routes.dart b/lib/utils/routes.dart index 981ed55..9765aa2 100644 --- a/lib/utils/routes.dart +++ b/lib/utils/routes.dart @@ -1,4 +1,3 @@ - class AllRoutes { static String loginRoute = "/login"; static String homeRoute = "/home"; @@ -13,5 +12,5 @@ class AllRoutes { static String aboutRoute = "/about"; static String colourRoute = "/colours"; static String flowerRoute = "/flowers"; - + static String seasonRoute = "/seasons"; } diff --git a/lib/widgets/drawer.dart b/lib/widgets/drawer.dart index b60c5ac..60e37d3 100644 --- a/lib/widgets/drawer.dart +++ b/lib/widgets/drawer.dart @@ -31,7 +31,6 @@ class MyDrawer extends StatelessWidget { style: Theme.of(context).textTheme.bodyLarge, ), currentAccountPicture: const CircleAvatar( - backgroundImage: AssetImage("assets/images/dp.png"), ), ), @@ -68,6 +67,14 @@ class MyDrawer extends StatelessWidget { }, context: context, ), + _buildListTile( + icon: Icons.cloud, + title: "Seasons", + onTap: () { + Navigator.pushNamed(context, AllRoutes.seasonRoute); + }, + context: context, + ), _buildListTile( icon: Icons.pentagon_outlined, title: "Shapes", @@ -137,6 +144,7 @@ class MyDrawer extends StatelessWidget { onTap: onTap, ); } + Widget _buildListTileSVG({ required BuildContext context, required String icon, @@ -144,7 +152,12 @@ class MyDrawer extends StatelessWidget { required VoidCallback onTap, }) { return ListTile( - leading: SvgPicture.asset(icon,height: 24,width: 24,color: const Color(0xFF49454f),), + leading: SvgPicture.asset( + icon, + height: 24, + width: 24, + color: const Color(0xFF49454f), + ), title: Text( title, style: Theme.of(context).textTheme.bodyLarge, diff --git a/pubspec.lock b/pubspec.lock index cd7e9d7..d0eaeb1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -204,10 +204,10 @@ packages: dependency: transitive description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.0" http_parser: dependency: transitive description: @@ -236,34 +236,34 @@ packages: dependency: transitive description: name: just_audio_web - sha256: "134356b0fe3d898293102b33b5fd618831ffdc72bb7a1b726140abdf22772b70" + sha256: d91a7dcc3e775b5bbc5123f82220f9b69a1cf7be4328cf49abf8a4952b3f2de4 url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.4.10" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" lints: dependency: transitive description: @@ -292,10 +292,10 @@ packages: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" nested: dependency: transitive description: @@ -452,10 +452,10 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.2.2" shared_preferences_windows: dependency: transitive description: @@ -521,10 +521,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" typed_data: dependency: transitive description: @@ -585,10 +585,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.2.3" url_launcher_windows: dependency: transitive description: @@ -641,26 +641,26 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.1" web: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.4.2" win32: dependency: transitive description: name: win32 - sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.5.1" xdg_directories: dependency: transitive description: @@ -678,5 +678,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.19.2" diff --git a/pubspec.yaml b/pubspec.yaml index ec70bb6..b16c984 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -77,6 +77,7 @@ flutter: - assets/solar/ - assets/images/colours/ - assets/images/flowers/ + - assets/seasons/ # An image asset can refer to one or more resolution-specific "variants", see