Expanded countrycode instead of abbreviation

Using primaryColor in places instead of directly using Colors
This commit is contained in:
Kingkor Roy Tirtho 2022-06-10 16:41:25 +06:00
parent dedbf14f97
commit 2b75076f82
5 changed files with 228 additions and 203 deletions

View File

@ -141,7 +141,9 @@ class SyncedLyrics extends HookConsumerWidget {
lyricSlice.text, lyricSlice.text,
style: TextStyle( style: TextStyle(
// indicating the active state of that lyric slice // indicating the active state of that lyric slice
color: isActive ? Colors.green : null, color: isActive
? Theme.of(context).primaryColor
: null,
fontWeight: isActive ? FontWeight.bold : null, fontWeight: isActive ? FontWeight.bold : null,
fontSize: 30, fontSize: 30,
), ),

View File

@ -30,7 +30,7 @@ class PlayerTrackDetails extends HookConsumerWidget {
return Container( return Container(
height: 50, height: 50,
width: 50, width: 50,
color: Colors.green[400], color: Theme.of(context).primaryColor,
); );
}, },
), ),

View File

@ -133,23 +133,44 @@ class Settings extends HookConsumerWidget {
onTap: pickColorScheme(ColorSchemeType.background), onTap: pickColorScheme(ColorSchemeType.background),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
ListTile( Padding(
title: padding: const EdgeInsets.all(15),
const Text("Market Place (Recommendation Country)"), child: Wrap(
horizontalTitleGap: 10, alignment: WrapAlignment.spaceBetween,
trailing: DropdownButton( children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Market Place",
style: Theme.of(context).textTheme.bodyText1,
),
Text(
"Recommendation Country",
style: Theme.of(context).textTheme.caption,
),
],
),
const SizedBox(height: 10),
DropdownButton(
value: preferences.recommendationMarket, value: preferences.recommendationMarket,
items: spotifyMarkets items: spotifyMarkets
.map((country) => (DropdownMenuItem( .map(
child: Text(country), (country) => (DropdownMenuItem(
value: country, child: Text(country.last),
))) value: country.first,
)),
)
.toList(), .toList(),
onChanged: (value) { onChanged: (value) {
if (value == null) return; if (value == null) return;
preferences.setRecommendationMarket(value as String); preferences.setRecommendationMarket(
value as String,
);
}, },
), ),
],
),
), ),
ListTile( ListTile(
title: const Text("Download lyrics along with the Track"), title: const Text("Download lyrics along with the Track"),

View File

@ -175,7 +175,7 @@ class TrackTile extends HookConsumerWidget {
return Container( return Container(
height: 40, height: 40,
width: 40, width: 40,
color: Colors.green[300], color: Theme.of(context).primaryColor,
); );
}, },
imageUrl: thumbnailUrl!, imageUrl: thumbnailUrl!,

View File

@ -1,186 +1,188 @@
// Country Codes contributed by momobobe <https://github.com/momobobe>
final spotifyMarkets = [ final spotifyMarkets = [
"AD", ["AL", "Albania (AL)"],
"AE", ["DZ", "Algeria (DZ)"],
"AG", ["AD", "Andorra (AD)"],
"AL", ["AO", "Angola (AO)"],
"AM", ["AG", "Antigua and Barbuda (AG)"],
"AO", ["AR", "Argentina (AR)"],
"AR", ["AM", "Armenia (AM)"],
"AT", ["AU", "Australia (AU)"],
"AU", ["AT", "Austria (AT)"],
"AZ", ["AZ", "Azerbaijan (AZ)"],
"BA", ["BH", "Bahrain (BH)"],
"BB", ["BD", "Bangladesh (BD)"],
"BD", ["BB", "Barbados (BB)"],
"BE", ["BY", "Belarus (BY)"],
"BF", ["BE", "Belgium (BE)"],
"BG", ["BZ", "Belize (BZ)"],
"BH", ["BJ", "Benin (BJ)"],
"BI", ["BT", "Bhutan (BT)"],
"BJ", ["BO", "Bolivia (BO)"],
"BN", ["BA", "Bosnia and Herzegovina (BA)"],
"BO", ["BW", "Botswana (BW)"],
"BR", ["BR", "Brazil (BR)"],
"BS", ["BN", "Brunei Darussalam (BN)"],
"BT", ["BG", "Bulgaria (BG)"],
"BW", ["BF", "Burkina Faso (BF)"],
"BY", ["BI", "Burundi (BI)"],
"BZ", ["CV", "Cabo Verde / Cape Verde (CV)"],
"CA", ["KH", "Cambodia (KH)"],
"CD", ["CM", "Cameroon (CM)"],
"CG", ["CA", "Canada (CA)"],
"CH", ["TD", "Chad (TD)"],
"CI", ["CL", "Chile (CL)"],
"CL", ["CO", "Colombia (CO)"],
"CM", ["KM", "Comoros (KM)"],
"CO", ["CR", "Costa Rica (CR)"],
"CR", ["HR", "Croatia (HR)"],
"CV", ["CW", "Curaçao (CW)"],
"CW", ["CY", "Cyprus (CY)"],
"CY", ["CZ", "Czech Republic (CZ)"],
"CZ", ["CI", "Côte d'Ivoire / Ivory Coast (CI)"],
"DE", ["CD", "Democratic Republic of the Congo (CD)"],
"DJ", ["DK", "Denmark (DK)"],
"DK", ["DJ", "Djibouti (DJ)"],
"DM", ["DM", "Dominica (DM)"],
"DO", ["DO", "Dominican Republic (DO)"],
"DZ", ["EC", "Ecuador (EC)"],
"EC", ["EG", "Egypt (EG)"],
"EE", ["SV", "El Salvador (SV)"],
"EG", ["GQ", "Equatorial Guinea (GQ)"],
"ES", ["EE", "Estonia (EE)"],
"FI", ["SZ", "Eswatini (SZ)"],
"FJ", ["FJ", "Fiji (FJ)"],
"FM", ["FI", "Finland (FI)"],
"FR", ["FR", "France (FR)"],
"GA", ["GA", "Gabon (GA)"],
"GB", ["GE", "Georgia (GE)"],
"GD", ["DE", "Germany (DE)"],
"GE", ["GH", "Ghana (GH)"],
"GH", ["GR", "Greece (GR)"],
"GM", ["GD", "Grenada (GD)"],
"GN", ["GT", "Guatemala (GT)"],
"GQ", ["GN", "Guinea (GN)"],
"GR", ["GW", "Guinea-Bissau (GW)"],
"GT", ["GY", "Guyana (GY)"],
"GW", ["HT", "Haiti (HT)"],
"GY", ["HN", "Honduras (HN)"],
"HK", ["HK", "Hong Kong (HK)"],
"HN", ["HU", "Hungary (HU)"],
"HR", ["IS", "Iceland (IS)"],
"HT", ["IN", "India (IN)"],
"HU", ["ID", "Indonesia (ID)"],
"ID", ["IQ", "Iraq (IQ)"],
"IE", ["IE", "Ireland (IE)"],
"IL", ["IL", "Israel (IL)"],
"IN", ["IT", "Italy (IT)"],
"IQ", ["JM", "Jamaica (JM)"],
"IS", ["JP", "Japan (JP)"],
"IT", ["JO", "Jordan (JO)"],
"JM", ["KZ", "Kazakhstan (KZ)"],
"JO", ["KE", "Kenya (KE)"],
"JP", ["KI", "Kiribati (KI)"],
"KE", ["XK", "Kosovo (XK)"],
"KG", ["KW", "Kuwait (KW)"],
"KH", ["KG", "Kyrgyzstan (KG)"],
"KI", ["LA", "Laos (LA)"],
"KM", ["LV", "Latvia (LV)"],
"KN", ["LB", "Lebanon (LB)"],
"KR", ["LS", "Lesotho (LS)"],
"KW", ["LR", "Liberia (LR)"],
"KZ", ["LY", "Libya (LY)"],
"LA", ["LI", "Liechtenstein (LI)"],
"LB", ["LT", "Lithuania (LT)"],
"LC", ["LU", "Luxembourg (LU)"],
"LI", ["MO", "Macao / Macau (MO)"],
"LK", ["MG", "Madagascar (MG)"],
"LR", ["MW", "Malawi (MW)"],
"LS", ["MY", "Malaysia (MY)"],
"LT", ["MV", "Maldives (MV)"],
"LU", ["ML", "Mali (ML)"],
"LV", ["MT", "Malta (MT)"],
"LY", ["MH", "Marshall Islands (MH)"],
"MA", ["MR", "Mauritania (MR)"],
"MC", ["MU", "Mauritius (MU)"],
"MD", ["MX", "Mexico (MX)"],
"ME", ["FM", "Micronesia (FM)"],
"MG", ["MD", "Moldova (MD)"],
"MH", ["MC", "Monaco (MC)"],
"MK", ["MN", "Mongolia (MN)"],
"ML", ["ME", "Montenegro (ME)"],
"MN", ["MA", "Morocco (MA)"],
"MO", ["MZ", "Mozambique (MZ)"],
"MR", ["NA", "Namibia (NA)"],
"MT", ["NR", "Nauru (NR)"],
"MU", ["NP", "Nepal (NP)"],
"MV", ["NL", "Netherlands (NL)"],
"MW", ["NZ", "New Zealand (NZ)"],
"MX", ["NI", "Nicaragua (NI)"],
"MY", ["NE", "Niger (NE)"],
"MZ", ["NG", "Nigeria (NG)"],
"NA", ["MK", "North Macedonia (MK)"],
"NE", ["NO", "Norway (NO)"],
"NG", ["OM", "Oman (OM)"],
"NI", ["PK", "Pakistan (PK)"],
"NL", ["PW", "Palau (PW)"],
"NO", ["PS", "Palestine (PS)"],
"NP", ["PA", "Panama (PA)"],
"NR", ["PG", "Papua New Guinea (PG)"],
"NZ", ["PY", "Paraguay (PY)"],
"OM", ["PE", "Peru (PE)"],
"PA", ["PH", "Philippines (PH)"],
"PE", ["PL", "Poland (PL)"],
"PG", ["PT", "Portugal (PT)"],
"PH", ["QA", "Qatar (QA)"],
"PK", ["CG", "Republic of the Congo (CG)"],
"PL", ["RO", "Romania (RO)"],
"PS", ["RU", "Russia (RU)"],
"PT", ["RW", "Rwanda (RW)"],
"PW", ["WS", "Samoa (WS)"],
"PY", ["SM", "San Marino (SM)"],
"QA", ["SA", "Saudi Arabia (SA)"],
"RO", ["SN", "Senegal (SN)"],
"RS", ["RS", "Serbia (RS)"],
"RU", ["SC", "Seychelles (SC)"],
"RW", ["SL", "Sierra Leone (SL)"],
"SA", ["SG", "Singapore (SG)"],
"SB", ["SK", "Slovakia (SK)"],
"SC", ["SI", "Slovenia (SI)"],
"SE", ["SB", "Solomon Islands (SB)"],
"SG", ["ZA", "South Africa (ZA)"],
"SI", ["KR", "South Korea (KR)"],
"SK", ["ES", "Spain (ES)"],
"SL", ["LK", "Sri Lanka (LK)"],
"SM", ["VC", "St Vincent and the Grenadines (VC)"],
"SN", ["KN", "St. Kitts and Nevis (KN)"],
"SR", ["LC", "St. Lucia (LC)"],
"ST", ["SR", "Suriname (SR)"],
"SV", ["SE", "Sweden (SE)"],
"SZ", ["CH", "Switzerland (CH)"],
"TD", ["ST", "São Tomé and Príncipe (ST)"],
"TG", ["TW", "Taiwan (TW)"],
"TH", ["TJ", "Tajikistan (TJ)"],
"TJ", ["TZ", "Tanzania (TZ)"],
"TL", ["TH", "Thailand (TH)"],
"TN", ["BS", "The Bahamas (BS)"],
"TO", ["GM", "The Gambia (GM)"],
"TR", ["TL", "Timor-Leste / East Timor (TL)"],
"TT", ["TG", "Togo (TG)"],
"TV", ["TO", "Tonga (TO)"],
"TW", ["TT", "Trinidad and Tobago (TT)"],
"TZ", ["TN", "Tunisia (TN)"],
"UA", ["TR", "Turkey (TR)"],
"UG", ["TV", "Tuvalu (TV)"],
"US", ["UG", "Uganda (UG)"],
"UY", ["UA", "Ukraine (UA)"],
"UZ", ["AE", "United Arab Emirates (AE)"],
"VC", ["GB", "United Kingdom (GB)"],
"VE", ["US", "United States (US)"],
"VN", ["UY", "Uruguay (UY)"],
"VU", ["UZ", "Uzbekistan (UZ)"],
"WS", ["VU", "Vanuatu (VU)"],
"XK", ["VE", "Venezuela (VE)"],
"ZA", ["VN", "Vietnam (VN)"],
"ZM", ["ZM", "Zambia (ZM)"],
"ZW" ["Z", "Zimbabwe (ZW)"],
]; ];