improvement.

development
Sikander Saleem 5 years ago
parent 7100682eda
commit 25867bdf9a

@ -1,23 +1,23 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class ColorConsts { class ColorConsts {
static Color primaryBlack = Color(0xff1C2238); static const Color primaryBlack = Color(0xff1C2238);
static Color primaryBlue = Color(0xff374061); static const Color primaryBlue = Color(0xff374061);
static Color secondaryPink = Color(0xffE4697B); static const Color secondaryPink = Color(0xffE4697B);
static Color secondaryOrange = Color(0xffFF8C67); static const Color secondaryOrange = Color(0xffFF8C67);
static Color secondaryWhite = Color(0xffF2F2F2); static const Color secondaryWhite = Color(0xffF2F2F2);
static Color tertiaryPurple = Color(0xff5A3C60); static const Color tertiaryPurple = Color(0xff5A3C60);
static Color secondaryCyan = Color(0xff94D5F0); static const Color secondaryCyan = Color(0xff94D5F0);
static Color gradientOrange = Color(0xffFF8C67); static const Color gradientOrange = Color(0xffFF8C67);
static Color gradientPink = Color(0xffE4697B); static const Color gradientPink = Color(0xffE4697B);
static Color textGrey = Color(0xff787F95); static const Color textGrey = Color(0xff787F95);
static Color textGrey1 = Color(0xffA6A8BA); static const Color textGrey1 = Color(0xffA6A8BA);
static Color textGrey2 = Color(0xff868787); static const Color textGrey2 = Color(0xff868787);
static Color textHintGrey = Color(0xffcccccc); static const Color textHintGrey = Color(0xffcccccc);
static Color sliderBackground = Color(0xffdfdfdf); static const Color sliderBackground = Color(0xffdfdfdf);
} }

@ -107,6 +107,13 @@ class AyatTangheemTypeMappedData {
} }
return data; return data;
} }
String reverseAyatNumber() {
String _ayaTemp = ayahText.substring(0, ayahText.length - ayatNumberInSurah.toString().length);
String _ayaNum = ayahText.substring(ayahText.length - ayatNumberInSurah.toString().length, ayahText.length);
_ayaNum = _ayaNum.split('').reversed.join('');
return "$_ayaTemp$_ayaNum";
}
} }
class TangheemProperty { class TangheemProperty {

@ -328,6 +328,7 @@ class _QuranScreenState extends State<QuranScreen> {
TextHighLightWidget( TextHighLightWidget(
text: _surahAya, text: _surahAya,
valueColor: ColorConsts.primaryBlue, valueColor: ColorConsts.primaryBlue,
highLightColor: ColorConsts.primaryBlue,
highlights: _tangheemWords, highlights: _tangheemWords,
onTap: (value) { onTap: (value) {
List<AyatTangheemTypeMappedData> _ayatList = _ayatTangheemTypeMapped.data?.where((element) => element.highlightText == value)?.toList() ?? []; List<AyatTangheemTypeMappedData> _ayatList = _ayatTangheemTypeMapped.data?.where((element) => element.highlightText == value)?.toList() ?? [];

@ -105,7 +105,7 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
children: [ children: [
TextHighLightWidget( TextHighLightWidget(
text: _ayatTangheemTypeMappedData.ayahText ?? "", text: _ayatTangheemTypeMappedData.reverseAyatNumber() ?? "",
valueColor: ColorConsts.primaryBlue, valueColor: ColorConsts.primaryBlue,
highlights: _tangheemWords, highlights: _tangheemWords,
style: TextStyle( style: TextStyle(

@ -95,7 +95,7 @@ class _TangheemScreenState extends State<TangheemScreen> {
], ],
), ),
TextHighLightWidget( TextHighLightWidget(
text: _dataList[index].ayahText, text: _dataList[index].reverseAyatNumber(),
valueColor: ColorConsts.secondaryOrange, valueColor: ColorConsts.secondaryOrange,
highlights: [_dataList[index].highlightText], highlights: [_dataList[index].highlightText],
textAlign: TextAlign.start, textAlign: TextAlign.start,

@ -10,10 +10,19 @@ class TextHighLightWidget extends StatelessWidget {
final List<String> highlights; final List<String> highlights;
final TextStyle style; final TextStyle style;
final TextAlign textAlign; final TextAlign textAlign;
final Color highLightColor = ColorConsts.secondaryOrange; final Color highLightColor;
final Function(String) onTap; final Function(String) onTap;
TextHighLightWidget({Key key, this.text, this.textAlign = TextAlign.center, this.valueText, this.valueColor, this.highlights, this.style = const TextStyle(), this.onTap}); TextHighLightWidget(
{Key key,
this.text,
this.textAlign = TextAlign.center,
this.valueText,
this.valueColor,
this.highlights,
this.highLightColor = ColorConsts.secondaryOrange,
this.style = const TextStyle(),
this.onTap});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

Loading…
Cancel
Save