Merge branch 'main' into product

This commit is contained in:
Raj
2024-05-08 18:49:42 +05:30
committed by GitHub
15 changed files with 438 additions and 133 deletions

View File

@@ -47,8 +47,8 @@ android {
applicationId "com.example.traderscircuit" applicationId "com.example.traderscircuit"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion targetSdkVersion 33
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }

View File

@@ -1,10 +1,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.traderscircuit"> package="com.example.traderscircuit">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission <uses-permission
android:name="android.permission.USE_BIOMETRIC"/> android:name="android.permission.USE_BIOMETRIC"/>
<application <application
android:label="Traders Circuit" android:label="Traders Circuit"
android:requestLegacyExternalStorage="true"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity

View File

@@ -131,12 +131,12 @@ Widget text12W500_B4B4B4(String text) {
); );
} }
Widget text14W600_1B1B1B(String text) { Widget text14W600_1B1B1B(String text, {Color? clr}) {
return Text( return Text(
text, text,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0Xff1B1B1B), color: clr ?? const Color(0Xff1B1B1B),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'hiragino'), fontFamily: 'hiragino'),
); );

View File

@@ -1,8 +1,13 @@
import 'dart:developer';
import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart' as getx; import 'package:get/get.dart' as getx;
import 'package:permission_handler/permission_handler.dart';
class Utils { class Utils {
static Future<MultipartFile> networkImageToMultipartFile( static Future<MultipartFile> networkImageToMultipartFile(
@@ -61,4 +66,112 @@ class Utils {
barrierDismissible: false, barrierDismissible: false,
); );
} }
static Future<void> getStoragePermission() async {
DeviceInfoPlugin plugin = DeviceInfoPlugin();
AndroidDeviceInfo android = await plugin.androidInfo;
if (android.version.sdkInt < 33) {
if (await Permission.storage.request().isGranted) {
// setState(() {
// permissionGranted = true;
// });
} else if (await Permission.storage.request().isPermanentlyDenied) {
await openAppSettings();
await showToast("Permission denied.");
}
// else if (await Permission.audio.request().isDenied) {
// // setState(() {
// // permissionGranted = false;
// // });
// }
} else {
if (await Permission.photos.request().isGranted) {
// await utils.showToast("Permission granted.");
// setState(() {
// permissionGranted = true;
// });
} else if (await Permission.photos.request().isPermanentlyDenied) {
await openAppSettings();
await showToast("Permission denied.");
} else if (await Permission.photos.request().isDenied) {
await openAppSettings();
await showToast("Permission denied.");
// setState(() {
// permissionGranted = false;
// });
}
}
}
static Future openFile({
required String url,
String? fileName,
}) async {
var status;
// Permission.manageExternalStorage.request();
final deviceInfo = await DeviceInfoPlugin().androidInfo;
if (deviceInfo.version.sdkInt > 32) {
status = await Permission.photos.request().isGranted;
await Permission.manageExternalStorage.request();
} else {
status = await Permission.storage.request().isGranted;
await Permission.manageExternalStorage.request();
}
if (status) {
await downloadFile(url, fileName!);
// if (file == null) {
// log("Error 3333333333333");
// } else {
// await OpenFile.open(file.path).then((value) {
// print("RUNNING THIS");
// if (value.type == ResultType.noAppToOpen) {
// ScaffoldMessenger.of(context).showSnackBar(Helper.displaySnackBar(
// "type",
// "error",
// "You do not have any application to open this file"));
// //Navigator.pop(context);
// } else {
// log(value.message);
// }
// });
// // if (message.toString() != "done") {
// // displaySnackBar("login", "error", message.message.toString());
// // }
// }
} else {
openAppSettings();
}
}
static Future<File?> downloadFile(String url, String name) async {
final appStorage = Directory("/storage/emulated/0/Download");
final file = File('${appStorage.path}/$name');
try {
showToast("Downloading...");
final response = await Dio().get(
url,
options: Options(
// headers: requestHeaders,
responseType: ResponseType.bytes,
followRedirects: false,
// receiveTimeout: 0,
),
);
final raf = file.openSync(mode: FileMode.write);
raf.writeFromSync(response.data);
await raf.close();
showToast("Download Completed !");
return file;
} catch (e) {
log(e.toString());
showToast("Download Error! Please try again");
return null;
}
}
} }

View File

@@ -40,13 +40,14 @@ class ContentBytesController extends GetxController {
super.dispose(); super.dispose();
} }
void init(index) async { void init(index, type) async {
audioPlayer = AudioPlayer(); audioPlayer = AudioPlayer();
isAudioInitialize = true; isAudioInitialize = true;
indexForAudios.value = index; indexForAudios.value = index;
try { try {
log(index.toString()); await audioPlayer.setUrl(type == "new"
await audioPlayer.setUrl(contentBytesModel.data!.audio![index].link!); ? contentBytesModel.data!.newReleaseAudio![index].link!
: contentBytesModel.data!.audio![index].link!);
// await audioPlayer.setAsset(url); // await audioPlayer.setAsset(url);
} on PlayerException catch (e) { } on PlayerException catch (e) {
print("Error code: ${e.code}"); print("Error code: ${e.code}");
@@ -75,7 +76,7 @@ class ContentBytesController extends GetxController {
} else if (processingState != ProcessingState.completed) { } else if (processingState != ProcessingState.completed) {
buttonNotifier.value = ButtonState.playing; buttonNotifier.value = ButtonState.playing;
} else { } else {
_playNextTrack(); // _playNextTrack(type);
// audioPlayer.seek(Duration.zero); // audioPlayer.seek(Duration.zero);
// audioPlayer.pause(); // audioPlayer.pause();
@@ -110,7 +111,7 @@ class ContentBytesController extends GetxController {
}); });
} }
void _playNextTrack() { void _playNextTrack(type) {
// Determine the index of the next track (you need to implement this logic) // Determine the index of the next track (you need to implement this logic)
int nextIndex = getNextTrackIndex(); int nextIndex = getNextTrackIndex();
@@ -120,7 +121,7 @@ class ContentBytesController extends GetxController {
if (isPlaying()) { if (isPlaying()) {
stop(); stop();
} }
init(nextIndex); init(nextIndex, type);
play(nextIndex); play(nextIndex);
} else { } else {
audioPlayer.seek(Duration.zero); audioPlayer.seek(Duration.zero);
@@ -184,41 +185,4 @@ class ContentBytesController extends GetxController {
titlePlayingList![index] = true; titlePlayingList![index] = true;
} }
} }
// RxList<Video> searchResults = <Video>[].obs;
// Future<void> getContentBytesDataVideo(String query) async {
// // Set isLoading to true if needed
// isLoading.value = true;
// try {
// // Make API call to fetch search results based on the query
// final response = await ContentBytesApi().getContentBytesData({
// // Pass query parameters if needed
// 'search_data': query,
// 'content_type': "video",
// 'category_id': "",
// });
// // Check if the API call was successful
// if (response.status == ResponseStatus.SUCCESS) {
// // Parse the response data into a list of videos
// final List<dynamic> responseData = response.data['data']['video'];
// searchResults.value =
// responseData.map((data) => Video.fromJson(data)).toList();
// // Notify listeners about the changes to the searchResults list
// update();
// } else {
// // Handle API call failure
// // You may show an error message or handle it as needed
// }
// } catch (e) {
// // Handle exceptions
// // You may show an error message or handle it as needed
// } finally {
// // Set isLoading to false after the API call completes
// isLoading.value = false;
// }
// }
} }

View File

@@ -1,4 +1,6 @@
import 'package:device_info_plus/device_info_plus.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.dart'; import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@@ -14,4 +16,15 @@ class ProductsController extends GetxController {
DateTime newDateTime = DateTime(dateTime.year, 3, 25); DateTime newDateTime = DateTime(dateTime.year, 3, 25);
return DateFormat("dd MMMM yyyy").format(newDateTime); return DateFormat("dd MMMM yyyy").format(newDateTime);
} }
static Future<bool> requestP() async {
bool permissionStatus;
final deviceInfo = await DeviceInfoPlugin().androidInfo;
if (deviceInfo.version.sdkInt > 32) {
permissionStatus = await Permission.photos.request().isGranted;
} else {
permissionStatus = await Permission.storage.request().isGranted;
}
return permissionStatus;
}
} }

View File

@@ -8,6 +8,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:traderscircuit/Utils/utils.dart';
import 'package:traderscircuit/firebase_options.dart'; import 'package:traderscircuit/firebase_options.dart';
import 'package:scgateway_flutter_plugin/scgateway_flutter_plugin.dart'; import 'package:scgateway_flutter_plugin/scgateway_flutter_plugin.dart';
import 'package:traderscircuit/resources/routes/route_name.dart'; import 'package:traderscircuit/resources/routes/route_name.dart';
@@ -45,8 +46,7 @@ Future<void> main() async {
); );
SystemChrome.setPreferredOrientations([ SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp, DeviceOrientation.portraitUp,
]).then((value) => runApp(MultiBlocProvider( ]).then((value) => runApp(MultiBlocProvider(providers: [
providers: [
BlocProvider<CounterBloc>( BlocProvider<CounterBloc>(
create: (context) => CounterBloc(), create: (context) => CounterBloc(),
), ),
@@ -54,7 +54,7 @@ Future<void> main() async {
create: (context) => SendOtpBloc(), create: (context) => SendOtpBloc(),
), ),
// Add more BlocProviders for other Blocs here if needed // Add more BlocProviders for other Blocs here if needed
],child: const MyApp()))); ], child: const MyApp())));
} }
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {
@@ -72,6 +72,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Utils.getStoragePermission();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
connectivity = Connectivity(); connectivity = Connectivity();

View File

@@ -182,6 +182,7 @@ class NewReleaseAudio {
String? title; String? title;
String? file; String? file;
int? categoryId; int? categoryId;
String? link;
String? image; String? image;
String? isActive; String? isActive;
String? createdAt; String? createdAt;
@@ -195,6 +196,7 @@ class NewReleaseAudio {
this.categoryId, this.categoryId,
this.image, this.image,
this.isActive, this.isActive,
this.link,
this.createdAt, this.createdAt,
this.formattedCreatedAt, this.formattedCreatedAt,
this.fullCreatedAt}); this.fullCreatedAt});
@@ -205,6 +207,7 @@ class NewReleaseAudio {
file = json['file']; file = json['file'];
categoryId = json['category_id']; categoryId = json['category_id'];
image = json['image']; image = json['image'];
link = json['link'];
isActive = json['is_active']; isActive = json['is_active'];
createdAt = json['created_at']; createdAt = json['created_at'];
formattedCreatedAt = json['formatted_created_at']; formattedCreatedAt = json['formatted_created_at'];
@@ -218,6 +221,7 @@ class NewReleaseAudio {
data['file'] = file; data['file'] = file;
data['category_id'] = categoryId; data['category_id'] = categoryId;
data['image'] = image; data['image'] = image;
data['link'] = link;
data['is_active'] = isActive; data['is_active'] = isActive;
data['created_at'] = createdAt; data['created_at'] = createdAt;
data['formatted_created_at'] = formattedCreatedAt; data['formatted_created_at'] = formattedCreatedAt;

View File

@@ -75,6 +75,7 @@ class ContentByteData {
int? categoryId; int? categoryId;
String? image; String? image;
String? isActive; String? isActive;
String? description;
String? createdAt; String? createdAt;
ContentByteData( ContentByteData(
@@ -82,6 +83,7 @@ class ContentByteData {
this.title, this.title,
this.file, this.file,
this.categoryId, this.categoryId,
this.description,
this.image, this.image,
this.isActive, this.isActive,
this.createdAt}); this.createdAt});
@@ -89,6 +91,7 @@ class ContentByteData {
ContentByteData.fromJson(Map<String, dynamic> json) { ContentByteData.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
title = json['title']; title = json['title'];
description = json["description"];
file = json['file']; file = json['file'];
categoryId = json['category_id']; categoryId = json['category_id'];
image = json['image']; image = json['image'];
@@ -105,6 +108,7 @@ class ContentByteData {
data['image'] = image; data['image'] = image;
data['is_active'] = isActive; data['is_active'] = isActive;
data['created_at'] = createdAt; data['created_at'] = createdAt;
data['description'] = description;
return data; return data;
} }
} }

View File

@@ -77,6 +77,7 @@ class ActiveCalls {
String? createdAt; String? createdAt;
int? optionTypeXid; int? optionTypeXid;
ProductTypeData? productTypeData; ProductTypeData? productTypeData;
String? docs;
ActionData? optionTypeData; ActionData? optionTypeData;
ActionData? actionData; ActionData? actionData;
@@ -90,6 +91,7 @@ class ActiveCalls {
this.qty, this.qty,
this.duration, this.duration,
this.currentPrice, this.currentPrice,
this.docs,
this.buyPrice, this.buyPrice,
this.targetPrice, this.targetPrice,
this.stopLoss, this.stopLoss,
@@ -111,6 +113,7 @@ class ActiveCalls {
qty = json['qty']; qty = json['qty'];
duration = json['duration']; duration = json['duration'];
currentPrice = json['current_price']; currentPrice = json['current_price'];
docs = json['docs'];
buyPrice = json['buy_price']; buyPrice = json['buy_price'];
targetPrice = json['target_price']; targetPrice = json['target_price'];
stopLoss = json['stop_loss']; stopLoss = json['stop_loss'];
@@ -142,6 +145,7 @@ class ActiveCalls {
data['current_price'] = currentPrice; data['current_price'] = currentPrice;
data['buy_price'] = buyPrice; data['buy_price'] = buyPrice;
data['target_price'] = targetPrice; data['target_price'] = targetPrice;
data['docs'] = docs;
data['stop_loss'] = stopLoss; data['stop_loss'] = stopLoss;
data['is_send_recommendation_now'] = isSendRecommendationNow; data['is_send_recommendation_now'] = isSendRecommendationNow;
data['schedule_date_time'] = scheduleDateTime; data['schedule_date_time'] = scheduleDateTime;

View File

@@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart'; import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -11,6 +12,7 @@ import 'package:traderscircuit/Utils/Common/commonBotton.dart';
import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart'; import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart';
import 'package:traderscircuit/Utils/Common/sized_box.dart'; import 'package:traderscircuit/Utils/Common/sized_box.dart';
import 'package:traderscircuit/Utils/text.dart'; import 'package:traderscircuit/Utils/text.dart';
import 'package:traderscircuit/Utils/utils.dart';
import 'package:traderscircuit/controller/contact_us_controller.dart'; import 'package:traderscircuit/controller/contact_us_controller.dart';
import 'package:traderscircuit/controller/products_controller.dart'; import 'package:traderscircuit/controller/products_controller.dart';
import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.dart'; import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.dart';
@@ -27,7 +29,7 @@ class ShortTrade extends StatefulWidget {
} }
class _ShortTradeState extends State<ShortTrade> { class _ShortTradeState extends State<ShortTrade> {
GlobalKey<ScaffoldState> _scaffoldKey1 = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey1 = GlobalKey<ScaffoldState>();
List<String> containerTexts = ["Swing Trade", "Multibagger", "Options"]; List<String> containerTexts = ["Swing Trade", "Multibagger", "Options"];
ProductsController productsController = Get.put(ProductsController()); ProductsController productsController = Get.put(ProductsController());
@@ -256,6 +258,7 @@ class _ShortTradeState extends State<ShortTrade> {
padding: EdgeInsets.only(top: 20.h, bottom: 5.h), padding: EdgeInsets.only(top: 20.h, bottom: 5.h),
child: productsController.selectedIndex.value == 0 child: productsController.selectedIndex.value == 0
? cardSwingWidget( ? cardSwingWidget(
pdfLink: "",
image: callRecommendationsModel image: callRecommendationsModel
.data!.activeCalls![index].stockImage!, .data!.activeCalls![index].stockImage!,
text: callRecommendationsModel text: callRecommendationsModel
@@ -289,8 +292,10 @@ class _ShortTradeState extends State<ShortTrade> {
duration: callRecommendationsModel duration: callRecommendationsModel
.data!.activeCalls![index].duration!, .data!.activeCalls![index].duration!,
pdfname: "Download Pdf", pdfname: "Download Pdf",
pdfLink: "",
) )
: cardOptionWidget( : cardOptionWidget(
pdfLink: "",
image: callRecommendationsModel image: callRecommendationsModel
.data!.activeCalls![index].stockImage!, .data!.activeCalls![index].stockImage!,
action: callRecommendationsModel action: callRecommendationsModel
@@ -366,6 +371,8 @@ class _ShortTradeState extends State<ShortTrade> {
padding: EdgeInsets.only(top: 20.h, bottom: 5.h), padding: EdgeInsets.only(top: 20.h, bottom: 5.h),
child: productsController.selectedIndex.value == 0 child: productsController.selectedIndex.value == 0
? cardSwingWidget( ? cardSwingWidget(
pdfLink: callRecommendationsModel
.data!.exitedCalls![index].docs!,
image: callRecommendationsModel image: callRecommendationsModel
.data!.exitedCalls![index].stockImage!, .data!.exitedCalls![index].stockImage!,
text: callRecommendationsModel text: callRecommendationsModel
@@ -399,8 +406,12 @@ class _ShortTradeState extends State<ShortTrade> {
duration: callRecommendationsModel duration: callRecommendationsModel
.data!.exitedCalls![index].duration!, .data!.exitedCalls![index].duration!,
pdfname: "Download Pdf", pdfname: "Download Pdf",
pdfLink: callRecommendationsModel
.data!.exitedCalls![index].docs!,
) )
: cardOptionWidget( : cardOptionWidget(
pdfLink: callRecommendationsModel
.data!.exitedCalls![index].docs!,
image: callRecommendationsModel image: callRecommendationsModel
.data!.exitedCalls![index].stockImage!, .data!.exitedCalls![index].stockImage!,
action: callRecommendationsModel action: callRecommendationsModel
@@ -433,12 +444,13 @@ class _ShortTradeState extends State<ShortTrade> {
required String price1, required String price1,
required String stoploss, required String stoploss,
required String action, required String action,
required String pdfLink,
required String image, required String image,
}) { }) {
ContactUsController contactUsController = Get.put(ContactUsController()); ContactUsController contactUsController = Get.put(ContactUsController());
return commonGlassContainer( return commonGlassContainer(
width: double.infinity, width: double.infinity,
height: 400.h, height: action != "Exit" ? 330.h : 380.h,
borderradius: 8, borderradius: 8,
customWidget: Column( customWidget: Column(
children: [ children: [
@@ -487,9 +499,15 @@ class _ShortTradeState extends State<ShortTrade> {
borderRadius: BorderRadius.circular(4.r), borderRadius: BorderRadius.circular(4.r),
color: action == "Buy" color: action == "Buy"
? const Color(0xFF00FF19) ? const Color(0xFF00FF19)
: const Color(0xFFFFAD31), : action == "Exit"
? const Color(0Xff6C0000)
: const Color(0xFFFFAD31),
), ),
child: Center(child: text14W600_1B1B1B(action)), child: Center(
child: text14W600_1B1B1B(action,
clr: action == "Exit"
? Colors.white
: const Color(0Xff1B1B1B))),
) )
], ],
), ),
@@ -536,8 +554,8 @@ class _ShortTradeState extends State<ShortTrade> {
sizedBoxHeight(5.h), sizedBoxHeight(5.h),
SizedBox( SizedBox(
width: 150.w, width: 150.w,
child: text15W600(contactUsController child: text15W600(
.formatedDateTimeMethod(date))) productsController.dateConverterMethod(date)))
], ],
), ),
sizedBoxWidth(30.w), sizedBoxWidth(30.w),
@@ -573,6 +591,32 @@ class _ShortTradeState extends State<ShortTrade> {
) )
], ],
), ),
sizedBoxHeight(15.h),
action != "Exit"
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14W400_979797('Report'),
sizedBoxHeight(5.h),
GestureDetector(
onTap: () {
Utils.openFile(
url: pdfLink, fileName: "${text}_report.pdf");
},
child: Row(
children: [
Image.asset(
'assets/images/png/pdf.png',
height: 20.h,
width: 20.w,
),
text15W600("Download Pdf"),
],
),
)
],
)
], ],
), ),
) )
@@ -590,6 +634,7 @@ class _ShortTradeState extends State<ShortTrade> {
required String duration, required String duration,
required String pdfname, required String pdfname,
required String action, required String action,
required String pdfLink,
required String image, required String image,
}) { }) {
return commonGlassContainer( return commonGlassContainer(
@@ -643,9 +688,15 @@ class _ShortTradeState extends State<ShortTrade> {
borderRadius: BorderRadius.circular(4.r), borderRadius: BorderRadius.circular(4.r),
color: action == "Buy" color: action == "Buy"
? const Color(0xFF00FF19) ? const Color(0xFF00FF19)
: const Color(0xFFFFAD31), : action == "Exit"
? const Color(0Xff6C0000)
: const Color(0xFFFFAD31),
), ),
child: Center(child: text14W600_1B1B1B(action)), child: Center(
child: text14W600_1B1B1B(action,
clr: action == "Exit"
? Colors.white
: const Color(0Xff1B1B1B))),
) )
], ],
), ),
@@ -717,23 +768,32 @@ class _ShortTradeState extends State<ShortTrade> {
], ],
), ),
sizedBoxWidth(30.w), sizedBoxWidth(30.w),
// Column( action != "Exit"
// crossAxisAlignment: CrossAxisAlignment.start, ? const SizedBox()
// children: [ : Column(
// text14W400_979797('Report'), crossAxisAlignment: CrossAxisAlignment.start,
// sizedBoxHeight(5.h), children: [
// Row( text14W400_979797('Report'),
// children: [ sizedBoxHeight(5.h),
// Image.asset( GestureDetector(
// 'assets/images/png/pdf.png', onTap: () {
// height: 20.h, Utils.openFile(
// width: 20.w, url: pdfLink,
// ), fileName: "${text}_report.pdf");
// text15W600(pdfname), },
// ], child: Row(
// ) children: [
// ], Image.asset(
// ) 'assets/images/png/pdf.png',
height: 20.h,
width: 20.w,
),
text15W600(pdfname),
],
),
)
],
)
], ],
), ),
], ],
@@ -751,11 +811,12 @@ class _ShortTradeState extends State<ShortTrade> {
required String targetamount, required String targetamount,
required String stoploss, required String stoploss,
required String time, required String time,
required String pdfLink,
required String action, required String action,
}) { }) {
return commonGlassContainer( return commonGlassContainer(
width: double.infinity, width: double.infinity,
height: 260.h, height: action != "Exit" ? 250.h : 300.h,
borderradius: 8, borderradius: 8,
customWidget: Column( customWidget: Column(
children: [ children: [
@@ -800,9 +861,17 @@ class _ShortTradeState extends State<ShortTrade> {
borderRadius: BorderRadius.circular(4.r), borderRadius: BorderRadius.circular(4.r),
color: action == "Buy" color: action == "Buy"
? const Color(0xFF00FF19) ? const Color(0xFF00FF19)
: const Color(0xFFFFAD31), : action == "Exit"
? const Color(0Xff6C0000)
: const Color(0xFFFFAD31),
), ),
child: Center(child: text14W600_1B1B1B(action)), child: Center(
child: text14W600_1B1B1B(
action,
clr: action == "Exit"
? Colors.white
: const Color(0Xff1B1B1B),
)),
) )
], ],
), ),
@@ -859,6 +928,32 @@ class _ShortTradeState extends State<ShortTrade> {
) )
], ],
), ),
sizedBoxHeight(15.h),
action != "Exit"
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14W400_979797('Report'),
sizedBoxHeight(5.h),
GestureDetector(
onTap: () {
Utils.openFile(
url: pdfLink, fileName: "${text}_report.pdf");
},
child: Row(
children: [
Image.asset(
'assets/images/png/pdf.png',
height: 20.h,
width: 20.w,
),
text15W600("Download Pdf"),
],
),
)
],
)
], ],
), ),
) )

View File

@@ -266,7 +266,8 @@ class _VideosMoreState extends State<AudioMore> {
contentBytesController.pause(); contentBytesController.pause();
contentBytesController.stop(); contentBytesController.stop();
} }
contentBytesController.init(index); contentBytesController.init(
index, "regular");
contentBytesController contentBytesController
.isAudioSeekBarVisible.value = true; .isAudioSeekBarVisible.value = true;
//https://actions.google.com/sounds/v1/horror/aggressive_zombie_snarls.ogg //https://actions.google.com/sounds/v1/horror/aggressive_zombie_snarls.ogg

View File

@@ -1,6 +1,7 @@
import 'dart:developer'; import 'dart:developer';
import 'package:audio_video_progress_bar/audio_video_progress_bar.dart'; import 'package:audio_video_progress_bar/audio_video_progress_bar.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@@ -115,8 +116,8 @@ class _ContentBytesState extends State<ContentBytes> {
child: Align( child: Align(
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
child: Image.network( child: CachedNetworkImage(
contentBytesController imageUrl: contentBytesController
.contentBytesModel .contentBytesModel
.data! .data!
.audio![contentBytesController .audio![contentBytesController
@@ -315,6 +316,7 @@ class _ContentBytesState extends State<ContentBytes> {
SizedBox( SizedBox(
height: 600.h, height: 600.h,
child: TabBarView( child: TabBarView(
physics: const NeverScrollableScrollPhysics(),
children: [ children: [
Videos(images: reels), Videos(images: reels),
const Audios(), const Audios(),
@@ -438,8 +440,9 @@ class _ReadsState extends State<Reads> {
const Spacer() const Spacer()
], ],
), ),
Image.network( CachedNetworkImage(
"${contentBytesController.contentBytesModel.data!.read![index].image}", imageUrl:
"${contentBytesController.contentBytesModel.data!.read![index].image}",
height: 110, height: 110,
), ),
], ],
@@ -509,16 +512,20 @@ class _ReadsState extends State<Reads> {
Colors.white.withOpacity(0.1), Colors.white.withOpacity(0.1),
const Color(0xFFFFFFFF).withOpacity(0.05), const Color(0xFFFFFFFF).withOpacity(0.05),
], ],
stops: [ stops: const [
0.1, 0.1,
1, 1,
], ],
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Image.network( child: CachedNetworkImage(
contentBytesController.contentBytesModel.data! imageUrl: contentBytesController
.mostReads![index].contentByteData!.image!, .contentBytesModel
.data!
.mostReads![index]
.contentByteData!
.image!,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@@ -563,7 +570,7 @@ class _ReadsState extends State<Reads> {
Colors.white.withOpacity(0.1), Colors.white.withOpacity(0.1),
const Color(0xFFFFFFFF).withOpacity(0.05), const Color(0xFFFFFFFF).withOpacity(0.05),
], ],
stops: [ stops: const [
0.1, 0.1,
1, 1,
], ],
@@ -577,11 +584,12 @@ class _ReadsState extends State<Reads> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Image.network(contentBytesController CachedNetworkImage(
.previousReadOfUserModel imageUrl: contentBytesController
.data![index] .previousReadOfUserModel
.contentByteData! .data![index]
.image!), .contentByteData!
.image!),
SizedBox( SizedBox(
width: 15.w, width: 15.w,
), ),
@@ -600,8 +608,13 @@ class _ReadsState extends State<Reads> {
), ),
SizedBox( SizedBox(
width: 130.w, width: 130.w,
height: 40,
child: text10W300( child: text10W300(
" contentBytesControlle", contentBytesController
.previousReadOfUserModel
.data![index]
.contentByteData!
.description!,
), ),
) )
], ],
@@ -710,7 +723,7 @@ class _AudiosState extends State<Audios> {
contentBytesController.pause(); contentBytesController.pause();
contentBytesController.stop(); contentBytesController.stop();
} }
contentBytesController.init(index); contentBytesController.init(index, "regular");
contentBytesController.isAudioSeekBarVisible.value = true; contentBytesController.isAudioSeekBarVisible.value = true;
contentBytesController.indexForAudios.value = index; contentBytesController.indexForAudios.value = index;
}, },
@@ -723,7 +736,7 @@ class _AudiosState extends State<Audios> {
Colors.white.withOpacity(0.1), Colors.white.withOpacity(0.1),
const Color(0xFFFFFFFF).withOpacity(0.05), const Color(0xFFFFFFFF).withOpacity(0.05),
], ],
stops: [ stops: const [
0.1, 0.1,
1, 1,
], ],
@@ -732,8 +745,8 @@ class _AudiosState extends State<Audios> {
), ),
child: Stack( child: Stack(
children: [ children: [
Image.network( CachedNetworkImage(
contentBytesController imageUrl: contentBytesController
.contentBytesModel.data!.audio![index].image!, .contentBytesModel.data!.audio![index].image!,
), ),
Positioned( Positioned(
@@ -787,41 +800,63 @@ class _AudiosState extends State<Audios> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( InkWell(
width: 148.w, onTap: () {
decoration: BoxDecoration( if (contentBytesController.isAudioInitialize) {
gradient: LinearGradient( contentBytesController.isAudioSeekBarVisible.value =
begin: Alignment.topLeft, false;
end: Alignment.bottomRight, contentBytesController.pause();
colors: [ contentBytesController.stop();
Colors.white.withOpacity(0.1), }
const Color(0xFFFFFFFF).withOpacity(0.05), contentBytesController.init(index, "new");
], contentBytesController.isAudioSeekBarVisible.value =
stops: [ true;
0.1, contentBytesController.indexForAudios.value = index;
1, },
], child: Container(
), width: 148.w,
borderRadius: BorderRadius.circular(8), decoration: BoxDecoration(
), gradient: LinearGradient(
child: Stack( begin: Alignment.topLeft,
children: [ end: Alignment.bottomRight,
Image.network( colors: [
contentBytesController.contentBytesModel.data! Colors.white.withOpacity(0.1),
.newReleaseAudio![index].image!, const Color(0xFFFFFFFF).withOpacity(0.05),
],
stops: const [
0.1,
1,
],
), ),
const Positioned( borderRadius: BorderRadius.circular(8),
right: 5, ),
top: 5, child: Stack(
child: CircleAvatar( children: [
radius: 15, ClipRRect(
child: Icon( borderRadius: BorderRadius.circular(8),
Icons.headphones, child: CachedNetworkImage(
size: 20, imageUrl: contentBytesController
.contentBytesModel
.data!
.newReleaseAudio![index]
.image!,
height: 180,
fit: BoxFit.contain,
), ),
), ),
), const Positioned(
], right: 5,
top: 5,
child: CircleAvatar(
radius: 15,
child: Icon(
Icons.headphones,
size: 20,
),
),
),
],
),
), ),
), ),
const SizedBox( const SizedBox(
@@ -1209,9 +1244,21 @@ class _ContentTabBarState extends State<ContentTabBar>
super.initState(); super.initState();
} }
ContentBytesController contentBytesController =
Get.put(ContentBytesController());
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return TabBar( return TabBar(
onTap: (index) {
if (index == 0 || index == 2) {
if (contentBytesController.isAudioInitialize) {
contentBytesController.isAudioSeekBarVisible.value = false;
contentBytesController.pause();
contentBytesController.stop();
}
}
},
tabAlignment: TabAlignment.fill, tabAlignment: TabAlignment.fill,
isScrollable: false, isScrollable: false,
dividerColor: Colors.transparent, dividerColor: Colors.transparent,

View File

@@ -186,7 +186,7 @@ packages:
source: hosted source: hosted
version: "0.7.10" version: "0.7.10"
device_info_plus: device_info_plus:
dependency: transitive dependency: "direct main"
description: description:
name: device_info_plus name: device_info_plus
sha256: f52ab3b76b36ede4d135aab80194df8925b553686f0fa12226b4e2d658e45903 sha256: f52ab3b76b36ede4d135aab80194df8925b553686f0fa12226b4e2d658e45903
@@ -816,6 +816,54 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
url: "https://pub.dev"
source: hosted
version: "11.3.1"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "8bb852cd759488893805c3161d0b2b5db55db52f773dbb014420b304055ba2c5"
url: "https://pub.dev"
source: hosted
version: "12.0.6"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: e9ad66020b89ff1b63908f247c2c6f931c6e62699b756ef8b3c4569350cd8662
url: "https://pub.dev"
source: hosted
version: "9.4.4"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: "48d4fcf201a1dad93ee869ab0d4101d084f49136ec82a8a06ed9cfeacab9fd20"
url: "https://pub.dev"
source: hosted
version: "4.2.1"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@@ -1327,5 +1375,7 @@ packages:
source: hosted source: hosted
version: "6.3.0" version: "6.3.0"
sdks: sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.13.0" dart: ">=3.2.0-0 <4.0.0"
flutter: ">=3.16.0"

View File

@@ -51,6 +51,8 @@ dependencies:
flutter_bloc: ^8.1.5 flutter_bloc: ^8.1.5
equatable: ^2.0.5 equatable: ^2.0.5
timeago: ^3.6.1 timeago: ^3.6.1
device_info_plus: ^8.2.2
permission_handler: ^11.3.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: