From be009da7d85a01504089485f53cd92e6465f2aac Mon Sep 17 00:00:00 2001 From: Veloraine Date: Sun, 26 Nov 2023 20:04:23 +0700 Subject: [PATCH 1/3] fix: change secrets env target path --- lib/core/environment/secrets.dart | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 6 ++++-- windows/flutter/generated_plugin_registrant.cc | 3 +++ windows/flutter/generated_plugins.cmake | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/core/environment/secrets.dart b/lib/core/environment/secrets.dart index 1319010..6dabd81 100644 --- a/lib/core/environment/secrets.dart +++ b/lib/core/environment/secrets.dart @@ -2,7 +2,7 @@ import 'package:envied/envied.dart'; part 'secrets.g.dart'; -@Envied(name: 'Secret', path: '.env.example') +@Envied(name: 'Secret', path: '.env') abstract class Secret { @EnviedField(varName: 'BASE_URL_DEV') static const String baseUrlDev = _Secret.baseUrlDev; diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8fce4cf..dce6ef2 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,14 +5,16 @@ import FlutterMacOS import Foundation +import firebase_analytics import firebase_core import firebase_crashlytics import package_info -import path_provider_macos -import shared_preferences_macos +import path_provider_foundation +import shared_preferences_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 4f78848..ec8e8d4 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,12 @@ #include "generated_plugin_registrant.h" +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 88b22e5..02d26c3 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + firebase_core url_launcher_windows ) From 4a06405d0a6e9a1a5d4e3a7f826d482c92692e26 Mon Sep 17 00:00:00 2001 From: Yudha Haris Purnama Date: Wed, 6 Dec 2023 19:38:58 +0700 Subject: [PATCH 2/3] feat(service): initializing mixpanel service --- lib/core/environment/config.dart | 6 +- lib/core/environment/secrets.dart | 2 + .../detail/presentation/widgets/_widgets.dart | 1 + .../widgets/title_and_bookmark.dart | 4 +- lib/services/_services.dart | 3 + lib/services/mixpanel_service.dart | 30 +++++++++ pubspec.lock | 62 ++++++++++++------- pubspec.yaml | 1 + 8 files changed, 84 insertions(+), 25 deletions(-) create mode 100644 lib/services/mixpanel_service.dart diff --git a/lib/core/environment/config.dart b/lib/core/environment/config.dart index 0f82190..f7c9035 100644 --- a/lib/core/environment/config.dart +++ b/lib/core/environment/config.dart @@ -38,6 +38,7 @@ class Config { await HiveDataBaseService.init(); } await Pref.init(); + await MixpanelService.init(); // TODO(fauzi): Implement notification plugin // await notificationPlugin.init(); @@ -55,6 +56,7 @@ class Config { } static bool get isDevelopment => appFlavor == Flavor.development; + static BaseConfig get baseConfig => _baseConfig()!; static BaseConfig? _baseConfig() { @@ -74,8 +76,10 @@ class Config { class BaseConfig { const BaseConfig({ - required this.endpoints, this.assetAbsolutePath = Constants.assetPath, + required this.endpoints, + this.assetAbsolutePath = Constants.assetPath, }); + final String assetAbsolutePath; final BaseEndpoints endpoints; } diff --git a/lib/core/environment/secrets.dart b/lib/core/environment/secrets.dart index 6dabd81..16d5fe5 100644 --- a/lib/core/environment/secrets.dart +++ b/lib/core/environment/secrets.dart @@ -8,4 +8,6 @@ abstract class Secret { static const String baseUrlDev = _Secret.baseUrlDev; @EnviedField(varName: 'BASE_URL_PROD') static const String baseUrlProd = _Secret.baseUrlProd; + @EnviedField(varName: 'MIXPANEL_TOKEN') + static const String mixpanelToken = _Secret.mixpanelToken; } diff --git a/lib/features/matkul/detail/presentation/widgets/_widgets.dart b/lib/features/matkul/detail/presentation/widgets/_widgets.dart index 52ed30e..9206a6f 100644 --- a/lib/features/matkul/detail/presentation/widgets/_widgets.dart +++ b/lib/features/matkul/detail/presentation/widgets/_widgets.dart @@ -10,6 +10,7 @@ import 'package:ulaskelas/features/leaderboard/presentation/widgets/_widgets.dar import 'package:ulaskelas/features/matkul/bookmarks/data/models/_models.dart'; import 'package:ulaskelas/features/matkul/form/data/models/_models.dart'; import 'package:ulaskelas/features/matkul/search/data/models/_models.dart'; +import 'package:ulaskelas/services/_services.dart'; import 'package:ulaskelas/services/launch_service.dart'; part 'review_card.dart'; diff --git a/lib/features/matkul/detail/presentation/widgets/title_and_bookmark.dart b/lib/features/matkul/detail/presentation/widgets/title_and_bookmark.dart index 7f05731..9110148 100644 --- a/lib/features/matkul/detail/presentation/widgets/title_and_bookmark.dart +++ b/lib/features/matkul/detail/presentation/widgets/title_and_bookmark.dart @@ -2,7 +2,8 @@ part of '_widgets.dart'; class TitleAndBookMark extends StatelessWidget { const TitleAndBookMark({ - required this.course, super.key, + required this.course, + super.key, }); final CourseModel course; @@ -36,6 +37,7 @@ class TitleAndBookMark extends StatelessWidget { shortName: course.shortName, ); bookmarkRM.setState((s) => s.toggleBookmark(bookmark)); + MixpanelService.track('bookmark_course'); }, child: Icon( Icons.bookmark, diff --git a/lib/services/_services.dart b/lib/services/_services.dart index a278451..8c724d7 100644 --- a/lib/services/_services.dart +++ b/lib/services/_services.dart @@ -7,10 +7,12 @@ import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; import 'package:intl/intl.dart'; import 'package:logger/logger.dart'; +import 'package:mixpanel_flutter/mixpanel_flutter.dart'; import 'package:path_provider/path_provider.dart'; import 'package:share/share.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:ulaskelas/core/_core.dart'; +import 'package:ulaskelas/core/environment/secrets.dart'; part 'date_service.dart'; part 'delay_service.dart'; @@ -19,3 +21,4 @@ part 'file_service.dart'; part 'hive_db_service.dart'; part 'pref_service.dart'; part 'share_service.dart'; +part 'mixpanel_service.dart'; diff --git a/lib/services/mixpanel_service.dart b/lib/services/mixpanel_service.dart new file mode 100644 index 0000000..dae4b68 --- /dev/null +++ b/lib/services/mixpanel_service.dart @@ -0,0 +1,30 @@ +part of '_services.dart'; + +class MixpanelService { + static Mixpanel? _mixpanel; + + static Future init() async { + Logger().i('Initializing Mixpanel Service'); + _mixpanel = await Mixpanel.init( + Secret.mixpanelToken, + trackAutomaticEvents: true, + ); + } + + static Future get instance async { + return _mixpanel ??= await Mixpanel.init( + Secret.mixpanelToken, + trackAutomaticEvents: true, + ); + } + + static void track(String eventName, {Map? params}) { + _mixpanel!.track(eventName, properties: params); + Logger().i( + ''' + Track Events: $eventName, + Parameters: $params + ''' + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 0642794..60b7249 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" convert: dependency: transitive description: @@ -467,10 +467,10 @@ packages: dependency: "direct main" description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: @@ -515,18 +515,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" material_design_icons_flutter: dependency: "direct main" description: @@ -539,10 +539,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -551,6 +551,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + mixpanel_flutter: + dependency: "direct main" + description: + name: mixpanel_flutter + sha256: "5dc993ade5eaad51ebb6c91230971a3443ac30a3d1d24399bc3db74c5705d400" + url: "https://pub.dev" + source: hosted + version: "2.2.0" navigation_builder: dependency: transitive description: @@ -651,10 +659,10 @@ packages: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: @@ -816,18 +824,18 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" states_rebuilder: dependency: "direct main" description: @@ -840,10 +848,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -880,10 +888,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" timing: dependency: transitive description: @@ -1024,10 +1032,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 url: "https://pub.dev" source: hosted - version: "11.3.0" + version: "11.10.0" watcher: dependency: transitive description: @@ -1036,6 +1044,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1117,5 +1133,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index eb9120f..7e8b275 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,6 +39,7 @@ dependencies: # envify: ^2.0.3 envied: ^0.3.0+3 html: ^0.15.4 + mixpanel_flutter: ^2.2.0 dev_dependencies: flutter_test: From 83991df74dd9aff839d95dcd6f126a4cb70149f9 Mon Sep 17 00:00:00 2001 From: Daffa Zuhdii Date: Thu, 7 Dec 2023 21:02:05 +0800 Subject: [PATCH 3/3] feat(service): add mixpanels --- .env.example | 2 -- .vscode/settings.json | 3 ++ android/app/build.gradle | 2 +- lib/app_wrapper.dart | 2 +- .../home/presentation/pages/_pages.dart | 1 + .../pages/home_daftar_ulasan_page.dart | 1 + .../home/presentation/pages/home_page.dart | 24 ++++++++----- .../widgets/card_matkul_review.dart | 6 ++-- .../pages/edit_komponen_page.dart | 2 +- .../pages/komponen_form_page.dart | 2 +- .../pages/komponen_kalkulator_page.dart | 6 ++-- .../presentation/widgets/card_component.dart | 2 +- .../presentation/widgets/simpan_button.dart | 2 +- .../presentation/widgets/leaderboard_tag.dart | 2 +- .../widgets/skeleton_card_leaderboard.dart | 2 +- .../pages/all_review_matkul_page.dart | 6 ++-- .../pages/detail_matkul_page.dart | 4 +-- .../pages/review_matkul_page.dart | 2 +- .../presentation/widgets/review_card.dart | 4 +-- .../pages/add_review_matkul_tag_page.dart | 2 +- .../presentation/pages/success_form_page.dart | 2 +- .../search/presentation/pages/_pages.dart | 1 + .../presentation/pages/filter_page.dart | 11 +++++- .../pages/search_course_page.dart | 6 ++++ .../search/presentation/widgets/_widgets.dart | 1 + .../widgets/search_list_view.dart | 3 ++ .../presentation/pages/profile_page.dart | 2 ++ .../presentation/widgets/profile_data.dart | 2 +- .../sso/presentation/pages/sso_web_page.dart | 2 +- lib/services/pref_service.dart | 2 +- pubspec.lock | 34 +++++++++---------- 31 files changed, 88 insertions(+), 55 deletions(-) delete mode 100644 .env.example create mode 100644 .vscode/settings.json diff --git a/.env.example b/.env.example deleted file mode 100644 index b6d758a..0000000 --- a/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -BASE_URL_DEV = -BASE_URL_PROD = "" \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..385f27a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} diff --git a/android/app/build.gradle b/android/app/build.gradle index 69f8d85..6a6d7bd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) { def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") + throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') diff --git a/lib/app_wrapper.dart b/lib/app_wrapper.dart index 9a1f9f4..a6945fe 100644 --- a/lib/app_wrapper.dart +++ b/lib/app_wrapper.dart @@ -122,7 +122,7 @@ A new version of this app available on the store, please update into the newer v Text( 'by RISTEK Fasilkom UI', style: FontTheme.poppins14w500white(), - ) + ), ], ), ), diff --git a/lib/features/home/presentation/pages/_pages.dart b/lib/features/home/presentation/pages/_pages.dart index 5df60b9..24cb8f2 100644 --- a/lib/features/home/presentation/pages/_pages.dart +++ b/lib/features/home/presentation/pages/_pages.dart @@ -15,6 +15,7 @@ import 'package:ulaskelas/features/home/presentation/widgets/_widgets.dart'; import 'package:ulaskelas/features/matkul/form/domain/entities/query_review.dart'; import 'package:ulaskelas/features/matkul/search/presentation/widgets/_widgets.dart'; import 'package:ulaskelas/features/matkul/search/presentation/widgets/skeleton_card_course.dart'; +import 'package:ulaskelas/services/_services.dart'; part 'home_daftar_matkul_page.dart'; part 'home_daftar_ulasan_page.dart'; diff --git a/lib/features/home/presentation/pages/home_daftar_ulasan_page.dart b/lib/features/home/presentation/pages/home_daftar_ulasan_page.dart index 0edbbcd..0220023 100644 --- a/lib/features/home/presentation/pages/home_daftar_ulasan_page.dart +++ b/lib/features/home/presentation/pages/home_daftar_ulasan_page.dart @@ -75,6 +75,7 @@ class _HomeDaftarUlasanPageState extends BaseStateful { review.course!, review.courseCode!, ); + MixpanelService.track('view_my_review'); }, ); }, diff --git a/lib/features/home/presentation/pages/home_page.dart b/lib/features/home/presentation/pages/home_page.dart index 92f13a6..55fd5df 100644 --- a/lib/features/home/presentation/pages/home_page.dart +++ b/lib/features/home/presentation/pages/home_page.dart @@ -110,7 +110,7 @@ class _HomePageState extends BaseStateful { Text( 'Lihat Semua Mata Kuliah', style: FontTheme.poppins14w400purple(), - ) + ), ], ), Icon( @@ -141,7 +141,7 @@ class _HomePageState extends BaseStateful { 'Lihat Semua', style: FontTheme.poppins13w400purple(), ), - ) + ), ], ), ), @@ -219,12 +219,16 @@ class _HomePageState extends BaseStateful { style: FontTheme.poppins14w700black(), ), InkWell( - onTap: () => nav.goToHomeDaftarUlasan(), + onTap: () { + nav.goToHomeDaftarUlasan(); + + MixpanelService.track('view_all_reviews'); + }, child: Text( 'Lihat Semua', style: FontTheme.poppins13w400purple(), ), - ) + ), ], ), ), @@ -260,10 +264,14 @@ class _HomePageState extends BaseStateful { final review = data.summaries[i]; return CardMatkulReview( review: review, - onTap: () => nav.goToDetailMatkulPage( - review.course!, - review.courseCode.toString(), - ), + onTap: () { + nav.goToDetailMatkulPage( + review.course!, + review.courseCode.toString(), + ); + + MixpanelService.track('view_my_review'); + }, ); }, ); diff --git a/lib/features/home/presentation/widgets/card_matkul_review.dart b/lib/features/home/presentation/widgets/card_matkul_review.dart index 1621114..df5db8d 100644 --- a/lib/features/home/presentation/widgets/card_matkul_review.dart +++ b/lib/features/home/presentation/widgets/card_matkul_review.dart @@ -109,11 +109,11 @@ class CardMatkulReview extends StatelessWidget { : (review.hateSpeechStatus == 'WAITING') ? TagStatus.pending : TagStatus.rejected, - ) + ), ], - ) + ), ], - ) + ), ], ), ), diff --git a/lib/features/kalkulator/presentation/pages/edit_komponen_page.dart b/lib/features/kalkulator/presentation/pages/edit_komponen_page.dart index f1f41a8..5f36c69 100644 --- a/lib/features/kalkulator/presentation/pages/edit_komponen_page.dart +++ b/lib/features/kalkulator/presentation/pages/edit_komponen_page.dart @@ -107,7 +107,7 @@ class _EditComponentPageState extends BaseStateful { await onSubmitCallBack(context); }, ), - ) + ), ], ); } diff --git a/lib/features/kalkulator/presentation/pages/komponen_form_page.dart b/lib/features/kalkulator/presentation/pages/komponen_form_page.dart index f6979ba..45e9808 100644 --- a/lib/features/kalkulator/presentation/pages/komponen_form_page.dart +++ b/lib/features/kalkulator/presentation/pages/komponen_form_page.dart @@ -65,7 +65,7 @@ class _ComponentFormPageState extends BaseStateful { await onSubmitCallBack(context); }, ), - ) + ), ], ); } diff --git a/lib/features/kalkulator/presentation/pages/komponen_kalkulator_page.dart b/lib/features/kalkulator/presentation/pages/komponen_kalkulator_page.dart index ac8777f..6c26c34 100644 --- a/lib/features/kalkulator/presentation/pages/komponen_kalkulator_page.dart +++ b/lib/features/kalkulator/presentation/pages/komponen_kalkulator_page.dart @@ -75,7 +75,7 @@ class _CalculatorComponentPageState Text( _getFinalScoreAndGrade(widget.totalScore), style: FontTheme.poppins14w600black(), - ) + ), ], ), Padding( @@ -103,7 +103,7 @@ class _CalculatorComponentPageState textAlign: TextAlign.center, style: FontTheme.poppins12w600black(), ), - ) + ), ], ), ), @@ -193,7 +193,7 @@ class _CalculatorComponentPageState ), ), ), - ) + ), ], ), ), diff --git a/lib/features/kalkulator/presentation/widgets/card_component.dart b/lib/features/kalkulator/presentation/widgets/card_component.dart index 8634819..5e93c6c 100644 --- a/lib/features/kalkulator/presentation/widgets/card_component.dart +++ b/lib/features/kalkulator/presentation/widgets/card_component.dart @@ -59,7 +59,7 @@ class CardCompononent extends StatelessWidget { style: FontTheme.poppins12w400black(), textAlign: TextAlign.right, ), - ) + ), ], ), ), diff --git a/lib/features/kalkulator/presentation/widgets/simpan_button.dart b/lib/features/kalkulator/presentation/widgets/simpan_button.dart index 20271e2..ff631d9 100644 --- a/lib/features/kalkulator/presentation/widgets/simpan_button.dart +++ b/lib/features/kalkulator/presentation/widgets/simpan_button.dart @@ -21,7 +21,7 @@ class SimpanButton extends StatelessWidget { color: Color.fromRGBO(0, 0, 0, 0.05), blurRadius: 4, offset: Offset(0, -2), - ) + ), ], ), child: AutoLayoutButton( diff --git a/lib/features/leaderboard/presentation/widgets/leaderboard_tag.dart b/lib/features/leaderboard/presentation/widgets/leaderboard_tag.dart index 1cb5cbf..c5af972 100644 --- a/lib/features/leaderboard/presentation/widgets/leaderboard_tag.dart +++ b/lib/features/leaderboard/presentation/widgets/leaderboard_tag.dart @@ -56,7 +56,7 @@ class TagLeaderboard extends StatelessWidget { return [ BaseColors.purpleHearth, BaseColors.purpleHearth, - BaseColors.white + BaseColors.white, ]; }else if(rank == 1){ return [ diff --git a/lib/features/leaderboard/presentation/widgets/skeleton_card_leaderboard.dart b/lib/features/leaderboard/presentation/widgets/skeleton_card_leaderboard.dart index d033d27..5de05e4 100644 --- a/lib/features/leaderboard/presentation/widgets/skeleton_card_leaderboard.dart +++ b/lib/features/leaderboard/presentation/widgets/skeleton_card_leaderboard.dart @@ -42,7 +42,7 @@ class SkeletonCardLeaderboard extends StatelessWidget { ), ), ), - ) + ), ], ), title: Container( diff --git a/lib/features/matkul/detail/presentation/pages/all_review_matkul_page.dart b/lib/features/matkul/detail/presentation/pages/all_review_matkul_page.dart index fae547a..fdeb6af 100644 --- a/lib/features/matkul/detail/presentation/pages/all_review_matkul_page.dart +++ b/lib/features/matkul/detail/presentation/pages/all_review_matkul_page.dart @@ -133,7 +133,7 @@ class _AllReviewMatkulPageState extends BaseStateful { size: 28, ), ), - ) + ), ], ); }, @@ -149,7 +149,7 @@ class _AllReviewMatkulPageState extends BaseStateful { color: Color.fromRGBO(0, 0, 0, 0.05), blurRadius: 4, offset: Offset(0, -2), - ) + ), ], ), child: TulisUlasanButton( @@ -161,7 +161,7 @@ class _AllReviewMatkulPageState extends BaseStateful { } }, ), - ) + ), ], ); } diff --git a/lib/features/matkul/detail/presentation/pages/detail_matkul_page.dart b/lib/features/matkul/detail/presentation/pages/detail_matkul_page.dart index 9e83d0d..84d068e 100644 --- a/lib/features/matkul/detail/presentation/pages/detail_matkul_page.dart +++ b/lib/features/matkul/detail/presentation/pages/detail_matkul_page.dart @@ -258,7 +258,7 @@ class _DetailMatkulPageState extends BaseStateful { '${course.reviewCount} Ulasan', style: FontTheme.poppins12w400black(), ), - ) + ), ], ), const WidthSpace(32), @@ -347,7 +347,7 @@ class _DetailMatkulPageState extends BaseStateful { ); } }, - ) + ), ], ); } diff --git a/lib/features/matkul/detail/presentation/pages/review_matkul_page.dart b/lib/features/matkul/detail/presentation/pages/review_matkul_page.dart index 87d243a..2e79f87 100644 --- a/lib/features/matkul/detail/presentation/pages/review_matkul_page.dart +++ b/lib/features/matkul/detail/presentation/pages/review_matkul_page.dart @@ -37,7 +37,7 @@ class _ReviewMatkulPageState extends BaseStateful { children: [ TulisUlasanButton( onTap: () {}, - ) + ), ], ); } diff --git a/lib/features/matkul/detail/presentation/widgets/review_card.dart b/lib/features/matkul/detail/presentation/widgets/review_card.dart index 8a078bd..a8ff4d2 100644 --- a/lib/features/matkul/detail/presentation/widgets/review_card.dart +++ b/lib/features/matkul/detail/presentation/widgets/review_card.dart @@ -176,9 +176,9 @@ class ReviewCard extends StatelessWidget { // color: likesCountColor, ), ), - ) + ), ], - ) + ), ], ), ); diff --git a/lib/features/matkul/form/presentation/pages/add_review_matkul_tag_page.dart b/lib/features/matkul/form/presentation/pages/add_review_matkul_tag_page.dart index 2d24f6b..9d8209f 100644 --- a/lib/features/matkul/form/presentation/pages/add_review_matkul_tag_page.dart +++ b/lib/features/matkul/form/presentation/pages/add_review_matkul_tag_page.dart @@ -105,7 +105,7 @@ Pilih maksimal 3 kategori yang menurutmu dapat\nmerepresentasikan mata kuliah in }, ), ), - ) + ), ], ); } diff --git a/lib/features/matkul/form/presentation/pages/success_form_page.dart b/lib/features/matkul/form/presentation/pages/success_form_page.dart index d4aeb0f..ea636ba 100644 --- a/lib/features/matkul/form/presentation/pages/success_form_page.dart +++ b/lib/features/matkul/form/presentation/pages/success_form_page.dart @@ -53,7 +53,7 @@ class _SuccessFormPageState extends BaseStateful { onPressed: () { nav.pop(); }, - ) + ), ], ), ), diff --git a/lib/features/matkul/search/presentation/pages/_pages.dart b/lib/features/matkul/search/presentation/pages/_pages.dart index 1679527..f995f12 100644 --- a/lib/features/matkul/search/presentation/pages/_pages.dart +++ b/lib/features/matkul/search/presentation/pages/_pages.dart @@ -11,6 +11,7 @@ import 'package:ulaskelas/core/theme/_theme.dart'; import 'package:ulaskelas/features/matkul/main/domain/entities/query_search_course.dart'; import 'package:ulaskelas/features/matkul/search/presentation/states/_states.dart'; import 'package:ulaskelas/features/matkul/search/presentation/widgets/_widgets.dart'; +import 'package:ulaskelas/services/_services.dart'; part 'filter_page.dart'; part 'search_course_page.dart'; diff --git a/lib/features/matkul/search/presentation/pages/filter_page.dart b/lib/features/matkul/search/presentation/pages/filter_page.dart index 8ae1db8..70081d7 100644 --- a/lib/features/matkul/search/presentation/pages/filter_page.dart +++ b/lib/features/matkul/search/presentation/pages/filter_page.dart @@ -158,10 +158,19 @@ class _FilterPageState extends BaseStateful { text: 'Terapkan Filter', onTap: () { nav.pop(true); + MixpanelService.track( + 'apply_course_filter', + params: { + 'jenis_matkul': filterRM.state.selectedType.toString(), + 'jumlah_sks': filterRM.state.selectedSks.toString(), + 'semester_wajib_ambil': + filterRM.state.selectedSemester.toString(), + }, + ); }, ), ), - ) + ), ], ); }, diff --git a/lib/features/matkul/search/presentation/pages/search_course_page.dart b/lib/features/matkul/search/presentation/pages/search_course_page.dart index 4b9f101..6bee178 100644 --- a/lib/features/matkul/search/presentation/pages/search_course_page.dart +++ b/lib/features/matkul/search/presentation/pages/search_course_page.dart @@ -80,6 +80,12 @@ class _SearchCoursePageState }, onFieldSubmitted: (val) { searchCourseRM.state.addToHistory(val); + MixpanelService.track( + 'search_course', + params: { + 'query': val, + }, + ); }, onChange: onQueryChanged, ), diff --git a/lib/features/matkul/search/presentation/widgets/_widgets.dart b/lib/features/matkul/search/presentation/widgets/_widgets.dart index 0997690..390b99b 100644 --- a/lib/features/matkul/search/presentation/widgets/_widgets.dart +++ b/lib/features/matkul/search/presentation/widgets/_widgets.dart @@ -9,6 +9,7 @@ import 'package:ulaskelas/core/theme/_theme.dart'; import 'package:ulaskelas/features/matkul/search/data/models/_models.dart'; import 'package:ulaskelas/features/matkul/search/presentation/states/_states.dart'; import 'package:ulaskelas/features/matkul/search/presentation/widgets/skeleton_card_course.dart'; +import 'package:ulaskelas/services/_services.dart'; part 'base_app_bar.dart'; part 'card_course.dart'; diff --git a/lib/features/matkul/search/presentation/widgets/search_list_view.dart b/lib/features/matkul/search/presentation/widgets/search_list_view.dart index ffc6ef3..e4e0a91 100644 --- a/lib/features/matkul/search/presentation/widgets/search_list_view.dart +++ b/lib/features/matkul/search/presentation/widgets/search_list_view.dart @@ -41,9 +41,12 @@ class SearchListView extends StatelessWidget { text: 'Filter', onPressed: () async { await nav.goToFilterPage(); + if (filterRM.state.hasFilter) { await refreshIndicatorKey.currentState?.show(); } + + MixpanelService.track('open_course_filter'); }, ); }, diff --git a/lib/features/profile/presentation/pages/profile_page.dart b/lib/features/profile/presentation/pages/profile_page.dart index d8bdfca..4356971 100644 --- a/lib/features/profile/presentation/pages/profile_page.dart +++ b/lib/features/profile/presentation/pages/profile_page.dart @@ -8,6 +8,7 @@ import 'package:ulaskelas/core/bases/states/_states.dart'; import 'package:ulaskelas/core/theme/_theme.dart'; import 'package:ulaskelas/features/matkul/search/presentation/widgets/_widgets.dart'; import 'package:ulaskelas/features/profile/presentation/widgets/profile_data.dart'; +import 'package:ulaskelas/services/_services.dart'; class ProfilePage extends StatefulWidget { const ProfilePage({ @@ -94,6 +95,7 @@ class _ProfilePageState extends BaseStateful { child: InkWell( onTap: () { nav.goToHomeDaftarUlasan(); + MixpanelService.track('view_all_reviews'); }, child: Text( 'Riwayat Ulasan', diff --git a/lib/features/profile/presentation/widgets/profile_data.dart b/lib/features/profile/presentation/widgets/profile_data.dart index 0cb25e0..55b3d79 100644 --- a/lib/features/profile/presentation/widgets/profile_data.dart +++ b/lib/features/profile/presentation/widgets/profile_data.dart @@ -26,7 +26,7 @@ class ProfileData extends StatelessWidget { data, style: FontTheme.poppins12w400black(), ), - ) + ), ], ), ); diff --git a/lib/features/sso/presentation/pages/sso_web_page.dart b/lib/features/sso/presentation/pages/sso_web_page.dart index cb2b4e0..50bfb1f 100644 --- a/lib/features/sso/presentation/pages/sso_web_page.dart +++ b/lib/features/sso/presentation/pages/sso_web_page.dart @@ -60,7 +60,7 @@ class _SSOWebPageState extends BaseStateful { } return const SizedBox.shrink(); }, - ) + ), ], ); } diff --git a/lib/services/pref_service.dart b/lib/services/pref_service.dart index fa77d75..013db9b 100644 --- a/lib/services/pref_service.dart +++ b/lib/services/pref_service.dart @@ -59,7 +59,7 @@ class Pref { final token = getString(PreferencesKeys.ulasKelasCred); return { 'Authorization': 'Token $token', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', }; } } diff --git a/pubspec.lock b/pubspec.lock index 60b7249..8ffe10a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.17.2" convert: dependency: transitive description: @@ -539,10 +539,10 @@ packages: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" mime: dependency: transitive description: @@ -659,10 +659,10 @@ packages: dependency: transitive description: name: platform - sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: @@ -832,10 +832,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" states_rebuilder: dependency: "direct main" description: @@ -848,10 +848,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" stream_transform: dependency: transitive description: @@ -888,10 +888,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.6.0" timing: dependency: transitive description: @@ -1032,10 +1032,10 @@ packages: dependency: transitive description: name: vm_service - sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f url: "https://pub.dev" source: hosted - version: "11.10.0" + version: "11.7.1" watcher: dependency: transitive description: @@ -1048,10 +1048,10 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -1133,5 +1133,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.0"