bottom navigation bar fix, portfolio ui update, academy ui update
This commit is contained in:
@@ -9,16 +9,18 @@ import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
Size get preferredSize => Size.fromHeight(height!);
|
||||
const AppBarWidget(
|
||||
{super.key,
|
||||
required this.titleTxt,
|
||||
this.suffixIcon,
|
||||
this.showLeading = true,
|
||||
this.customBack,
|
||||
this.backPageName = '',
|
||||
this.customActionWidget,
|
||||
this.onCustomActionPressed,
|
||||
this.height = 105});
|
||||
const AppBarWidget({
|
||||
super.key,
|
||||
required this.titleTxt,
|
||||
this.suffixIcon,
|
||||
this.showLeading = true,
|
||||
this.customBack,
|
||||
this.backPageName = '',
|
||||
this.customActionWidget,
|
||||
this.onCustomActionPressed,
|
||||
this.height = 10,
|
||||
this.centerTitle,
|
||||
});
|
||||
|
||||
final String titleTxt;
|
||||
final String? suffixIcon;
|
||||
@@ -28,6 +30,7 @@ class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
|
||||
final Widget? customActionWidget;
|
||||
final VoidCallback? onCustomActionPressed;
|
||||
final double? height;
|
||||
final bool? centerTitle;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PreferredSize(
|
||||
@@ -35,11 +38,11 @@ class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
|
||||
child: AppBar(
|
||||
scrolledUnderElevation: 0.0,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
centerTitle: centerTitle ?? true,
|
||||
title: TextWidget().text20W700(titleTxt, clr: AppColor.charcoalColor),
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 16.w,
|
||||
left: !showLeading! ? 0 : 16.w,
|
||||
),
|
||||
child: !showLeading!
|
||||
? null
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
|
||||
import 'bottom_navigation_event.dart';
|
||||
import 'bottom_navigation_state.dart';
|
||||
|
||||
// Bloc
|
||||
class BottomNavigationBloc
|
||||
extends Bloc<BottomNavigationEvent, BottomNavigationState> {
|
||||
BottomNavigationBloc() : super(TabState(0)) {
|
||||
// Register the event handler
|
||||
on<TabChanged>((event, emit) {
|
||||
emit(TabState(event.index));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
abstract class BottomNavigationEvent {}
|
||||
|
||||
class TabChanged extends BottomNavigationEvent {
|
||||
final int index;
|
||||
|
||||
TabChanged(this.index);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
abstract class BottomNavigationState {}
|
||||
|
||||
class TabState extends BottomNavigationState {
|
||||
final int selectedIndex;
|
||||
|
||||
TabState(this.selectedIndex);
|
||||
}
|
||||
@@ -1,28 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:tanami_app/features/MainScreens/MainScreen.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:tanami_app/core/styles/app_color.dart';
|
||||
|
||||
Widget bottomnavigationbar(selectedIndex) {
|
||||
import 'bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
||||
import 'bloc/bottom_nav_bar/bottom_navigation_event.dart';
|
||||
|
||||
Widget bottomnavigationbar(BuildContext context, selectedIndex) {
|
||||
return BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
showUnselectedLabels: true,
|
||||
selectedItemColor: Color(0xFF0B8933),
|
||||
unselectedItemColor: const Color(0xFF676767),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
selectedItemColor: AppColor.selectedItemColor,
|
||||
unselectedItemColor: AppColor.unselectedItemColor,
|
||||
unselectedLabelStyle: GoogleFonts.dmSans(
|
||||
fontSize: 10.sp,
|
||||
color: const Color(0xFF676767),
|
||||
color: AppColor.unselectedItemColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'hiragino',
|
||||
),
|
||||
selectedLabelStyle: TextStyle(
|
||||
selectedLabelStyle: GoogleFonts.dmSans(
|
||||
fontSize: 10.sp,
|
||||
color: const Color(0xFF0B8933),
|
||||
color: AppColor.selectedItemColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'hiragino',
|
||||
),
|
||||
currentIndex: selectedIndex,
|
||||
onTap: (index) {
|
||||
updateTab(index);
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(index));
|
||||
},
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
@@ -62,8 +65,6 @@ Widget bottomnavigationbar(selectedIndex) {
|
||||
height: 28.h,
|
||||
width: 28.w,
|
||||
),
|
||||
|
||||
// SvgPicture.asset('assets/image/svg/active_shortTrade.svg'),
|
||||
label: 'Invest',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
|
||||
@@ -12,6 +12,14 @@ class TextWidget {
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget text11W500(String text, {Color? clr}) {
|
||||
return Text(text,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
//Text Size 12
|
||||
Widget text12W400(String text, {Color? clr}) {
|
||||
return Text(text,
|
||||
@@ -36,16 +44,29 @@ class TextWidget {
|
||||
fontWeight: FontWeight.w700,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
//Text Size 14
|
||||
|
||||
//Text Size 13
|
||||
Widget text13W500(String text, {Color? clr}) {
|
||||
return Text(text,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
//Text Size 14
|
||||
Widget text14W400(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
TextAlign? txtAlign,
|
||||
int? maxLine,
|
||||
TextOverflow? txtOverflow,
|
||||
}) {
|
||||
return Text(text,
|
||||
textAlign: txtAlign ?? TextAlign.center,
|
||||
maxLines: maxLine ?? 20,
|
||||
overflow: txtOverflow ?? TextOverflow.ellipsis,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
@@ -80,20 +101,6 @@ class TextWidget {
|
||||
}
|
||||
|
||||
//Text Size 15
|
||||
Widget text15W500(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
}) {
|
||||
return Text(text,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 15,
|
||||
decorationColor: AppColor.hintTextColor,
|
||||
decoration: textDecoration ?? TextDecoration.none,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget text15W400(
|
||||
String text, {
|
||||
@@ -111,7 +118,53 @@ class TextWidget {
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget text15W500(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
}) {
|
||||
return Text(text,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 15,
|
||||
decorationColor: AppColor.hintTextColor,
|
||||
decoration: textDecoration ?? TextDecoration.none,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget text15W700(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
}) {
|
||||
return Text(text,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 15,
|
||||
decorationColor: AppColor.hintTextColor,
|
||||
decoration: textDecoration ?? TextDecoration.none,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
//Text Size 17
|
||||
|
||||
Widget text17W600(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
}) {
|
||||
return Text(text,
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 17,
|
||||
decorationColor: AppColor.hintTextColor,
|
||||
decoration: textDecoration ?? TextDecoration.none,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget text17W700(
|
||||
String text, {
|
||||
Color? clr,
|
||||
|
||||
Reference in New Issue
Block a user