-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: construct header section in detail view (#57)
* construct header section in detail view * remove test server code * comment out unimplemented statements * Update client/lib/widgets/detail/header.dart Co-authored-by: Mo Kweon <[email protected]> * Update client/lib/screens/detail_screen.dart Co-authored-by: Mo Kweon <[email protected]> * Update client/lib/widgets/detail/youtube.dart Co-authored-by: Mo Kweon <[email protected]> * part of information injected from Video object. * remove unused imports * update Video proto message * update header to use updated Video proto message Co-authored-by: Mo Kweon <[email protected]>
- Loading branch information
1 parent
f5dd85f
commit bbba5e8
Showing
13 changed files
with
306 additions
and
124 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c | ||
|
||
COCOAPODS: 1.10.1 | ||
COCOAPODS: 1.10.0 |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AbstractWidget extends StatelessWidget { | ||
const AbstractWidget({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container(); | ||
} | ||
} |
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,68 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:pr12er/protos/pkg/pr12er/messages.pb.dart'; | ||
|
||
// ignore: must_be_immutable | ||
class HeaderWidget extends StatelessWidget { | ||
// this is a placeholder | ||
// didILIkedIt should be replaced in the next future PR | ||
// after defining user related information | ||
bool didILikedIt = false; | ||
|
||
late Video video; | ||
|
||
HeaderWidget({Key? key, required this.video}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
margin: const EdgeInsets.only(top: 10), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
...getPresenterWidgets(), | ||
const SizedBox(width: 25), | ||
...getViewNumbersWidgets(), | ||
const SizedBox(width: 25), | ||
...getDateWidgets(), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Widget getLikeIcon() { | ||
if (didILikedIt) { | ||
return const Icon(Icons.thumb_up_alt); | ||
} | ||
return const Icon(Icons.thumb_up_alt_outlined); | ||
} | ||
|
||
List<Widget> getViewNumbersWidgets() { | ||
return [ | ||
const SizedBox(width: 8), | ||
const Icon(Icons.remove_red_eye), | ||
const SizedBox(width: 8), | ||
Text(video.numberOfViews.toString(), | ||
style: const TextStyle(fontSize: 18)), | ||
const SizedBox(width: 15), | ||
getLikeIcon(), | ||
const SizedBox(width: 8), | ||
Text(video.numberOfLike.toString(), style: const TextStyle(fontSize: 18)), | ||
]; | ||
} | ||
|
||
List<Widget> getPresenterWidgets() { | ||
return [ | ||
Text(video.presenter, | ||
style: const TextStyle( | ||
color: Colors.black54, fontSize: 18, fontStyle: FontStyle.italic)) | ||
]; | ||
} | ||
|
||
List<Widget> getDateWidgets() { | ||
return [ | ||
const Icon(Icons.today), | ||
const SizedBox(width: 8), | ||
Text(video.publishedDate, style: const TextStyle(fontSize: 18)) | ||
]; | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class RecommentationWidget extends StatelessWidget { | ||
const RecommentationWidget({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container(); | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class RepositoryWidget extends StatelessWidget { | ||
const RepositoryWidget({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container(); | ||
} | ||
} |
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:flutter/material.dart'; | ||
import 'package:youtube_player_flutter/youtube_player_flutter.dart'; | ||
|
||
class YoutubeWidget extends StatefulWidget { | ||
final String youtubeId; | ||
|
||
const YoutubeWidget({Key? key, required this.youtubeId}) : super(key: key); | ||
|
||
@override | ||
_DetailState createState() => _DetailState(); | ||
} | ||
|
||
class _DetailState extends State<YoutubeWidget> { | ||
late final YoutubePlayerController _controller; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
|
||
_controller = YoutubePlayerController( | ||
initialVideoId: widget.youtubeId, | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return YoutubePlayerBuilder( | ||
player: YoutubePlayer( | ||
controller: _controller, | ||
), | ||
builder: (context, player) { | ||
return Column( | ||
children: [player], | ||
); | ||
}, | ||
); | ||
} | ||
} |
Oops, something went wrong.