In this final part we will be using the react package to build out the other examples. The react package provides a much friendlier API for building custom components:

import 'dart:async';



import 'package:react/react.dart';



class TickerComponent extends Component {

Timer interval;



tick() { ... }



@override

Map getInitialState() => {'seconds': 0};



@override

componentDidMount() { ... }



@override

componentWillUnmount() { ... }



@override

render() => div({}, 'Seconds ${state["seconds"]}');

}



var Ticker = registerComponent(() => TickerComponent());

Learn more here in the full video:

→ Watch on YouTube

→ Get the source code