-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from openvinotoolkit/rhecker/no-model-message
Add "No models" message
- Loading branch information
Showing
6 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2024 Intel Corporation. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'package:fluent_ui/fluent_ui.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
|
||
class EmptyModelListWidget extends StatelessWidget { | ||
final String? searchQuery; | ||
const EmptyModelListWidget({super.key, this.searchQuery}); | ||
|
||
String get header { | ||
if (searchQuery == null || searchQuery == "") { | ||
return "No models"; | ||
} else { | ||
return "No results found"; | ||
} | ||
} | ||
|
||
String get reason { | ||
if (searchQuery == null || searchQuery == "") { | ||
return "Click 'import model' to download a model"; | ||
} else { | ||
return "We couldn't find a match for \"$searchQuery\"\n Please try another search"; | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.all(50.0), | ||
child: Column( | ||
children: [ | ||
SvgPicture.asset('images/slide_search.svg'), | ||
Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Text( | ||
header, | ||
style: const TextStyle(fontSize: 20)), | ||
), | ||
Text(reason, textAlign: TextAlign.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