iced::widget

Function qr_code

Source
pub fn qr_code<'a, Theme>(data: &'a Data) -> QRCode<'a, Theme>
where Theme: Catalog + 'a,
Available on crate feature qr_code only.
Expand description

Creates a new QRCode widget from the given Data.

QR codes display information in a type of two-dimensional matrix barcode.

ยงExample

use iced::widget::qr_code;

struct State {
   data: qr_code::Data,
}

#[derive(Debug, Clone)]
enum Message {
    // ...
}

fn view(state: &State) -> Element<'_, Message> {
    qr_code(&state.data).into()
}