Skip to content

Commit 9bb28f6

Browse files
committed
Update remove unused index prop
1 parent e466d38 commit 9bb28f6

5 files changed

Lines changed: 2 additions & 29 deletions

File tree

lib/components/tab_bar_navigation_title.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:uuid/v8.dart';
55
class TabBarNavigationTitle {
66
TabBarNavigationTitle({
77
required this.title,
8-
required this.index,
98
required this.widget,
109
this.titleStyle,
1110
this.onTap,
@@ -14,7 +13,6 @@ class TabBarNavigationTitle {
1413
TextStyle? titleStyle;
1514

1615
final UuidV8 id = const UuidV8();
17-
final int index;
1816
final String title;
1917
final Widget widget;
2018
Function(TabBarNavigationTitle)? onTap;

lib/constants/image.constants.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,9 @@ enum AssetIcons {
9090
break;
9191
}
9292
if (path.extension(imageName) == '.svg') {
93-
return SvgPicture.asset(
94-
"$basePath/$imageName",
95-
width: 60,
96-
height: 60,
97-
);
93+
return SvgPicture.asset("$basePath/$imageName", width: 60, height: 60);
9894
}
99-
return Image.asset(
100-
"$basePath/$imageName",
101-
width: 60,
102-
height: 60,
103-
);
95+
return Image.asset("$basePath/$imageName", width: 60, height: 60);
10496
}
10597

10698
final String imageName;

lib/features/tab_bar_layout_content_view.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class TabBarLayoutContentView extends TabBarLayoutView {
7272
Navigation().contentTabState?.addItem(
7373
TabBarNavigationTitle(
7474
title: title,
75-
index: data.index ?? 0,
7675
widget: TabBarDetailView(
7776
title: title,
7877
endDrawer: data.hasToc ?? false
@@ -134,7 +133,6 @@ class TabBarLayoutContentView extends TabBarLayoutView {
134133
return TabBarLayoutViewItem(
135134
itemTitle: TabBarNavigationTitle(
136135
title: title.toTitle(),
137-
index: item.index ?? 0,
138136
onTap: (e) => Navigation().contentTabState?.removeUntil(e),
139137
widget: TabBarDetailView(
140138
title: title.toTitle(),

lib/features/tab_bar_layout_tool_view.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import 'package:sengthaite_blog/features/navigation/navigation.dart';
1313
import 'package:sengthaite_blog/features/tool/api/api_util_view.dart';
1414
import 'package:sengthaite_blog/features/tool/api/api_view_desktop.dart';
1515
import 'package:sengthaite_blog/features/tool/api/api_view_mobile.dart';
16-
// import 'package:sengthaite_blog/features/tool/calculator/calculator_view_desktop.dart';
1716
import 'package:sengthaite_blog/features/tool/camera/camera_view.dart';
18-
import 'package:sengthaite_blog/features/tool/qrcode/qrbarcode_view_mobile.dart';
1917
import 'package:sengthaite_blog/features/tool/text_editor/text_editor_tool_base.dart';
2018
import 'package:sengthaite_blog/features/tool/text_editor/text_editor_tool_desktop.dart';
2119
import 'package:sengthaite_blog/features/tool/text_editor/text_editor_tool_mobile.dart';
@@ -33,14 +31,6 @@ class TabBarLayoutToolView extends TabBarLayoutView {
3331
List<ToolItemModel> toolList() {
3432
return [
3533
ToolItemModel(
36-
index: 0,
37-
title: "QR/Bar Code",
38-
image: AssetIcons.qrcode.image,
39-
widgetBuilder: (context) =>
40-
AppLayout(context: context, defaultWidget: QrbarcodeViewMobile()),
41-
),
42-
ToolItemModel(
43-
index: 0,
4434
title: "Camera",
4535
image: AssetIcons.camera.image,
4636
widgetBuilder: (context) =>
@@ -54,7 +44,6 @@ class TabBarLayoutToolView extends TabBarLayoutView {
5444
],
5545
),
5646
ToolItemModel(
57-
index: 0,
5847
title: "Text editor",
5948
image: AssetIcons.textEditor.image,
6049
actions: [
@@ -95,7 +84,6 @@ class TabBarLayoutToolView extends TabBarLayoutView {
9584
),
9685
),
9786
ToolItemModel(
98-
index: 1,
9987
title: "HTTP",
10088
image: AssetIcons.http.image,
10189
actions: [
@@ -159,7 +147,6 @@ class TabBarLayoutToolView extends TabBarLayoutView {
159147
return TabBarLayoutViewItem(
160148
itemTitle: TabBarNavigationTitle(
161149
title: title.toTitle(),
162-
index: item.index,
163150
onTap: (e) => Navigation().toolTabState?.removeUntil(e),
164151
widget: TabBarDetailView(
165152
title: title.toTitle(),

lib/generated/models/tool_model.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:sengthaite_blog/constants/enum.constants.dart';
33

44
class ToolItemModel {
55
final String title;
6-
final int index;
76
final Widget? widget;
87
final Widget? image;
98
final List<Widget>? actions;
@@ -13,7 +12,6 @@ class ToolItemModel {
1312
Function? onDispose;
1413

1514
ToolItemModel({
16-
required this.index,
1715
required this.title,
1816
this.widget,
1917
this.widgetBuilder,

0 commit comments

Comments
 (0)