Skip to content

Commit 0c5a7d1

Browse files
committed
Asset file constants
1 parent 4495e0f commit 0c5a7d1

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

lib/consts.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ const kGitUrl = "https://github.com/foss42/apidash";
1010
const kIssueUrl = "$kGitUrl/issues";
1111
const kDefaultUri = "api.apidash.dev";
1212

13+
const kAssetIntroMd = "assets/intro.md";
14+
const kAssetSendingLottie = "assets/sending.json";
15+
const kAssetSavingLottie = "assets/saving.json";
16+
const kAssetSavedLottie = "assets/completed.json";
17+
1318
final kIsMacOS = !kIsWeb && Platform.isMacOS;
1419
final kIsWindows = !kIsWeb && Platform.isWindows;
1520
final kIsLinux = !kIsWeb && Platform.isLinux;

lib/widgets/intro_message.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IntroMessage extends StatelessWidget {
1616
late final String version;
1717

1818
Future<void> introData() async {
19-
text = await rootBundle.loadString('assets/intro.md');
19+
text = await rootBundle.loadString(kAssetIntroMd);
2020
version = (await PackageInfo.fromPlatform()).version;
2121
}
2222

lib/widgets/overlay_widget.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ class SavingOverlay extends StatelessWidget {
4444
mainAxisSize: MainAxisSize.min,
4545
children: [
4646
Lottie.asset(
47-
saveCompleted
48-
? "assets/completed.json"
49-
: "assets/saving.json",
47+
saveCompleted ? kAssetSavedLottie : kAssetSavingLottie,
5048
width: 100,
5149
height: 100),
5250
kHSpacer20,

lib/widgets/response_widgets.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class SendingWidget extends StatelessWidget {
4242
child: Column(
4343
mainAxisAlignment: MainAxisAlignment.center,
4444
children: [
45-
Lottie.asset("assets/sending.json"),
45+
Lottie.asset(kAssetSendingLottie),
4646
],
4747
),
4848
);

0 commit comments

Comments
 (0)