-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into enhancement/288-displ…
…ay-study-room-utilization-percentages-using-iris
- Loading branch information
Showing
16 changed files
with
231 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import 'package:campus_flutter/base/enums/device.dart'; | ||
import 'package:campus_flutter/base/services/device_type_service.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class GridUtility { | ||
static int campusCrossAxisCount(BuildContext context) { | ||
switch (DeviceService.getType(context)) { | ||
case Device.landscapeTablet: | ||
return 6; | ||
case Device.portraitTablet: | ||
return 4; | ||
case Device.phone: | ||
return 2; | ||
} | ||
} | ||
|
||
static int campusPaddedCrossAxisCount(BuildContext context) { | ||
switch (DeviceService.getType(context)) { | ||
case Device.landscapeTablet: | ||
return 3; | ||
case Device.portraitTablet: | ||
return 4; | ||
case Device.phone: | ||
return 2; | ||
} | ||
} | ||
|
||
static int campusNumberOfItems(BuildContext context) { | ||
switch (DeviceService.getType(context)) { | ||
case Device.landscapeTablet: | ||
return 6; | ||
case Device.portraitTablet: | ||
return 8; | ||
case Device.phone: | ||
return 6; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:campus_flutter/base/extensions/context.dart'; | ||
import 'package:campus_flutter/base/networking/apis/tumdev/campus_backend.pb.dart'; | ||
import 'package:campus_flutter/campusComponent/view/movie/movie_card_view.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class MovieGridView extends StatelessWidget { | ||
const MovieGridView({ | ||
super.key, | ||
required this.movies, | ||
required this.padding, | ||
required this.crossAxisCount, | ||
required this.withinScrollView, | ||
}); | ||
|
||
final List<Movie> movies; | ||
final EdgeInsets padding; | ||
final int crossAxisCount; | ||
final bool withinScrollView; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GridView.count( | ||
shrinkWrap: withinScrollView, | ||
physics: withinScrollView ? NeverScrollableScrollPhysics() : null, | ||
padding: padding, | ||
crossAxisCount: crossAxisCount, | ||
mainAxisSpacing: context.padding, | ||
crossAxisSpacing: context.padding, | ||
childAspectRatio: 250 / 470, | ||
children: [for (var movie in movies) MovieCardView(movie: movie)], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.