-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0d8a74
commit 0447262
Showing
12 changed files
with
966 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
class PrayerModel | ||
{ | ||
int _id, _ayaNumber,_favorite; | ||
String _surah, _aya; | ||
|
||
PrayerModel( | ||
this._id, | ||
this._surah, | ||
this._ayaNumber, | ||
this._aya, | ||
this._favorite, | ||
); | ||
|
||
PrayerModel.fromMap(Map<String,dynamic> map) | ||
{ | ||
_id=map['id']; | ||
_surah=map['surah']; | ||
_ayaNumber=map['aya_number']; | ||
_aya=map['aya']; | ||
_favorite=map['favorite']; | ||
} | ||
|
||
void setFavorite(int value) | ||
{ | ||
_favorite=value; | ||
} | ||
|
||
int get id => _id; | ||
|
||
String get surah => _surah; | ||
|
||
int get ayaNumber => _ayaNumber; | ||
|
||
String get aya => _aya; | ||
|
||
int get favorite => _favorite; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// import '../../widgets/scroll_indicator/scroll_indicator.dart'; | ||
// import '../../providers/settings_provider.dart'; | ||
// import '../../widgets/slider_font_size/button_font_size.dart'; | ||
// import '../../widgets/slider_font_size/slider_font_size.dart'; | ||
// import '../../widgets/prayer_widget/prayer.dart'; | ||
// import '../../providers/prayer_provider.dart'; | ||
// import '../../utilities/colors.dart'; | ||
// import 'package:provider/provider.dart'; | ||
// import '../../utilities/background.dart'; | ||
// import 'package:flutter/material.dart'; | ||
|
||
// class ViewAyaPrayer extends StatefulWidget | ||
// { | ||
// final double fontSize; | ||
|
||
// const ViewAyaPrayer({ | ||
// this.fontSize | ||
// }); | ||
// @override | ||
// _ViewAyaPrayerState createState() => _ViewAyaPrayerState(); | ||
// } | ||
|
||
// class _ViewAyaPrayerState extends State<ViewAyaPrayer> | ||
// { | ||
|
||
// @override | ||
// Widget build(BuildContext context) | ||
// { | ||
// final parayerProvider=Provider.of<PrayerProvider>(context,listen: false); | ||
|
||
// return ListView.builder( | ||
// physics: BouncingScrollPhysics(), | ||
// itemCount: parayerProvider.length, | ||
// itemBuilder: (context, index){ | ||
// return Padding( | ||
// padding: index==0 ? | ||
// const EdgeInsets.only(top:5.0,left: 5.0,right: 5.0) | ||
// : index==parayerProvider.length-1 ? | ||
// const EdgeInsets.only(bottom: 5.0,left: 5.0,right: 5.0) | ||
// : const EdgeInsets.only(left: 5.0,right: 5.0), | ||
// child: Prayer( | ||
// fontSize:widget.fontSize, | ||
// prayer: parayerProvider.getPrayer(index), | ||
// ), | ||
// ); | ||
// } | ||
// ); | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
import 'package:azkark/providers/prayer_provider.dart'; | ||
import 'package:azkark/widgets/prayer_widget/prayer.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
import '../../utilities/colors.dart'; | ||
import '../../widgets/prayer_widget/tab_bar.dart'; | ||
import '../../providers/settings_provider.dart'; | ||
import '../../widgets/slider_font_size/button_font_size.dart'; | ||
import '../../widgets/slider_font_size/slider_font_size.dart'; | ||
import '../../pages/prayer/view_surah_prayer.dart'; | ||
import 'package:provider/provider.dart'; | ||
import '../../utilities/background.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'view_aya_prayer.dart'; | ||
|
||
class ViewPrayer extends StatefulWidget | ||
{ | ||
|
||
@override | ||
_ViewPrayerState createState() => _ViewPrayerState(); | ||
} | ||
|
||
enum PopUpMenu {ShowAllAyat} | ||
|
||
class _ViewPrayerState extends State<ViewPrayer> with SingleTickerProviderStateMixin | ||
{ | ||
bool _showSliderFont,_showAllAyat; | ||
List<bool> _showAlAyat; | ||
double _fontSize; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
_showSliderFont=false; | ||
_showAllAyat=false; | ||
_fontSize=Provider.of<SettingsProvider>(context,listen: false).getsettingField('font_size'); | ||
_showAlAyat=List<bool>(); | ||
for(int i=0; i<Provider.of<PrayerProvider>(context,listen: false).allSurah.length ; i++) | ||
_showAlAyat.add(false); | ||
} | ||
|
||
@override | ||
void dispose() | ||
{ | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) | ||
{ | ||
final size=MediaQuery.of(context).size; | ||
final prayerProvider=Provider.of<PrayerProvider>(context,listen: false); | ||
|
||
return Stack( | ||
children: <Widget>[ | ||
Background(), | ||
Scaffold( | ||
appBar: AppBar( | ||
elevation: 0.0, | ||
title: Text( | ||
'دعاء من القرآن', | ||
style: new TextStyle( | ||
color: ruby[50], | ||
fontWeight: FontWeight.w700, | ||
fontSize: 18, | ||
), | ||
), | ||
actions: <Widget>[ | ||
ButtonFontSize( | ||
showSider: _showSliderFont, | ||
onTap: (){ | ||
setState(() { | ||
_showSliderFont ? _showSliderFont=false : _showSliderFont=true; | ||
}); | ||
}, | ||
), | ||
_buildPopUpMenu(), | ||
], | ||
), | ||
body: Stack( | ||
children: <Widget>[ | ||
SizedBox( | ||
width: size.width, | ||
height: size.height, | ||
child: ListView.builder( | ||
physics: BouncingScrollPhysics(), | ||
itemCount: prayerProvider.allSurah.length, | ||
itemBuilder: (context, index){ | ||
return Padding( | ||
padding: index==0 ? | ||
const EdgeInsets.only(top:8.0,bottom: 4.0,left: 8.0,right: 8.0) | ||
: index==prayerProvider.allSurah.length-1 ? | ||
const EdgeInsets.only(top: 4.0,bottom: 8.0,left: 8.0,right: 8.0) | ||
: const EdgeInsets.only(top: 4.0,bottom: 4.0,left: 8.0,right: 8.0), | ||
child: Prayer( | ||
fontSize: _fontSize, | ||
surahNumber: index, | ||
showAlAyat: _showAlAyat[index], | ||
onTap: (){ | ||
setState(() { | ||
_showAlAyat[index]=!_showAlAyat[index]; | ||
}); | ||
}, | ||
), | ||
); | ||
} | ||
), | ||
), | ||
if(_showSliderFont) | ||
Padding( | ||
padding: EdgeInsets.only(bottom: 15.0), | ||
child: Align( | ||
alignment: Alignment.bottomCenter, | ||
child: SliderFontSize( | ||
fontSize: _fontSize, | ||
min: 14, | ||
max: 30, | ||
onChanged: (value){ | ||
setState(() { | ||
_fontSize=value; | ||
}); | ||
}, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
] | ||
); | ||
} | ||
|
||
Widget _buildPopUpMenu() | ||
{ | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 5.0), | ||
child: PopupMenuButton<PopUpMenu>( | ||
offset: Offset(0,50), | ||
tooltip: 'قائمة الخيارات', | ||
onSelected:(PopUpMenu result) async { | ||
switch(result) | ||
{ | ||
|
||
|
||
case PopUpMenu.ShowAllAyat: | ||
{ | ||
setState(() { | ||
_showAllAyat=!_showAllAyat; | ||
for(int i=0; i<Provider.of<PrayerProvider>(context,listen: false).allSurah.length ; i++) | ||
_showAllAyat ? _showAlAyat[i]=true : _showAlAyat[i]=false; | ||
}); | ||
} break; | ||
} | ||
}, | ||
itemBuilder: (context){ | ||
return [ | ||
PopupMenuItem<PopUpMenu>( | ||
value: PopUpMenu.ShowAllAyat, | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
FaIcon( | ||
_showAllAyat ? FontAwesomeIcons.toggleOn : FontAwesomeIcons.toggleOff, | ||
color: _showAllAyat ? ruby[500] : ruby, | ||
size: 20, | ||
), | ||
Container( | ||
width: 150, | ||
alignment: Alignment.centerRight, | ||
child: Text( | ||
_showAllAyat ? 'تم عرض معاني كل الأسماء' : 'عرض معاني كل الأسماء', | ||
textAlign: TextAlign.right, | ||
style: new TextStyle( | ||
color: ruby[900], | ||
fontWeight: FontWeight.w300, | ||
fontSize: 14, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
]; | ||
}, | ||
), | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// import '../../widgets/prayer_widget/surah.dart'; | ||
// import '../../providers/prayer_provider.dart'; | ||
// import 'package:provider/provider.dart'; | ||
// import 'package:flutter/material.dart'; | ||
|
||
// class ViewSurahPrayer extends StatefulWidget | ||
// { | ||
// final double fontSize; | ||
|
||
// const ViewSurahPrayer({ | ||
// this.fontSize | ||
// }); | ||
|
||
// @override | ||
// _ViewSurahPrayerState createState() => _ViewSurahPrayerState(); | ||
// } | ||
|
||
// class _ViewSurahPrayerState extends State<ViewSurahPrayer> | ||
// { | ||
// @override | ||
// Widget build(BuildContext context) | ||
// { | ||
// final parayerProvider=Provider.of<PrayerProvider>(context,listen: false); | ||
|
||
// return ListView.builder( | ||
// physics: BouncingScrollPhysics(), | ||
// itemCount: parayerProvider.allSurah.length, | ||
// itemBuilder: (context, index){ | ||
// return Padding( | ||
// padding: index==0 ? | ||
// const EdgeInsets.only(top:5.0,left: 5.0,right: 5.0) | ||
// : index==parayerProvider.length-1 ? | ||
// const EdgeInsets.only(bottom: 5.0,left: 5.0,right: 5.0) | ||
// : const EdgeInsets.only(left: 5.0,right: 5.0), | ||
// child: Surah( | ||
// number: index+1, | ||
// fontSize: widget.fontSize, | ||
// surah: parayerProvider.allSurah[index], | ||
// ), | ||
// ); | ||
// } | ||
// ); | ||
// } | ||
// } |
Oops, something went wrong.