Jelajahi Sumber

[feat]更新tab样式

Destiny 1 tahun lalu
induk
melakukan
58b1b9453b

+ 2 - 0
.gitignore

@@ -5,9 +5,11 @@
 *.swp
 .DS_Store
 .atom/
+.build/
 .buildlog/
 .history
 .svn/
+.swiftpm/
 migrate_working_dir/
 
 # IntelliJ related

TEMPAT SAMPAH
assets/images/icon_tab_home_selected.webp


TEMPAT SAMPAH
assets/images/icon_tab_more_selected.webp


+ 2 - 2
ios/Runner.xcodeproj/project.pbxproj

@@ -10,12 +10,12 @@
 		1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
 		331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
 		3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
-		544943152F7358144C0F8FEC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B5EAD7E9767608367762630 /* Pods_Runner.framework */; };
 		74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
 		97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
 		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
 		97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
 		B5138C8F95558BE009776823 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFFDA88944CD06F05FB33B62 /* Pods_RunnerTests.framework */; };
+		CDB04F6A7C260FA942E1416B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B5EAD7E9767608367762630 /* Pods_Runner.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -80,7 +80,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				544943152F7358144C0F8FEC /* Pods_Runner.framework in Frameworks */,
+				CDB04F6A7C260FA942E1416B /* Pods_Runner.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 27 - 0
ios/build/XCBuildData/e80db4fcd391a0e8dcaaa615bb6652a6.xcbuilddata/build-request.json

@@ -0,0 +1,27 @@
+{
+  "buildCommand" : {
+    "command" : "build",
+    "skipDependencies" : false,
+    "style" : "buildOnly"
+  },
+  "configuredTargets" : [
+
+  ],
+  "continueBuildingAfterErrors" : false,
+  "dependencyScope" : "workspace",
+  "enableIndexBuildArena" : false,
+  "hideShellScriptEnvironment" : false,
+  "parameters" : {
+    "action" : "build",
+    "overrides" : {
+
+    }
+  },
+  "qos" : "utility",
+  "schemeCommand" : "launch",
+  "showNonLoggedProgress" : true,
+  "useDryRun" : false,
+  "useImplicitDependencies" : false,
+  "useLegacyBuildLocations" : false,
+  "useParallelTargets" : true
+}

TEMPAT SAMPAH
ios/build/XCBuildData/e80db4fcd391a0e8dcaaa615bb6652a6.xcbuilddata/description.msgpack


+ 1 - 0
ios/build/XCBuildData/e80db4fcd391a0e8dcaaa615bb6652a6.xcbuilddata/manifest.json

@@ -0,0 +1 @@
+{"client":{"name":"basic","version":0,"file-system":"device-agnostic","perform-ownership-analysis":"no"},"targets":{"":["<all>"]},"commands":{"<all>":{"tool":"phony","inputs":["<WorkspaceHeaderMapVFSFilesWritten>"],"outputs":["<all>"]},"P0:::Gate WorkspaceHeaderMapVFSFilesWritten":{"tool":"phony","inputs":[],"outputs":["<WorkspaceHeaderMapVFSFilesWritten>"]}}}

+ 1 - 0
ios/build/XCBuildData/e80db4fcd391a0e8dcaaa615bb6652a6.xcbuilddata/target-graph.txt

@@ -0,0 +1 @@
+Target dependency graph (0 target)

TEMPAT SAMPAH
ios/build/XCBuildData/e80db4fcd391a0e8dcaaa615bb6652a6.xcbuilddata/task-store.msgpack


+ 1 - 1
lib/module/home/home_view.dart

@@ -18,7 +18,7 @@ class HomePage extends BaseView<HomeController> {
   Widget buildBody(BuildContext context) {
     // TODO: implement buildBody
     return Container(
-      color: Colors.black,
+      color: Colors.white,
     );
   }
 }

+ 44 - 82
lib/module/main/main_view.dart

@@ -24,6 +24,11 @@ class MainTabPage extends BasePage<MainController> {
   }
 
   @override
+  bool immersive() {
+    return true;
+  }
+
+  @override
   Widget buildBody(BuildContext context) {
     return PopScope(
       canPop: false,
@@ -38,92 +43,49 @@ class MainTabPage extends BasePage<MainController> {
   }
 
   Widget buildBottomAppBar() {
-    return Container(
-      // height: 100.h,
-      // decoration: BoxDecoration(
-      //   color: "#0F0F16".color,
-      //   boxShadow: [
-      //     BoxShadow(
-      //       color: Colors.black.withOpacity(0.1),
-      //       spreadRadius: 1,
-      //       blurRadius: 10,
-      //       offset: const Offset(0, 0),
-      //     ),
-      //   ],
-      //   borderRadius: BorderRadius.only(
-      //     topLeft: Radius.circular(20.r),
-      //     topRight: Radius.circular(20.r),
-      //   ),
-      // ),
-      child: ConvexAppBar(
-        height: 80.h,
-        items: [
-          TabItem(icon: Assets.images.iconTabHomeUnselect.image(width: 24.w, height: 24.w), activeIcon: Assets.images.iconTabHomeSelected.image(width: 66.w, height: 66.w)),
-          TabItem(icon: Assets.images.iconTabMoreUnselect.image(width: 24.w, height: 24.w), activeIcon: Assets.images.iconTabMoreSelected.image(width: 66.w, height: 66.w)),
-        ],
-        onTap: (int i) {
-          if (controller.currentIndex != i) {
-            controller.changeIndex(i);
-          }
-        },
-      )
-
-
-      // BottomAppBar(
-      //   color: Colors.transparent,
-      //   height: 100.h,
-      //   padding: EdgeInsets.zero,
-      //   shape: CircularNotchedRectangle(),
-      //   child: Flex(
-      //     direction: Axis.horizontal,
-      //     mainAxisAlignment: MainAxisAlignment.spaceAround,
-      //     children: [
-      //       Expanded(flex: 1, child: bottomAppBarItem(0)),
-      //       const Expanded(flex: 1, child: SizedBox()),
-      //       Expanded(flex: 1, child: bottomAppBarItem(1))
-      //     ],
-      //   ),
-      // ),
+    return StyleProvider(
+      style: BottomTabBarStyle(),
+      child: Container(
+        decoration: BoxDecoration(
+          borderRadius: BorderRadius.all(Radius.circular(12))
+        ),
+        child: ConvexAppBar(
+          height: 65.h,
+          backgroundColor: "#0F0F16".color,
+          activeColor: Colors.transparent,
+          items: [
+            TabItem(
+                icon: Assets.images.iconTabHomeUnselect.image(),
+                activeIcon: Assets.images.iconTabHomeSelected.image()),
+            TabItem(
+                icon: Assets.images.iconTabMoreUnselect.image(),
+                activeIcon: Assets.images.iconTabMoreSelected.image()),
+          ],
+          onTap: (int i) {
+            if (controller.currentIndex != i) {
+              controller.changeIndex(i);
+            }
+          },
+        ),
+      ),
     );
   }
+}
 
-  Widget bottomAppBarItem(int index) {
-    return Obx(() {
-      TabBean tabBean = controller.tabBeans[index];
-      String imagePath = controller.currentIndex == index
-          ? tabBean.selectedIcon
-          : tabBean.normalIcon;
+// tabbar样式
+class BottomTabBarStyle extends StyleHook {
+  @override
+  double get activeIconSize => 52.w;
 
-      return GestureDetector(
-        behavior: HitTestBehavior.opaque,
-        onTap: () {
-          if (controller.currentIndex != index) {
-            controller.changeIndex(index);
-          }
-        },
-        child: Container(
-          child: SizedBox(
-            height: 100.h,
-            child: Column(
-              mainAxisAlignment: MainAxisAlignment.center,
-              children: [
-                controller.currentIndex == index
-                    ? Image.asset(
-                  imagePath,
-                  width: 66.w,
-                  height: 66.w,
-                )
-                    : Image.asset(
-                  imagePath,
-                  width: 24.w,
-                  height: 24.w,
-                ),
-              ],
-            ),
-          ),
-        ),
+  @override
+  double get activeIconMargin => 12.w;
 
-      );
-    });
+  @override
+  double get iconSize => 24.w;
+
+  @override
+  TextStyle textStyle(Color color, String? fontFamily) {
+    // TODO: implement textStyle
+    return TextStyle(fontSize: 20, color: color);
   }
 }