-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 修改默认主页时,不会重新刷新当前页面 * 统一不同主页的显示 * AppBar 上不显示头像
- Loading branch information
Showing
9 changed files
with
122 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:smart_home/blocs/blocs.dart'; | ||
import 'package:smart_home/models/app_tab.dart'; | ||
import 'package:smart_home/models/grobal_keys.dart'; | ||
import 'package:smart_home/widgets/drawer.dart'; | ||
import 'package:smart_home/widgets/tab_selector.dart'; | ||
|
||
class MyHomePage extends StatelessWidget { | ||
final String title; | ||
final List<Widget> actions; | ||
final Widget body; | ||
final Widget floatingActionButton; | ||
final AppTab activeTab; | ||
|
||
const MyHomePage({ | ||
@required this.title, | ||
@required this.activeTab, | ||
@required this.body, | ||
this.actions, | ||
this.floatingActionButton, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
key: scaffoldKey, | ||
drawer: MyDrawer(), | ||
appBar: AppBar( | ||
title: Text(title), | ||
actions: actions, | ||
), | ||
body: body, | ||
bottomNavigationBar: TabSelector( | ||
activeTab: activeTab, | ||
onTabSelected: (tab) => | ||
BlocProvider.of<TabBloc>(context).add(TabChanged(tab)), | ||
), | ||
floatingActionButton: floatingActionButton, | ||
); | ||
} | ||
} |