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
import 'package:flutter/material.dart'; | |
class EntranceFader extends StatefulWidget { | |
final Widget child; | |
final Duration delay; | |
final Duration duration; | |
final Offset offset; | |
const EntranceFader({ | |
Key key, |
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
import 'package:al_quran/animations/entranceFader.dart'; | |
import 'package:flutter/material.dart'; | |
class Flare extends StatelessWidget { | |
final Offset offset; | |
final Color color; | |
final double top; | |
final double left; | |
final double right; | |
final double bottom; |
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
import 'package:al_quran/animations/bottomAnimation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:shimmer/shimmer.dart'; | |
class LoadingShimmer extends StatelessWidget { | |
final String text; | |
LoadingShimmer({this.text}); | |
@override | |
Widget build(BuildContext context) { | |
double height = MediaQuery.of(context).size.height; |
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
class SurahsList { | |
final List<Surah> surahs; | |
SurahsList({this.surahs}); | |
factory SurahsList.fromJSON(Map<String, dynamic> json) { | |
Iterable surahlist = json['data']['surahs']; | |
List<Surah> surahsList = surahlist.map((i) => Surah.fromJSON(i)).toList(); | |
return SurahsList(surahs: surahsList); |
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
class SajdaList { | |
final List<SajdaAyat> sajdaAyahs; | |
SajdaList({this.sajdaAyahs}); | |
factory SajdaList.fromJSON(Map<String, dynamic> json) { | |
Iterable allSajdas = json['data']['ayahs']; | |
List<SajdaAyat> sajdas = | |
allSajdas.map((e) => SajdaAyat.fromJSON(e)).toList(); | |
return SajdaList(sajdaAyahs: sajdas); |
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
class QuranAPI { | |
Future<SurahsList> getSurahList() async { | |
String url = "http://api.alquran.cloud/v1/quran/quran-uthmani"; | |
final response = await http.get(url); | |
if (response.statusCode == 200) { | |
return SurahsList.fromJSON(json.decode(response.body)); | |
} else { | |
print("Failed to load"); | |
throw Exception("Failed to Load Post"); |
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
codeAutoRetrievalTimeout() { | |
return (String verificationID) { | |
_verificationId = verificationID; | |
}; | |
} |
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
_verifyCode() async { | |
final AuthCredential credential = PhoneAuthProvider.getCredential( | |
verificationId: _verificationId, smsCode: _controllerCode.text); | |
final FirebaseUser user = | |
(await _auth.signInWithCredential(credential)).user; | |
final FirebaseUser currentUser = await _auth.currentUser(); | |
assert(user.uid == currentUser.uid); | |
if (user != null) { | |
Navigator.pop(context); | |
Navigator.push( |
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
codeSent() { | |
return (String verificationID, [int forceResendingToken]) { | |
showDialog( | |
context: context, | |
barrierDismissible: false, | |
builder: (context) { | |
return AlertDialog( | |
title: Text('Enter 6-Digit Code'), | |
content: Column( | |
mainAxisSize: MainAxisSize.min, |
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
verificationFailed() { | |
return (AuthException exception) { | |
print('Verification Failed: ${exception.code}'); | |
} | |
} |
NewerOlder