Skip to content

Commit

Permalink
safearea fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HemantKArya committed Aug 29, 2024
1 parent a916619 commit 1e61000
Show file tree
Hide file tree
Showing 9 changed files with 1,448 additions and 1,396 deletions.
100 changes: 51 additions & 49 deletions lib/screens/screen/chart/chart_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,57 +32,59 @@ class _ChartScreenState extends State<ChartScreen> {

@override
Widget build(BuildContext context) {
return Scaffold(
body: FutureBuilder(
future: chartModel,
builder: (context, state) {
if (state.connectionState == ConnectionState.waiting ||
state.data == null) {
return const Center(
child: SizedBox(
height: 50,
width: 50,
child: CircularProgressIndicator(
color: Default_Theme.accentColor2,
)),
);
} else if (state.data!.chartItems!.isEmpty) {
return Center(
child: Text("Error: No Item in Chart",
style: Default_Theme.secondoryTextStyleMedium.merge(
const TextStyle(
fontSize: 24,
color: Color.fromARGB(255, 255, 235, 251)))),
);
} else {
return CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
customDiscoverBar(context, state.data!), //AppBar
SliverList(
delegate: SliverChildListDelegate([
ListView.builder(
shrinkWrap: true,
padding: const EdgeInsets.only(
top: 5,
return SafeArea(
child: Scaffold(
body: FutureBuilder(
future: chartModel,
builder: (context, state) {
if (state.connectionState == ConnectionState.waiting ||
state.data == null) {
return const Center(
child: SizedBox(
height: 50,
width: 50,
child: CircularProgressIndicator(
color: Default_Theme.accentColor2,
)),
);
} else if (state.data!.chartItems!.isEmpty) {
return Center(
child: Text("Error: No Item in Chart",
style: Default_Theme.secondoryTextStyleMedium.merge(
const TextStyle(
fontSize: 24,
color: Color.fromARGB(255, 255, 235, 251)))),
);
} else {
return CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
customDiscoverBar(context, state.data!), //AppBar
SliverList(
delegate: SliverChildListDelegate([
ListView.builder(
shrinkWrap: true,
padding: const EdgeInsets.only(
top: 5,
),
physics: const NeverScrollableScrollPhysics(),
itemCount: state.data!.chartItems!.length,
itemBuilder: (context, index) {
return ChartListTile(
title: state.data!.chartItems![index].name!,
subtitle: state.data!.chartItems![index].subtitle!,
imgUrl: state.data!.chartItems![index].imageUrl!,
);
},
),
physics: const NeverScrollableScrollPhysics(),
itemCount: state.data!.chartItems!.length,
itemBuilder: (context, index) {
return ChartListTile(
title: state.data!.chartItems![index].name!,
subtitle: state.data!.chartItems![index].subtitle!,
imgUrl: state.data!.chartItems![index].imageUrl!,
);
},
),
]))
],
);
}
},
]))
],
);
}
},
),
backgroundColor: Default_Theme.themeColor,
),
backgroundColor: Default_Theme.themeColor,
);
}

Expand Down
465 changes: 236 additions & 229 deletions lib/screens/screen/common_views/album_view.dart

Large diffs are not rendered by default.

610 changes: 311 additions & 299 deletions lib/screens/screen/common_views/artist_view.dart

Large diffs are not rendered by default.

460 changes: 234 additions & 226 deletions lib/screens/screen/common_views/playlist_view.dart

Large diffs are not rendered by default.

232 changes: 118 additions & 114 deletions lib/screens/screen/explore_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,125 +49,129 @@ class _ExploreScreenState extends State<ExploreScreen> {

@override
Widget build(BuildContext context) {
return MultiBlocProvider(
providers: [
BlocProvider<RecentlyCubit>(
create: (context) => RecentlyCubit(),
lazy: false,
),
BlocProvider(
create: (context) => yTMusicCubit,
lazy: false,
),
BlocProvider(
create: (context) => FetchChartCubit(),
lazy: false,
),
],
child: Scaffold(
body: RefreshIndicator(
onRefresh: () async {
await yTMusicCubit.fetchYTMusic();
log("Refreshed");
},
child: CustomScrollView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
slivers: [
customDiscoverBar(context), //AppBar
SliverList(
delegate: SliverChildListDelegate(
[
CaraouselWidget(),
Padding(
padding: const EdgeInsets.only(top: 15.0),
child: SizedBox(
child: BlocBuilder<RecentlyCubit, RecentlyCubitState>(
builder: (context, state) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 1000),
child: state is RecentlyCubitInitial
? const Center(
child: SizedBox(
height: 60,
width: 60,
child: CircularProgressIndicator(
color: Default_Theme.accentColor2,
)),
)
: ((state.mediaPlaylist.mediaItems.isNotEmpty)
? InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const HistoryView()));
},
child: TabSongListWidget(
list: state.mediaPlaylist.mediaItems
.map((e) {
return SongCardWidget(
song: e,
onTap: () {
context
.read<
BloomeePlayerCubit>()
.bloomeePlayer
.addQueueItem(
e,
doPlay: true,
);
return SafeArea(
child: MultiBlocProvider(
providers: [
BlocProvider<RecentlyCubit>(
create: (context) => RecentlyCubit(),
lazy: false,
),
BlocProvider(
create: (context) => yTMusicCubit,
lazy: false,
),
BlocProvider(
create: (context) => FetchChartCubit(),
lazy: false,
),
],
child: Scaffold(
body: RefreshIndicator(
onRefresh: () async {
await yTMusicCubit.fetchYTMusic();
log("Refreshed");
},
child: CustomScrollView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
slivers: [
customDiscoverBar(context), //AppBar
SliverList(
delegate: SliverChildListDelegate(
[
CaraouselWidget(),
Padding(
padding: const EdgeInsets.only(top: 15.0),
child: SizedBox(
child: BlocBuilder<RecentlyCubit, RecentlyCubitState>(
builder: (context, state) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 1000),
child: state is RecentlyCubitInitial
? const Center(
child: SizedBox(
height: 60,
width: 60,
child: CircularProgressIndicator(
color: Default_Theme.accentColor2,
)),
)
: ((state.mediaPlaylist.mediaItems
.isNotEmpty)
? InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const HistoryView()));
},
child: TabSongListWidget(
list: state
.mediaPlaylist.mediaItems
.map((e) {
return SongCardWidget(
song: e,
onTap: () {
context
.read<
BloomeePlayerCubit>()
.bloomeePlayer
.addQueueItem(
e,
doPlay: true,
);

// context
// .read<DownloaderCubit>()
// .downloadSong(e);
},
onOptionsTap: () =>
showMoreBottomSheet(
context, e),
);
}).toList(),
category: "Recently",
columnSize: 3,
),
)
: const SizedBox()),
);
},
// context
// .read<DownloaderCubit>()
// .downloadSong(e);
},
onOptionsTap: () =>
showMoreBottomSheet(
context, e),
);
}).toList(),
category: "Recently",
columnSize: 3,
),
)
: const SizedBox()),
);
},
),
),
),
),
BlocBuilder<YTMusicCubit, YTMusicCubitState>(
builder: (context, state) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 400),
child: state is YTMusicCubitInitial
? BlocBuilder<ConnectivityCubit,
ConnectivityState>(
builder: (context, state2) {
if ((state2 ==
ConnectivityState.disconnected)) {
return const SignBoardWidget(
message: "No Internet Connection!",
icon: MingCute.wifi_off_line,
);
} else {
return const SizedBox();
}
},
)
: ytSection(state.ytmData),
);
},
),
],
),
)
],
BlocBuilder<YTMusicCubit, YTMusicCubitState>(
builder: (context, state) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 400),
child: state is YTMusicCubitInitial
? BlocBuilder<ConnectivityCubit,
ConnectivityState>(
builder: (context, state2) {
if ((state2 ==
ConnectivityState.disconnected)) {
return const SignBoardWidget(
message: "No Internet Connection!",
icon: MingCute.wifi_off_line,
);
} else {
return const SizedBox();
}
},
)
: ytSection(state.ytmData),
);
},
),
],
),
)
],
),
),
backgroundColor: Default_Theme.themeColor,
),
backgroundColor: Default_Theme.themeColor,
),
);
}
Expand Down
Loading

0 comments on commit 1e61000

Please sign in to comment.