Browse Source

fix: bottom nav bar

pull/10/head
AmirrezaChegini 1 week ago
parent
commit
3765aa25c3
  1. 11
      lib/core/widgets/bottom_nav_bar/bottom_nav_bar.dart
  2. 7
      lib/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_item.dart
  3. 11
      lib/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_profile_item.dart
  4. 2
      lib/main.dart

11
lib/core/widgets/bottom_nav_bar/bottom_nav_bar.dart

@ -1,8 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart'; import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
import 'package:get/get_state_manager/src/simple/get_view.dart'; import 'package:get/get_state_manager/src/simple/get_view.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_item.dart'; import 'package:shia_game_flutter/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_item.dart';
import 'package:shia_game_flutter/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_profile_item.dart'; import 'package:shia_game_flutter/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_profile_item.dart';
import 'package:shia_game_flutter/features/master/presentation/controller/master_controller.dart'; import 'package:shia_game_flutter/features/master/presentation/controller/master_controller.dart';
@ -13,10 +13,7 @@ class BottomNavBar extends GetView<MasterController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
clipBehavior: Clip.none,
padding: const EdgeInsets.symmetric(
horizontal: MySpaces.s30
),
padding: EdgeInsets.symmetric(horizontal: 30.w),
decoration: const BoxDecoration( decoration: const BoxDecoration(
gradient: RadialGradient( gradient: RadialGradient(
radius: 2.5, radius: 2.5,
@ -30,8 +27,8 @@ class BottomNavBar extends GetView<MasterController> {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
unselectedFontSize: 8,
selectedFontSize: 8,
unselectedFontSize: 11.sp,
selectedFontSize: 11.sp,
unselectedLabelStyle: Lexend.bold, unselectedLabelStyle: Lexend.bold,
selectedLabelStyle: Lexend.bold, selectedLabelStyle: Lexend.bold,
showSelectedLabels: false, showSelectedLabels: false,

7
lib/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_item.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; import 'package:shia_game_flutter/core/widgets/image/my_image.dart';
import 'package:shia_game_flutter/features/master/domain/entity/bottom_nav_entity.dart'; import 'package:shia_game_flutter/features/master/domain/entity/bottom_nav_entity.dart';
@ -13,12 +12,12 @@ class BottomNavBarItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
spacing: 4.h,
children: [ children: [
MyImage(asset: bottomNavEntity.icon ?? ''), MyImage(asset: bottomNavEntity.icon ?? ''),
MySpaces.s4.gapHeight,
Text( Text(
bottomNavEntity.title ?? '', bottomNavEntity.title ?? '',
style: Lexend.bold.copyWith(fontSize: MySpaces.s8),
style: Lexend.bold.copyWith(fontSize: 11.sp),
), ),
], ],
); );

11
lib/core/widgets/bottom_nav_bar/styles/bottom_nav_bar_profile_item.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; import 'package:shia_game_flutter/core/widgets/image/my_image.dart';
import 'package:shia_game_flutter/features/master/domain/entity/bottom_nav_entity.dart'; import 'package:shia_game_flutter/features/master/domain/entity/bottom_nav_entity.dart';
@ -13,10 +12,11 @@ class BottomNavBarProfileItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
spacing: 4.h,
children: [ children: [
Container( Container(
height: 26,
width: 26,
height: 26.h,
width: 26.w,
padding: const EdgeInsets.all(3), padding: const EdgeInsets.all(3),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
@ -27,10 +27,9 @@ class BottomNavBarProfileItem extends StatelessWidget {
), ),
child: MyImage(asset: bottomNavEntity.icon ?? ''), child: MyImage(asset: bottomNavEntity.icon ?? ''),
), ),
MySpaces.s4.gapHeight,
Text( Text(
bottomNavEntity.title ?? '', bottomNavEntity.title ?? '',
style: Lexend.bold.copyWith(fontSize: MySpaces.s8),
style: Lexend.bold.copyWith(fontSize: 11.sp),
), ),
], ],
); );

2
lib/main.dart

@ -31,7 +31,7 @@ class MainApp extends StatelessWidget {
fallbackLocale: const Locale('en', 'US'), fallbackLocale: const Locale('en', 'US'),
supportedLocales: const [Locale('en', 'US')], supportedLocales: const [Locale('en', 'US')],
getPages: appPages, getPages: appPages,
initialRoute: Routes.introPage,
initialRoute: Routes.masterPage,
localizationsDelegates: const [ localizationsDelegates: const [
AppLocalizations.delegate, AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,

Loading…
Cancel
Save