AppFlowy/app_flowy/lib/home/presentation/home_screen.dart
2021-07-06 19:56:56 +08:00

35 lines
905 B
Dart

import 'package:app_flowy/home/domain/page_context.dart';
import 'package:app_flowy/home/presentation/widgets/blank_page.dart';
import 'package:flutter/material.dart';
class HomeScreen extends StatelessWidget {
static GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
const HomeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: null,
);
}
}
extension PageTypeExtension on PageType {
HomeStackPage builder(PageContext context) {
switch (this) {
case PageType.blank:
return BlankPage(context: context);
}
}
}
List<Widget> buildPagesWidget(PageContext pageContext) {
return PageType.values.map((pageType) {
if (pageType == pageContext.pageType) {
return pageType.builder(pageContext);
} else {
return const BlankPage(context: BlankPageContext());
}
}).toList();
}