You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
Dart
51 lines
1.1 KiB
Dart
// import 'package:flutter/material.dart';
|
|
// import 'package:provider/provider.dart';
|
|
//
|
|
// import 'base_view_model.dart';
|
|
// import 'locater.dart';
|
|
//
|
|
// class BaseView<T extends BaseViewModel> extends StatefulWidget {
|
|
// final Widget Function(BuildContext context, T model, Widget child) builder;
|
|
// final Function(T) onModelReady;
|
|
//
|
|
// BaseView({
|
|
// this.builder,
|
|
// this.onModelReady,
|
|
// });
|
|
//
|
|
// @override
|
|
// _BaseViewState<T> createState() => _BaseViewState<T>();
|
|
// }
|
|
//
|
|
// class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
|
|
// T model = locator<T>();
|
|
//
|
|
// bool isLogin = false;
|
|
//
|
|
// @override
|
|
// void initState() {
|
|
// if (widget.onModelReady != null) {
|
|
// widget.onModelReady(model);
|
|
// }
|
|
//
|
|
// super.initState();
|
|
// }
|
|
//
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// return ChangeNotifierProvider<T>.value(
|
|
// value: model,
|
|
// child: Consumer<T>(builder: widget.builder),
|
|
// );
|
|
// }
|
|
//
|
|
// @override
|
|
// void dispose() {
|
|
// if (model != null) {
|
|
// model = null;
|
|
// }
|
|
//
|
|
// super.dispose();
|
|
// }
|
|
// }
|