From 8c07ed7a88bd0500d30f1e99cf9b9605ea2b7f78 Mon Sep 17 00:00:00 2001 From: Ray Jasson <48130098+rayjasson98@users.noreply.github.com> Date: Mon, 28 Dec 2020 19:41:41 +0800 Subject: [PATCH] Modify implementation of page widgets --- lib/ui/IoT/IoT_monitoring_page.dart | 8 +++++--- lib/ui/diseases/disease_detection_page.dart | 8 ++++---- lib/ui/farm/farm_management_page.dart | 8 ++++---- lib/ui/profile/user_profile.dart | 5 ----- lib/ui/widgets/tab_page.dart | 4 ++-- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/lib/ui/IoT/IoT_monitoring_page.dart b/lib/ui/IoT/IoT_monitoring_page.dart index 072efe1..8838f4b 100644 --- a/lib/ui/IoT/IoT_monitoring_page.dart +++ b/lib/ui/IoT/IoT_monitoring_page.dart @@ -10,11 +10,13 @@ class IoTMonitoringPage extends TabPage { } class _IoTMonitoringPageState extends TabPageState { - @override - void dispose() => super.dispose(); - @override Widget build(BuildContext context) { return super.build(context); } + + @override + Widget buildTabListView() { + return super.buildTabListView(); + } } diff --git a/lib/ui/diseases/disease_detection_page.dart b/lib/ui/diseases/disease_detection_page.dart index 01e5952..f465f88 100644 --- a/lib/ui/diseases/disease_detection_page.dart +++ b/lib/ui/diseases/disease_detection_page.dart @@ -11,12 +11,12 @@ class DiseaseDetectionPage extends TabPage { class _DiseaseDetectionPageState extends TabPageState { @override - void dispose() { - super.dispose(); + Widget build(BuildContext context) { + return super.build(context); } @override - Widget build(BuildContext context) { - return super.build(context); + Widget buildTabListView() { + return super.buildTabListView(); } } diff --git a/lib/ui/farm/farm_management_page.dart b/lib/ui/farm/farm_management_page.dart index 83de646..1af8103 100644 --- a/lib/ui/farm/farm_management_page.dart +++ b/lib/ui/farm/farm_management_page.dart @@ -11,12 +11,12 @@ class FarmManagementPage extends TabPage { class _FarmManagementState extends TabPageState { @override - void dispose() { - super.dispose(); + Widget build(BuildContext context) { + return super.build(context); } @override - Widget build(BuildContext context) { - return super.build(context); + Widget buildTabListView() { + return super.buildTabListView(); } } diff --git a/lib/ui/profile/user_profile.dart b/lib/ui/profile/user_profile.dart index 61fc462..15bf6e8 100644 --- a/lib/ui/profile/user_profile.dart +++ b/lib/ui/profile/user_profile.dart @@ -10,11 +10,6 @@ class UserProfilePage extends TabPage { } class _UserProfilePagePageState extends TabPageState { - @override - void dispose() { - super.dispose(); - } - @override Widget build(BuildContext context) { return super.build(context); diff --git a/lib/ui/widgets/tab_page.dart b/lib/ui/widgets/tab_page.dart index 1637b71..91befee 100644 --- a/lib/ui/widgets/tab_page.dart +++ b/lib/ui/widgets/tab_page.dart @@ -36,7 +36,7 @@ class TabPageState extends State backgroundColor: Colors.transparent, body: Stack( children: [ - _buildTabListView(), + buildTabListView(), TabAppBar( scrollController: _scrollController, title: widget.pageTitle, @@ -50,7 +50,7 @@ class TabPageState extends State ); } - Widget _buildTabListView() { + Widget buildTabListView() { return ListView.builder( controller: _scrollController, padding: EdgeInsets.only(