View difference between Paste ID: e98endsT and agpy25Bu
SHOW: | | - or go back to the newest paste.
1
use iced::{pure::{
2
    widget::{Container, Text},
3
    Element,
4
}, Length};
5
6
use crate::CounterMessage;
7
8
pub struct MainPage;
9
10
impl MainPage {
11-
    pub fn view(&self) -> Element<CounterMessage> {
11+
    pub fn view(state: &crate::Counter) -> Element<CounterMessage> {
12
        Container::new(Text::new("Hello from Page 2",
13-
text("here u would like to see counter value")
13+
state.count
14
15
))
16
            .width(Length::Fill)
17
            .height(Length::Fill)
18
            .center_x()
19
            .center_y()
20
            .into()
21
    }
22
}