|
@@ -61,98 +61,12 @@ class HomePage extends GetView<HomeController> {
|
|
|
}
|
|
|
|
|
|
Widget _buildBody(BuildContext context) {
|
|
|
- final menuScrollController = ScrollController();
|
|
|
+ Widget leftMenus = SizedBox();
|
|
|
+ if (controller.state.menuItems.length != 1) leftMenus = _buildMenu(context);
|
|
|
return Row(
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
children: [
|
|
|
- controller.state.menuItems.length != 1
|
|
|
- ? Container(
|
|
|
- width: 120,
|
|
|
- // color: const Color.fromRGBO(10, 32, 48, .8),
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- // Color.fromRGBO(59, 188, 255, 1),
|
|
|
- // Color.fromRGBO(44, 120, 229, 1),
|
|
|
- Theme.of(context).primaryColor,
|
|
|
- FColorHelper.mixColor(
|
|
|
- Colors.black, Theme.of(context).primaryColor, 50),
|
|
|
- ],
|
|
|
- begin: Alignment.bottomRight,
|
|
|
- end: Alignment.topLeft,
|
|
|
- ),
|
|
|
- ),
|
|
|
- child: Stack(
|
|
|
- children: [
|
|
|
- Positioned(
|
|
|
- bottom: 0,
|
|
|
- left: 0,
|
|
|
- right: 0,
|
|
|
- child: Opacity(
|
|
|
- opacity: 0.5,
|
|
|
- child: Image.asset(
|
|
|
- "assets/images/e_hospital.png",
|
|
|
- fit: BoxFit.fitWidth,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Column(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- children: [
|
|
|
- SizedBox(
|
|
|
- height: 90,
|
|
|
- child: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Obx(
|
|
|
- () => HomeAvatarWidget(
|
|
|
- size: 40,
|
|
|
- headImageToken:
|
|
|
- controller.state.headImageToken,
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(
|
|
|
- height: 8,
|
|
|
- ),
|
|
|
- Obx(
|
|
|
- () => Text(
|
|
|
- controller.state.doctorName,
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 16,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- Divider(
|
|
|
- color: Colors.white.withOpacity(.4),
|
|
|
- height: 1,
|
|
|
- indent: 30,
|
|
|
- endIndent: 30,
|
|
|
- ),
|
|
|
- const SizedBox(
|
|
|
- height: 8,
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: Obx(
|
|
|
- () {
|
|
|
- return HomeMenuListViewWidget(
|
|
|
- source: controller.state.menuItems,
|
|
|
- scrollerController: menuScrollController,
|
|
|
- currentSelectMenu:
|
|
|
- controller.state.currentSelectMenu,
|
|
|
- );
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
- : SizedBox(),
|
|
|
+ leftMenus,
|
|
|
Container(
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
child: VerticalDivider(
|
|
@@ -183,6 +97,95 @@ class HomePage extends GetView<HomeController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Widget _buildMenu(BuildContext context) {
|
|
|
+ final menuScrollController = ScrollController();
|
|
|
+
|
|
|
+ return Container(
|
|
|
+ width: kIsWeb ? 100 : 120,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [
|
|
|
+ Theme.of(context).primaryColor,
|
|
|
+ FColorHelper.mixColor(
|
|
|
+ Colors.black,
|
|
|
+ Theme.of(context).primaryColor,
|
|
|
+ 50,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ begin: Alignment.bottomRight,
|
|
|
+ end: Alignment.topLeft,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Positioned(
|
|
|
+ bottom: 0,
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ child: Opacity(
|
|
|
+ opacity: 0.5,
|
|
|
+ child: Image.asset(
|
|
|
+ "assets/images/e_hospital.png",
|
|
|
+ fit: BoxFit.fitWidth,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Column(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ children: [
|
|
|
+ SizedBox(
|
|
|
+ height: 90,
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Obx(
|
|
|
+ () => HomeAvatarWidget(
|
|
|
+ size: 40,
|
|
|
+ headImageToken: controller.state.headImageToken,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ const SizedBox(
|
|
|
+ height: 8,
|
|
|
+ ),
|
|
|
+ Obx(
|
|
|
+ () => Text(
|
|
|
+ controller.state.doctorName,
|
|
|
+ style: const TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 16,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Divider(
|
|
|
+ color: Colors.white.withOpacity(.4),
|
|
|
+ height: 1,
|
|
|
+ indent: 30,
|
|
|
+ endIndent: 30,
|
|
|
+ ),
|
|
|
+ const SizedBox(
|
|
|
+ height: 8,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Obx(
|
|
|
+ () {
|
|
|
+ return HomeMenuListViewWidget(
|
|
|
+ source: controller.state.menuItems,
|
|
|
+ scrollerController: menuScrollController,
|
|
|
+ currentSelectMenu: controller.state.currentSelectMenu,
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
Widget _buildContent() {
|
|
|
return Padding(
|
|
|
padding: EdgeInsets.all(8),
|