summaryrefslogtreecommitdiffstats
path: root/examples/pokedex
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/pokedex/Cargo.toml14
-rw-r--r--examples/pokedex/README.md17
-rw-r--r--examples/pokedex/src/main.rs (renamed from examples/pokedex.rs)5
3 files changed, 34 insertions, 2 deletions
diff --git a/examples/pokedex/Cargo.toml b/examples/pokedex/Cargo.toml
new file mode 100644
index 00000000..2972590f
--- /dev/null
+++ b/examples/pokedex/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "pokedex"
+version = "0.1.0"
+authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
+edition = "2018"
+publish = false
+
+[dependencies]
+iced = { path = "../.." }
+iced_futures = { path = "../../futures", features = ["async-std"] }
+surf = "1.0"
+rand = "0.7"
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
diff --git a/examples/pokedex/README.md b/examples/pokedex/README.md
new file mode 100644
index 00000000..50720f57
--- /dev/null
+++ b/examples/pokedex/README.md
@@ -0,0 +1,17 @@
+# Pokédex
+An application that loads a random Pokédex entry using the [PokéAPI].
+
+All the example code can be found in the __[`main`](src/main.rs)__ file.
+
+<div align="center">
+ <a href="https://gfycat.com/aggressivedarkelephantseal-rust-gui">
+ <img src="https://thumbs.gfycat.com/AggressiveDarkElephantseal-small.gif" height="400px">
+ </a>
+</div>
+
+You can run it on native platforms with `cargo run`:
+```
+cargo run --package pokedex
+```
+
+[PokéAPI]: https://pokeapi.co/
diff --git a/examples/pokedex.rs b/examples/pokedex/src/main.rs
index 7326f94f..283437b2 100644
--- a/examples/pokedex.rs
+++ b/examples/pokedex/src/main.rs
@@ -1,6 +1,6 @@
use iced::{
- button, image, Align, Application, Button, Column, Command, Container,
- Element, Image, Length, Row, Settings, Text,
+ button, futures, image, Align, Application, Button, Column, Command,
+ Container, Element, Image, Length, Row, Settings, Text,
};
pub fn main() {
@@ -27,6 +27,7 @@ enum Message {
}
impl Application for Pokedex {
+ type Executor = iced_futures::executor::AsyncStd;
type Message = Message;
fn new() -> (Pokedex, Command<Message>) {