mirror of
https://github.com/foss42/apidash.git
synced 2025-06-27 19:07:40 +08:00
Merge pull request #290 from carlos19960601/fix_intro_message
fix: when snapshot.hasError is true, text has not been initialized
This commit is contained in:
@ -23,6 +23,9 @@ class IntroMessage extends StatelessWidget {
|
|||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: introData(),
|
future: introData(),
|
||||||
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
|
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return const ErrorMessage(message: "An error occured");
|
||||||
|
}
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
if (Theme.of(context).brightness == Brightness.dark) {
|
if (Theme.of(context).brightness == Brightness.dark) {
|
||||||
text = text.replaceAll("{{mode}}", "dark");
|
text = text.replaceAll("{{mode}}", "dark");
|
||||||
@ -37,9 +40,6 @@ class IntroMessage extends StatelessWidget {
|
|||||||
padding: kPh60,
|
padding: kPh60,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (snapshot.hasError) {
|
|
||||||
return const ErrorMessage(message: "An error occured");
|
|
||||||
}
|
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user