Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Fix padding for ipads
Browse files Browse the repository at this point in the history
  • Loading branch information
milenark committed Jan 22, 2024
1 parent 7a4b080 commit 60a1f2e
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 106 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ SPEC CHECKSUMS:
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36

PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef

Expand Down
112 changes: 56 additions & 56 deletions ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class StreamCardState extends ConsumerState<StreamCard> {
Navigator.push(
context,
MaterialPageRoute(
//TODO - is chat enabled in live mode?
builder: (context) => VideoPlayerPage(
stream: widget.stream,
),
Expand Down
25 changes: 15 additions & 10 deletions lib/views/course_view/course_detail_view/course_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:gocast_mobile/base/networking/api/gocast/api_v2.pbgrpc.dart';
import 'package:gocast_mobile/providers.dart';
import 'package:gocast_mobile/views/components/custom_search_top_nav_bar_back_button.dart';
import 'package:gocast_mobile/views/course_view/components/pin_button.dart';
import 'package:gocast_mobile/views/course_view/course_detail_view/stream_card.dart';
import 'package:gocast_mobile/views/course_view/components/stream_card.dart';

class CourseDetail extends ConsumerStatefulWidget {
final String title;
Expand Down Expand Up @@ -109,17 +109,22 @@ class CourseDetailState extends ConsumerState<CourseDetail> {
List<String> thumbnails,
ScaffoldMessengerState scaffoldMessenger,
) {
double width = MediaQuery.of(context).size.width;
bool isTablet = width >= 600 ? true : false;
return Expanded(
child: courseStreams.isNotEmpty
? ListView.builder(
itemCount: courseStreams.length,
padding: const EdgeInsets.symmetric(horizontal: 10.0),
itemBuilder: (context, index) => _streamCardBuilder(
context,
index,
courseStreams,
thumbnails,
scaffoldMessenger,
? Padding(
padding: EdgeInsets.symmetric(horizontal: isTablet ? width * 0.15 : 0),
child: ListView.builder(
itemCount: courseStreams.length,
padding: const EdgeInsets.symmetric(horizontal: 10.0),
itemBuilder: (context, index) => _streamCardBuilder(
context,
index,
courseStreams,
thumbnails,
scaffoldMessenger,
),
),
)
: const Center(child: Text('No courses available')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class DownloadCoursesContentView extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final TextEditingController searchController = TextEditingController();
double width = MediaQuery.of(context).size.width;

return BaseView(
customAppBar: CustomSearchTopNavBar(
Expand All @@ -45,25 +46,34 @@ class DownloadCoursesContentView extends ConsumerWidget {
},
child: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0),
child: ListView.builder(
itemCount: videoCards.isEmpty ? 1 : videoCards.length,
itemBuilder: (BuildContext context, int index) {
if (videoCards.isEmpty) {
return const Center(
child: Padding(
padding: AppPadding.sectionPadding,
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 295.0),
child: Text('No Downloaded Courses'),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal:
width >= 600 ? MediaQuery.of(context).size.width * 0.15 : 0,
),
child: ListView.builder(
itemCount: videoCards.isEmpty ? 1 : videoCards.length,
itemBuilder: (BuildContext context, int index) {
if (videoCards.isEmpty) {
return const Center(
child: Padding(
padding: AppPadding.sectionPadding,
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 295.0),
child: Text('No Downloaded Courses'),
),
),
),
),
);
} else {
return videoCards[index];
}
},
);
} else {
return Padding(
padding: EdgeInsets.only(bottom: width * 0.02),
child: videoCards[index],
);
}
},
),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class PinnedCoursesContentView extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
TextEditingController searchController = TextEditingController();
double width = MediaQuery.of(context).size.width;

return BaseView(
customAppBar: CustomSearchTopNavBar(
Expand All @@ -36,25 +37,34 @@ class PinnedCoursesContentView extends ConsumerWidget {
),
child: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0),
child: ListView.builder(
itemCount: pinnedCourseCards.isEmpty ? 1 : pinnedCourseCards.length,
itemBuilder: (BuildContext context, int index) {
if (pinnedCourseCards.isEmpty) {
return const Center(
child: Padding(
padding: AppPadding.sectionPadding,
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 295.0),
child: Text('No Pinned Courses'),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal:
width >= 600 ? MediaQuery.of(context).size.width * 0.15 : 0,
),
child: ListView.builder(
itemCount: pinnedCourseCards.isEmpty ? 1 : pinnedCourseCards.length,
itemBuilder: (BuildContext context, int index) {
if (pinnedCourseCards.isEmpty) {
return const Center(
child: Padding(
padding: AppPadding.sectionPadding,
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 295.0),
child: Text('No Pinned Courses'),
),
),
),
),
);
} else {
return pinnedCourseCards[index];
}
},
);
} else {
return Padding(
padding: EdgeInsets.only(bottom: width * 0.02),
child: pinnedCourseCards[index],
);
}
},
),
),
),
);
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,10 @@ packages:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "4d062ad505390ecef1c4bfb6001cd857a51e00912cc9dfb66edb1886a9ebd80c"
sha256: b99ca8d8bae9c6b43d568218691aa537fb0aeae1d7d34eadf112a6aa36d26506
url: "https://pub.dev"
source: hosted
version: "3.10.2"
version: "3.11.0"
win32:
dependency: transitive
description:
Expand All @@ -918,5 +918,5 @@ packages:
source: hosted
version: "6.5.0"
sdks:
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart: ">=3.2.3 <4.0.0"
flutter: ">=3.16.6"

0 comments on commit 60a1f2e

Please sign in to comment.