home screen new ui

This commit is contained in:
jayesh
2024-05-14 18:47:05 +05:30
parent 0df7b147a4
commit d0f027204f
11 changed files with 619 additions and 463 deletions

View File

@@ -1,8 +1,10 @@
// import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:traderscircuit/Utils/Common/CommonBottomNavigation.dart';
@@ -22,6 +24,7 @@ import 'package:traderscircuit/view/Sidemenu/Sidemenu.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
import 'package:traderscircuit/view_model/HomeApi/home_api.dart';
import '../../Utils/Common/CustomTextFormField.dart';
import '../../view_model/ProfileAPI/GetProfileApi.dart';
class HomeScreen extends StatefulWidget {
@@ -105,12 +108,27 @@ class _HomeScreenState extends State<HomeScreen> {
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: isApiCalling.value
? Center(
child: CircularProgressIndicator( color: Color(0xFF0093FF),),
? const Center(
child: CircularProgressIndicator(
color: Color(0xFF0093FF),
),
)
: ListView(
physics: const BouncingScrollPhysics(),
children: [
sizedBoxHeight(15.h),
CustomTextFormField1(
hintText: 'Search',
leadingIcon: SizedBox(
height: 20,
width: 20,
child: Center(
child: SvgPicture.asset(
'assets/images/svg/search-svgrepo-com.svg',
),
),
),
),
sizedBoxHeight(20.h),
Text(
"Welcome $userName",
@@ -149,25 +167,19 @@ class _HomeScreenState extends State<HomeScreen> {
text22W500('View our products'),
sizedBoxHeight(30.h),
SizedBox(
height: 210,
child: GridView.builder(
height: 280,
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount:
2, // number of items in each row
mainAxisSpacing: 8.0, // spacing between rows
crossAxisSpacing:
8.0, // spacing between columns
childAspectRatio: 2.2,
),
itemCount: homeModel.data!.products!.length,
itemBuilder: (context, index) {
return ProductWidget(
return Container(
margin: const EdgeInsets.only(bottom: 12),
child: ProductWidget(
text: homeModel.data!.products!
.elementAt(index)
.title!,
subtext: "recommendation");
),
);
},
),
),
@@ -188,54 +200,107 @@ class _HomeScreenState extends State<HomeScreen> {
color: const Color(0xFF3A3A3A),
),
sizedBoxHeight(25.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
text22W600('Explore The Unseen'),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.exploreUnseen);
},
child: Container(
height: 35.h,
width: 105.w,
decoration: BoxDecoration(
color: const Color(0xFF0093FF),
// .withOpacity(0.6),
borderRadius:
BorderRadius.circular(5.r),
border: Border.all(
color: const Color(0xFF3A3A3A),
)),
child:
Center(child: text16W500('View More')),
text25W800('Explore The Unseen'),
sizedBoxHeight(10.h),
Container(
padding: const EdgeInsets.all(8),
width: 398,
height: 55,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: const Alignment(1.00, 0.02),
end: const Alignment(-1, -0.02),
colors: [
Colors.white
.withOpacity(0.09000000357627869),
Colors.white
.withOpacity(0.0925697460770607),
Colors.white
.withOpacity(0.10999999940395355)
],
),
shape: RoundedRectangleBorder(
side: const BorderSide(
width: 1, color: Color(0x994A73FB)),
borderRadius: BorderRadius.circular(8),
),
),
child: Container(
width: 382,
height: 40,
decoration: ShapeDecoration(
color: const Color(0xFF00C236),
shape: RoundedRectangleBorder(
side: const BorderSide(width: 0.80),
borderRadius: BorderRadius.circular(5),
),
),
],
),
sizedBoxHeight(35.h),
DefaultTabController(
length: 2,
child: Column(
children: [
MyTabBar(),
SizedBox(
height: 250.h,
child: TabBarView(
children: [
ActiveCallsTab(),
ExitedCallsTab(),
],
),
),
],
child: Center(
child: text18W500("Long Term"),
),
),
),
sizedBoxHeight(25.h),
// DefaultTabController(
// length: 2,
// child: Column(
// children: [
// MyTabBar(),
// SizedBox(
// height: 250.h,
// child: TabBarView(
// children: [
// ActiveCallsTab(),
// ExitedCallsTab(),
// ],
// ),
// ),
// ],
// ),
// ),
cardcallWidget(
action: homeModel
.data!
.exploreTheUnseenActiveCalls!
.first
.recommendationActionsXid ==
1
? "Buy"
: homeModel
.data!
.exploreTheUnseenActiveCalls!
.first
.recommendationActionsXid ==
2
? "Sell"
: homeModel
.data!
.exploreTheUnseenActiveCalls!
.first
.recommendationActionsXid ==
3
? "Hold"
: homeModel
.data!
.exploreTheUnseenActiveCalls!
.first
.recommendationActionsXid ==
4
? "Exit"
: "",
text: homeModel
.data!
.exploreTheUnseenActiveCalls!
.first
.stockName!,
amount:
"${homeModel.data!.exploreTheUnseenActiveCalls!.first.buyPrice!}",
pdfname: 'Download Pdf'),
sizedBoxHeight(25.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text22W600('Content Bytes'),
text20W600('Content Bytes'),
sizedBoxHeight(8.w),
Row(
mainAxisAlignment: MainAxisAlignment.end,
@@ -472,147 +537,138 @@ Widget cardcallWidget(
required String amount,
required String pdfname,
required String action}) {
return commonGlassContainer(
width: double.infinity,
height: 176.h,
borderradius: 8,
customWidget: Column(
return Container(
width: 398,
height: 251,
decoration: ShapeDecoration(
color: const Color(0x232C79ED),
shape: RoundedRectangleBorder(
side: const BorderSide(width: 1, color: Color(0x994A73FB)),
borderRadius: BorderRadius.circular(8),
),
),
child: Stack(
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
GlassmorphicContainer(
width: 47.w,
height: 47.h,
borderRadius: 100,
blur: 10,
alignment: Alignment.center,
border: 0.9,
linearGradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xff3A3A3A),
Color(0xFF3A3A3A),
],
),
borderGradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color.fromRGBO(70, 5, 1, 0.8),
Color.fromRGBO(102, 102, 102, 0.8),
],
),
child: Center(
child:
Image.asset('assets/images/png/square_TRIDENT_com 1.png'),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
text16W700(text),
Container(
width: 75.w,
height: 30.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.r),
color: action == "Buy"
? Colors.green
: action == "Sell"
? Colors.red
: action == "Hold"
? const Color(0xFFFFAD31)
: Colors.white,
),
child: Center(child: text14W500(action, clr: Colors.black)),
)
],
),
sizedBoxWidth(15.w),
text18W600(text),
const Spacer(),
Container(
width: 62.w,
height: 25.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
color: action == "Buy"
? Colors.green
: action == "Sell"
? Colors.red
: action == "Hold"
? const Color(0xFFFFAD31)
: Colors.white,
),
child: Center(child: text16W400_1B1B1B(action)),
)
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: const Color(0xFF3A3A3A),
),
Padding(
padding: const EdgeInsets.all(20),
child: Row(
children: [
Column(
),
Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
text14W400_979797('Initial Entry Price'),
sizedBoxHeight(5.h),
text15W600(amount)
text15W600(amount),
sizedBoxHeight(30.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 150,
height: 52,
decoration: ShapeDecoration(
color: const Color(0x332C79ED),
shape: RoundedRectangleBorder(
side: const BorderSide(
width: 1, color: Color(0x994A73FB)),
borderRadius: BorderRadius.circular(8),
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SvgPicture.asset('assets/images/svg/pdfsvg.svg'),
Image.asset(
'assets/images/png/pdf.png',
height: 20.h,
width: 20.w,
),
const Gap(5),
text15W600(pdfname),
],
),
),
Container(
height: 52,
width: 150,
decoration: ShapeDecoration(
color: const Color(0xFF0093FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
),
child: Center(child: text15W600("View More")),
)
],
),
],
),
// sizedBoxWidth(50.w),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14W400_979797('Report'),
sizedBoxHeight(5.h),
Row(
children: [
// SvgPicture.asset('assets/images/svg/pdfsvg.svg'),
Image.asset(
'assets/images/png/pdf.png',
height: 20.h,
width: 20.w,
),
text15W600(pdfname),
],
)
],
)
],
),
)
)
],
),
Positioned(
right: 0,
child: SvgPicture.asset("assets/images/svg/card_decoration.svg"))
],
),
);
}
Widget ProductWidget({required String text, required String subtext}) {
return GlassmorphicContainer(
width: 175.w,
height: 83.h,
borderRadius: 8,
blur: 10,
alignment: Alignment.center,
border: 0.8,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF2D7AEE).withOpacity(0.14),
const Color(0xFF2D7AEE).withOpacity(0.14),
],
stops: [
0.1,
1,
]),
borderGradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xff0F2C53),
Color(0xFF0F2C53),
],
),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),
child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
text18W600(text),
sizedBoxWidth(8.w),
text14W400_979797(subtext),
],
Widget ProductWidget({
required String text,
}) {
return Container(
padding: const EdgeInsets.only(left: 20),
width: 398,
height: 83,
decoration: ShapeDecoration(
gradient: const LinearGradient(
begin: Alignment(0.99, -0.14),
end: Alignment(-0.99, 0.14),
colors: [Color(0xFF1538C5), Color(0xFF0B2074), Color(0xFF000D41)],
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
text18W600(text),
// Image.asset(
// "assets/images/png/swingImage.png",
// height: 83,
// )
SvgPicture.asset(text == "Swing Trade"
? "assets/images/svg/swing_image.svg"
: text == "Options"
? "assets/images/svg/options_image.svg"
: "assets/images/svg/multibagger_image.svg")
],
),
);
}
@@ -622,31 +678,14 @@ Widget commoncontainer(
required String amount,
required String rate,
required double width}) {
return GlassmorphicContainer(
width: width,
height: 83.h,
borderRadius: 8,
blur: 10,
alignment: Alignment.center,
border: 0.8,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF2D7AEE).withOpacity(0.14),
const Color(0xFF2D7AEE).withOpacity(0.14),
],
stops: [
0.1,
1,
]),
borderGradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xff0F2C53),
Color(0xFF0F2C53),
],
return Container(
height: 83,
decoration: ShapeDecoration(
color: const Color(0xFF0F2C53),
shape: RoundedRectangleBorder(
side: const BorderSide(width: 1, color: Color(0x7F4A73FB)),
borderRadius: BorderRadius.circular(8),
),
),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),