Browse Source

Use two letter state codes

master
Robby Zambito 6 months ago
parent
commit
28587a2d49
3 changed files with 11 additions and 11 deletions
  1. +5
    -5
      lib/data/instance.dart
  2. +3
    -3
      lib/endpoints/unauthenticated/available_instances.dart
  3. +3
    -3
      lib/main.dart

+ 5
- 5
lib/data/instance.dart View File

@ -27,9 +27,9 @@ class HamletInstance implements Instance {
HamletInstance({this.city, this.state, this.country});
String get url => "https://"
"${city.toLowerCase()}." +
state != null ? "${state.toLowerCase()}." : "" +
"${country.alpha3Code.toLowerCase()}." +
"hamlet.social";
String get url =>
"https://${city.replaceAll(" ", "").toLowerCase()}." +
(state != null ? "${state.toLowerCase()}." : "") +
"${country.alpha2Code.toLowerCase()}." +
"hamlet.social";
}

+ 3
- 3
lib/endpoints/unauthenticated/available_instances.dart View File

@ -22,15 +22,15 @@ Future> availableInstances() async {
return <HamletInstance>[
HamletInstance(
city: "Cazenovia",
state: "New York",
state: "NY",
country: CountryCodes.detailsForLocale(Locale('en', 'US'))),
HamletInstance(
city: "Syracuse",
state: "New York",
state: "NY",
country: CountryCodes.detailsForLocale(Locale('en', 'US'))),
HamletInstance(
city: "Pittsburgh",
state: "Pennsylvania",
state: "PA",
country: CountryCodes.detailsForLocale(Locale('en', 'US'))),
HamletInstance(
city: "Berlin",

+ 3
- 3
lib/main.dart View File

@ -42,16 +42,16 @@ Future main() async {
await authBloc.initalized;
runApp(MyApp(
runApp(HamletApp(
bloc: authBloc,
pleroma: pleroma,
hamletInstances: await availableInstances()));
}
class MyApp extends StatelessWidget {
class HamletApp extends StatelessWidget {
// This widget is the root of your application.
const MyApp(
const HamletApp(
{Key key, @required this.bloc, this.pleroma, this.hamletInstances})
: super(key: key);

Loading…
Cancel
Save