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

QC-21: Refactoring #21

Merged
merged 1 commit into from
Aug 26, 2024
Merged
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
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
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