Skip to content

Instantly share code, notes, and snippets.

@timsneath
Created December 29, 2020 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timsneath/4cda7e8abacbcf015f332a9c77248623 to your computer and use it in GitHub Desktop.
Save timsneath/4cda7e8abacbcf015f332a9c77248623 to your computer and use it in GitHub Desktop.
enum Colors { red, black }
class Tajwid {
String text;
Colors color;
Tajwid({this.text, this.color});
}
String arabicText = "يَهْدِيْكُمُ اللَّهُ وَيُصْلِحُ بَالَكُمُ";
List<Tajwid> listTajwid = new List<Tajwid>();
void main() {
Tajwid tajwid1 = new Tajwid();
tajwid1.text = arabicText.substring(0, 5);
tajwid1.color = Colors.black;
listTajwid.add(tajwid1);
Tajwid tajwid2 = new Tajwid();
tajwid2.text = arabicText.substring(5, 15);
tajwid2.color = Colors.red;
listTajwid.add(tajwid2);
Tajwid tajwid3 = new Tajwid();
tajwid3.text = arabicText.substring(15, arabicText.length);
tajwid3.color = Colors.black;
listTajwid.add(tajwid3);
print(arabicText.length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment