Skip to content

Commit

Permalink
chore: Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofstica-Muhammad-Aun committed Aug 25, 2024
1 parent 348724f commit 1baab4f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/lib/global/models/ayat_list_view_arguments.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:quran_companion/global/models/ayat_model.dart';

class AyatListViewArguments {
class AyatListViewArgumentsModel {
final String title;
final String subtitle;
final List<AyatModel> ayats;
final String? highligtedTerm;

AyatListViewArguments({
AyatListViewArgumentsModel({
required this.title,
required this.subtitle,
required this.ayats,
Expand Down
1 change: 0 additions & 1 deletion app/lib/global/utils/keys.dart

This file was deleted.

4 changes: 2 additions & 2 deletions app/lib/global/utils/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class RoutesPath {
builder: (context) => SurahParaListView(mode: args),
);
case ayatListView:
AyatListViewArguments args =
settings.arguments as AyatListViewArguments;
AyatListViewArgumentsModel args =
settings.arguments as AyatListViewArgumentsModel;
return MaterialPageRoute(
builder: (context) => AyatListView(arguments: args),
);
Expand Down
2 changes: 1 addition & 1 deletion app/lib/views/ayat_list/ayat_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:stacked_services/stacked_services.dart';
import '../../global/widgets/ayat_tile/ayat_tile.dart';

class AyatListView extends StatelessWidget {
final AyatListViewArguments arguments;
final AyatListViewArgumentsModel arguments;
const AyatListView({
super.key,
required this.arguments,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/views/home/home_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class HomeViewModel extends BaseViewModel {
_setIsSearching(false);
_navigationService.navigateTo(
ayatListView,
arguments: AyatListViewArguments(
arguments: AyatListViewArgumentsModel(
title: 'Search Results',
subtitle: "by word '$_searchText'",
ayats: searchResults,
Expand Down
4 changes: 2 additions & 2 deletions app/lib/views/surah_para_list/surah_para_list_view_model.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:quran_companion/global/models/ayat_list_view_arguments.dart';
import 'package:quran_companion/global/models/ayat_model.dart';
import 'package:quran_companion/global/models/surah_para_tile_model.dart';
import 'package:quran_companion/views/surah_para_list/models/surah_para_tile_model.dart';
import 'package:quran_companion/global/repositories/ayat_repository.dart';
import 'package:quran_companion/global/utils/enums.dart';
import 'package:quran_companion/global/utils/quran.dart';
Expand Down Expand Up @@ -65,7 +65,7 @@ class SurahParaListViewModel extends BaseViewModel {

_navigationService.navigateTo(
ayatListView,
arguments: AyatListViewArguments(
arguments: AyatListViewArgumentsModel(
title: mode.type,
subtitle: name,
ayats: surahParaAyats,
Expand Down

0 comments on commit 1baab4f

Please sign in to comment.