From 1ffc45a7f2843945e944f0b93f9858a263804f06 Mon Sep 17 00:00:00 2001 From: Mati Date: Fri, 6 Oct 2023 18:24:46 -0300 Subject: [PATCH 1/2] feat(tab view): makes it take custom colors PE-4711 --- lib/src/components/tab_view.dart | 47 ++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/lib/src/components/tab_view.dart b/lib/src/components/tab_view.dart index 423199f..76eaf86 100644 --- a/lib/src/components/tab_view.dart +++ b/lib/src/components/tab_view.dart @@ -5,7 +5,21 @@ typedef ArDriveTab = MapEntry; class ArDriveTabView extends StatefulWidget { final List tabs; - const ArDriveTabView({Key? key, required this.tabs}) : super(key: key); + final Color? backgroundColor; + final Color? selectedLabelColor; + final Color? unselectedLabelColor; + final Color? selectedTabColor; + final Color? unselectedTabColor; + + const ArDriveTabView({ + Key? key, + required this.tabs, + this.backgroundColor, + this.selectedLabelColor, + this.unselectedLabelColor, + this.selectedTabColor, + this.unselectedTabColor, + }) : super(key: key); @override State createState() => _ArDriveTabViewState(); @@ -31,6 +45,10 @@ class _ArDriveTabViewState extends State ArDriveTabBar( tabs: [...widget.tabs.map((tab) => tab.key)], controller: _tabController, + selectedLabelColor: widget.selectedLabelColor, + unselectedLabelColor: widget.unselectedLabelColor, + selectedTabColor: widget.selectedTabColor, + unselectedTabColor: widget.unselectedTabColor, ), const SizedBox( height: 28, @@ -38,7 +56,7 @@ class _ArDriveTabViewState extends State Expanded( child: ArDriveCard( contentPadding: EdgeInsets.zero, - backgroundColor: + backgroundColor: widget.backgroundColor ?? ArDriveTheme.of(context).themeData.colors.themeBgCanvas, content: TabBarView( controller: _tabController, @@ -54,9 +72,20 @@ class _ArDriveTabViewState extends State class ArDriveTabBar extends StatelessWidget { final List tabs; final TabController controller; + final Color? selectedTabColor; + final Color? unselectedTabColor; + final Color? selectedLabelColor; + final Color? unselectedLabelColor; - const ArDriveTabBar( - {super.key, required this.tabs, required this.controller}); + const ArDriveTabBar({ + super.key, + required this.tabs, + required this.controller, + this.selectedTabColor, + this.unselectedTabColor, + this.selectedLabelColor, + this.unselectedLabelColor, + }); final borderRadius = 8.0; @@ -81,7 +110,8 @@ class ArDriveTabBar extends StatelessWidget { return Container( height: 40, decoration: BoxDecoration( - color: ArDriveTheme.of(context).themeData.tableTheme.backgroundColor, + color: unselectedTabColor ?? + ArDriveTheme.of(context).themeData.tableTheme.backgroundColor, borderRadius: BorderRadius.circular(8), ), child: TabBar( @@ -91,11 +121,12 @@ class ArDriveTabBar extends StatelessWidget { controller.index, controller.length, ), - color: + color: selectedTabColor ?? ArDriveTheme.of(context).themeData.tableTheme.selectedItemColor, ), - labelColor: ArDriveTheme.of(context).themeData.colors.themeFgDefault, - unselectedLabelColor: + labelColor: selectedLabelColor ?? + ArDriveTheme.of(context).themeData.colors.themeFgDefault, + unselectedLabelColor: unselectedLabelColor ?? ArDriveTheme.of(context).themeData.colors.themeAccentDisabled, tabs: tabs, ), From 470ca4f2d9c7a3111eb7f3417c1cfdae3b0d2393 Mon Sep 17 00:00:00 2001 From: Mati Date: Tue, 31 Oct 2023 16:22:57 -0300 Subject: [PATCH 2/2] feat(pubspec): before-release version bump PE-4711 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e35392d..bdca267 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: ardrive_ui description: UI Design Library for the ArDrive Design System -version: 1.13.1 +version: 1.14.0 publish_to: "none"