mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-26 01:57:55 +00:00
rem oved comments and removed copyWith fromAnalyticsTabState because the state object only has one property, so i replaced the state object with AnalyticsPageTab enum.
This commit is contained in:
@@ -11,9 +11,9 @@ class AnalyticsPageTabsAndChildren extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AnalyticsTabBloc, AnalyticsTabState>(
|
||||
buildWhen: (previous, current) => previous.selectedTab != current.selectedTab,
|
||||
builder: (context, state) => Column(
|
||||
return BlocBuilder<AnalyticsTabBloc, AnalyticsPageTab>(
|
||||
buildWhen: (previous, current) => previous != current,
|
||||
builder: (context, selectedTab) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -21,10 +21,7 @@ class AnalyticsPageTabsAndChildren extends StatelessWidget {
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 1,
|
||||
decoration: subSectionContainerDecoration,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 32,
|
||||
// vertical: 48,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -44,7 +41,7 @@ class AnalyticsPageTabsAndChildren extends StatelessWidget {
|
||||
...AnalyticsPageTab.values.map(
|
||||
(tab) => AnalyticsPageTabButton(
|
||||
tab: tab,
|
||||
isSelected: tab == state.selectedTab,
|
||||
isSelected: tab == selectedTab,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -71,7 +68,7 @@ class AnalyticsPageTabsAndChildren extends StatelessWidget {
|
||||
child: AnimatedSwitcher(
|
||||
switchInCurve: Curves.easeIn,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: state.selectedTab.child,
|
||||
child: selectedTab.child,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user