pub struct LicensePage<Msg = Callback> { /* private fields */ }Expand description
The licences of everything an application links, as a page.
A list of packages, each with the licences covering it; selecting one shows the text.
The selection is the application’s, like every other piece of state here, so the
page fits a route as easily as a panel: on_select(Some(i)) on a row, and
on_select(None) from the way back.
It does not scroll itself, and it does not guess how tall it is: put it in a
crate::SingleChildScrollView, or in a scaffold’s scrolling body, which is where a page
belongs anyway.
LicensePage::new(app.licence_open, Msg::OpenLicence)
.application("Tasks")
.version("1.4.0")
.legalese("© 2026 Someone")
.build()Implementations§
Source§impl<Msg> LicensePage<Msg>where
Msg: Clone + 'static,
impl<Msg> LicensePage<Msg>where
Msg: Clone + 'static,
Sourcepub fn new(
selected: Option<usize>,
on_select: impl Fn(Option<usize>) -> Msg + 'static,
) -> LicensePage<Msg>
pub fn new( selected: Option<usize>, on_select: impl Fn(Option<usize>) -> Msg + 'static, ) -> LicensePage<Msg>
A page over everything add_all has registered. selected is which package is
open — an index into the page’s own list — and on_select carries the row that was
touched, or None for the way back.
Sourcepub fn notices(self, notices: Vec<LicenseNotice>) -> LicensePage<Msg>
pub fn notices(self, notices: Vec<LicenseNotice>) -> LicensePage<Msg>
A page over notices of the caller’s own, instead of the registry’s.
Sourcepub fn application(self, name: impl Into<String>) -> LicensePage<Msg>
pub fn application(self, name: impl Into<String>) -> LicensePage<Msg>
The application’s name, at the head of the page.
Sourcepub fn version(self, version: impl Into<String>) -> LicensePage<Msg>
pub fn version(self, version: impl Into<String>) -> LicensePage<Msg>
Its version, under the name.
Sourcepub fn legalese(self, legalese: impl Into<String>) -> LicensePage<Msg>
pub fn legalese(self, legalese: impl Into<String>) -> LicensePage<Msg>
The application’s own legal line — a copyright, usually.
Sourcepub fn empty_message(self, message: impl Into<String>) -> LicensePage<Msg>
pub fn empty_message(self, message: impl Into<String>) -> LicensePage<Msg>
What the page says when nothing is registered. There is a default, and it says what to do about it.
Sourcepub fn back_label(self, label: impl Into<String>) -> LicensePage<Msg>
pub fn back_label(self, label: impl Into<String>) -> LicensePage<Msg>
The label on the way back from a licence, for an application in another language.
Sourcepub fn text_style(self, style: TextStyle) -> LicensePage<Msg>
pub fn text_style(self, style: TextStyle) -> LicensePage<Msg>
The type the licence text is set in.
Sourcepub fn width(self, width: f32) -> LicensePage<Msg>
pub fn width(self, width: f32) -> LicensePage<Msg>
An explicit width.
Sourcepub fn flex(self, grow: f32) -> LicensePage<Msg>
pub fn flex(self, grow: f32) -> LicensePage<Msg>
The share of a parent flex’s spare room the page takes.
Auto Trait Implementations§
impl<Msg = Callback> !RefUnwindSafe for LicensePage<Msg>
impl<Msg = Callback> !Send for LicensePage<Msg>
impl<Msg = Callback> !Sync for LicensePage<Msg>
impl<Msg = Callback> !UnwindSafe for LicensePage<Msg>
impl<Msg> Freeze for LicensePage<Msg>
impl<Msg> Unpin for LicensePage<Msg>
impl<Msg> UnsafeUnpin for LicensePage<Msg>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.