Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions lib/controller/podcast/single_podcast_cotroller.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'dart:async';
import 'dart:developer';
import 'dart:developer' as developer show log;

import 'package:get/get.dart';
import 'package:just_audio/just_audio.dart';
Expand Down Expand Up @@ -48,9 +48,9 @@ class SinglePodcastController extends GetxController {

int? duration;
RxInt selectedIndex = 0.obs;
Rx<Duration> progressState = const Duration(seconds: 0).obs;
Rx<Duration> progressValue = const Duration(seconds: 0).obs;
Rx<Duration> totalDuration = const Duration(seconds: 0).obs;
Rx<Duration> bufferState = const Duration(seconds: 0).obs;
Rx<Duration> bufferedValue = const Duration(seconds: 0).obs;
Timer? timer;
startProgress() {
const tick = Duration(seconds: 1);
Expand All @@ -74,16 +74,14 @@ class SinglePodcastController extends GetxController {
timer.cancel();
}
if (player.playing) {
progressState.value = player.position;
progressValue.value = player.position;

bufferState.value = player.bufferedPosition;
debugPrint('TIMER :: ${progressState.value}');
bufferedValue.value = player.bufferedPosition;
developer.log('TIMER :: ${progressValue.value}');
}
});
}



setLoopMode() {
if (isLoopAll.value) {
isLoopAll.value = false;
Expand Down
10 changes: 5 additions & 5 deletions lib/themes/app_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class AppThemes {
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
textStyle: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.pressed)) {
textStyle: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.pressed)) {
return const TextStyle(
fontSize: 16,
fontFamily: 'dana',
Expand All @@ -30,8 +30,8 @@ class AppThemes {
color: SolidColors.posterSubTitle,
);
}),
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.pressed)) {
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.pressed)) {
return SolidColors.seeMore;
}
return SolidColors.primaryColor;
Expand All @@ -40,7 +40,7 @@ class AppThemes {
),
fontFamily: 'dana',
brightness: Brightness.light,
accentColor: SolidColors.primaryColor,
hintColor: SolidColors.primaryColor,
textTheme: const TextTheme(
displayLarge: TextStyle(
fontFamily: 'dana',
Expand Down
36 changes: 25 additions & 11 deletions lib/view/main_screen/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tec/component/dimens.dart';
Expand All @@ -8,12 +7,10 @@ import 'package:tec/constant/my_strings.dart';
import 'package:tec/controller/home_screen_controller.dart';
import 'package:tec/controller/article/single_article_controller.dart';
import 'package:tec/view/articles/articel_list_sceen.dart';

import 'see_more_podcast_screen.dart';

import '../../controller/article/list_article_controller.dart';
import '../podcast/hot_podcast_list.dart';


// ignore: must_be_immutable
class HomeScreen extends StatelessWidget {
Expand All @@ -38,7 +35,7 @@ class HomeScreen extends StatelessWidget {
return Obx(() => homeScreenController.loading.value == false
? RefreshIndicator(
// ignore: deprecated_member_use
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
onRefresh: () {
return homeScreenController.getHomeItems();
},
Expand All @@ -48,11 +45,18 @@ class HomeScreen extends StatelessWidget {
padding: EdgeInsets.fromLTRB(0, Dimens.medium, 0, 0),
child: Column(
children: [
Poster(homeScreenController: homeScreenController, textTheme: textTheme, size: size,),
Poster(
homeScreenController: homeScreenController,
textTheme: textTheme,
size: size,
),
SizedBox(
height: Dimens.medium,
),
Tag(textTheme: textTheme, bodyMargin: bodyMargin,),
Tag(
textTheme: textTheme,
bodyMargin: bodyMargin,
),
SizedBox(
height: Dimens.large,
),
Expand All @@ -65,13 +69,23 @@ class HomeScreen extends StatelessWidget {
textTheme: textTheme,
title: MyStrings.viewHotestBlog,
)),
TopVisited(bodyMargin: bodyMargin, homeScreenController: homeScreenController, singleArticleController: singleArticleController, size: size, textTheme: textTheme,)
, SizedBox(
TopVisited(
bodyMargin: bodyMargin,
homeScreenController: homeScreenController,
singleArticleController: singleArticleController,
size: size,
textTheme: textTheme,
),
SizedBox(
height: Dimens.large,
),
SeeMorePodcast(
bodyMargin: bodyMargin, textTheme: textTheme),
TopPodcast(bodyMargin: bodyMargin, homeScreenController: homeScreenController, size: size,),
TopPodcast(
bodyMargin: bodyMargin,
homeScreenController: homeScreenController,
size: size,
),
SizedBox(
height: Dimens.xlarge + 36,
)
Expand Down
2 changes: 1 addition & 1 deletion lib/view/main_screen/see_more_podcast_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SeeMorePodcast extends StatelessWidget {
onTap: () => Get.to(HotPodcastList(title: MyStrings.myFavPodcast,)),
child: Text(
MyStrings.viewHotestPodCasts,
style: textTheme.headline3,
style: textTheme.displaySmall,
),
),
)
Expand Down
5 changes: 2 additions & 3 deletions lib/view/podcast/single_manage_podcast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class SingleManagePodcast extends StatelessWidget {
children: [
Text(
MyStrings.selectImage,
style: textheme.headline2,
style: textheme.displayMedium,
),
const Icon(
Icons.add,
Expand Down Expand Up @@ -201,11 +201,10 @@ class SingleManagePodcast extends StatelessWidget {
),
Text(
MyStrings.frilance,
style: textheme.headline4,
style: textheme.headlineMedium,
),
],
),

Text(
'${managePodcastController.currentHourValue.value}:${managePodcastController.currentMinuteValue.value}:${managePodcastController.currentSecondeValue.value}',
style: const TextStyle(
Expand Down
9 changes: 4 additions & 5 deletions lib/view/widgets/article_widgets.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:tec/component/dimens.dart';
import 'package:tec/component/my_component.dart';
Expand Down Expand Up @@ -87,7 +86,7 @@ class Cats extends StatelessWidget {
child: Center(
child: Text(
homeScreenController.tagsList[index].title!,
style: textTheme.headline2,
style: textTheme.displayMedium,
),
)),
),
Expand Down Expand Up @@ -178,14 +177,14 @@ class Similar extends StatelessWidget {
Text(
singleArticleController
.relatedList[index].author!,
style: textheme.subtitle1,
style: textheme.titleMedium,
),
Row(
children: [
Text(
singleArticleController
.relatedList[index].view!,
style: textheme.subtitle1,
style: textheme.titleMedium,
),
SizedBox(
width: Dimens.small,
Expand Down Expand Up @@ -262,7 +261,7 @@ class Tags extends StatelessWidget {
Dimens.small, Dimens.small),
child: Text(
singleArticleController.tagList[index].title!,
style: textheme.headline2,
style: textheme.displayMedium,
)),
),
),
Expand Down
Loading