This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code format, description misc small changes
- Loading branch information
Showing
9 changed files
with
58 additions
and
64 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// 🐦 Flutter imports: | ||
import "package:flutter/material.dart"; | ||
|
||
Image bgImage(String name) => Image.asset( | ||
"assets/images/" + name, | ||
fit: BoxFit.cover, | ||
width: double.infinity, | ||
alignment: Alignment.center, | ||
); | ||
Image bgImage(String name) { | ||
return Image.asset( | ||
"assets/images/" + name, | ||
fit: BoxFit.cover, | ||
width: double.infinity, | ||
alignment: Alignment.center, | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// * Simulate Server Request | ||
/// Simulate Server Request, Delay for 1 second | ||
Future<void> serverRequest() async { | ||
await Future.delayed(const Duration(milliseconds: 1000)); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,47 @@ | ||
class Label10n { | ||
String en; | ||
String? th; | ||
// * https://app.quicktype.io/ | ||
|
||
// 🎯 Dart imports: | ||
import "dart:convert"; | ||
|
||
// 🐦 Flutter imports: | ||
import "package:flutter/material.dart"; | ||
|
||
// 🌎 Project imports: | ||
import "package:food_busters/main.dart"; | ||
|
||
class Label10n { | ||
Label10n({ | ||
required this.en, | ||
this.th, | ||
}); | ||
|
||
String toStr(String loc) { | ||
return (loc == "th") ? (th ?? en) : en; | ||
final String en; | ||
final String? th; | ||
|
||
String get(BuildContext context) { | ||
if (th == null) return en; | ||
|
||
final lang = MyApp.of(context).localeStrSimp; | ||
|
||
if (lang == "th") { | ||
return th!; | ||
} else { | ||
return en; | ||
} | ||
} | ||
|
||
factory Label10n.fromRawJson(String str) => | ||
Label10n.fromJson(json.decode(str)); | ||
|
||
String toRawJson() => json.encode(toJson()); | ||
|
||
factory Label10n.fromJson(Map<String, dynamic> json) => Label10n( | ||
en: json["en"], | ||
th: json["th"], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
"en": en, | ||
"th": th, | ||
}; | ||
} |
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
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
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
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
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