Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
second_display
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
second_display
Commits
e617db44
Commit
e617db44
authored
Mar 16, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add youtube video
parent
04a97fbd
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
280 additions
and
60 deletions
+280
-60
config_display.dart
lib/models/config_display.dart
+3
-3
carousel.dart
lib/ui/carousel.dart
+3
-2
main_page.dart
lib/ui/main_page.dart
+15
-7
orders.dart
lib/ui/orders.dart
+53
-43
video_promotion.dart
lib/ui/video_promotion.dart
+5
-5
youtube.dart
lib/ui/youtube.dart
+25
-0
pubspec.lock
pubspec.lock
+175
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/models/config_display.dart
View file @
e617db44
...
...
@@ -2,13 +2,13 @@ class ConfigDisplay {
final
String
backgroundColorCarouselVideo
;
final
String
textColor
;
final
String
backgroundColorOrder
;
final
int
isVideo
;
final
String
mediaType
;
ConfigDisplay
(
{
required
this
.
backgroundColorCarouselVideo
,
required
this
.
textColor
,
required
this
.
backgroundColorOrder
,
required
this
.
isVideo
});
required
this
.
mediaType
});
factory
ConfigDisplay
.
createConfig
(
Map
<
String
,
dynamic
>
json
)
{
return
ConfigDisplay
(
...
...
@@ -16,6 +16,6 @@ class ConfigDisplay {
json
[
'background_color_carousel_video'
].
toString
(),
textColor:
json
[
'text_color'
].
toString
(),
backgroundColorOrder:
json
[
'background_color_order'
],
isVideo:
json
[
'is_video
'
]);
mediaType:
json
[
'media_type
'
]);
}
}
lib/ui/carousel.dart
View file @
e617db44
...
...
@@ -19,10 +19,9 @@ class _CarouselIndicatorState extends State<CarouselIndicator> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
// color: Colors.red,
// padding: EdgeInsets.only(top: MediaQuery.of(context).size.height *),
child:
Container
(
margin:
const
EdgeInsets
.
all
(
5.0
),
//
margin: const EdgeInsets.all(5.0),
child:
ClipRRect
(
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
5.0
)),
...
...
@@ -69,6 +68,8 @@ class _CarouselIndicatorState extends State<CarouselIndicator> {
autoPlay:
true
,
autoPlayInterval:
const
Duration
(
seconds:
5
),
enlargeCenterPage:
true
,
viewportFraction:
1.0
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
onPageChanged:
(
index
,
reason
)
{
setState
(()
{
_current
=
index
;
...
...
lib/ui/main_page.dart
View file @
e617db44
...
...
@@ -7,6 +7,7 @@ import 'package:second_display/models/config_display.dart';
import
'package:second_display/ui/carousel.dart'
;
import
'package:second_display/ui/orders.dart'
;
import
'package:second_display/ui/video_promotion.dart'
;
import
'package:second_display/ui/youtube.dart'
;
// ignore: must_be_immutable
class
MainPage
extends
StatelessWidget
{
...
...
@@ -35,18 +36,25 @@ class MainPage extends StatelessWidget {
return
Row
(
children:
[
(
configState
[
0
].
isVideo
==
1
)
(
configState
[
0
].
mediaType
==
'video'
)
?
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
color:
colorBackgroundCarouselandVideo
,
// color: Colors.white,
child:
VideoPromotion
(),
)
:
Container
(
:
(
configState
[
0
].
mediaType
==
'image'
)
?
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
child:
CarouselIndicator
(
backgroundColor:
colorBackgroundCarouselandVideo
),
)
:
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
child:
YoutubeVideo
(),
),
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
...
...
lib/ui/orders.dart
View file @
e617db44
...
...
@@ -73,8 +73,8 @@ class OrderPage extends StatelessWidget {
children:
[
topList
(
context
,
"Order ID: "
+
list
.
id
.
toUpperCase
(),
timeOrder
),
topList
(
context
,
list
.
table_
section_
name
,
"Tabel Section: "
+
list
.
table_name
),
topList
(
context
,
list
.
table_name
,
"Tabel Section: "
+
list
.
table_
section_
name
),
],
)
],
...
...
@@ -103,14 +103,19 @@ class OrderPage extends StatelessWidget {
return
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Column
(
Container
(
margin:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
size
.
height
*
0.01
),
child:
Column
(
children:
[
Container
(
// color: Colors.white,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.05
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.05
,
margin:
EdgeInsets
.
only
(
top:
MediaQuery
.
of
(
context
).
size
.
height
*
top:
MediaQuery
.
of
(
context
).
size
.
height
*
0.005
,
bottom:
MediaQuery
.
of
(
context
).
size
.
height
*
...
...
@@ -136,14 +141,18 @@ class OrderPage extends StatelessWidget {
i
<
OrderOptionDetail
.
length
;
i
++)
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
// color: Colors.green,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.02
,
margin:
EdgeInsets
.
only
(
top:
MediaQuery
.
of
(
context
).
size
.
height
*
0.001
,
bottom:
MediaQuery
.
of
(
context
).
size
.
height
*
top:
MediaQuery
.
of
(
context
)
.
size
.
height
*
0.000
,
bottom:
MediaQuery
.
of
(
context
)
.
size
.
height
*
0.001
),
child:
Row
(
children:
[
...
...
@@ -151,12 +160,13 @@ class OrderPage extends StatelessWidget {
context
,
Alignment
.
topLeft
,
OrderOptionDetail
[
i
].
trim
()),
listOforderOption
(
context
,
Alignment
.
centerRight
,
''
)
listOforderOption
(
context
,
Alignment
.
centerRight
,
''
)
],
),
),
],
),
)
],
);
...
...
lib/ui/video_promotion.dart
View file @
e617db44
...
...
@@ -32,11 +32,11 @@ class _VideoPromotionState extends State<VideoPromotion> {
return
Center
(
child:
Container
(
// color: Colors.green,
margin:
EdgeInsets
.
fromLTRB
(
MediaQuery
.
of
(
context
).
size
.
width
*
0.05
,
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
MediaQuery
.
of
(
context
).
size
.
width
*
0.05
,
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
),
//
margin: EdgeInsets.fromLTRB(
//
MediaQuery.of(context).size.width * 0.05,
//
MediaQuery.of(context).size.height * 0.1,
//
MediaQuery.of(context).size.width * 0.05,
//
MediaQuery.of(context).size.height * 0.1),
child:
_controller
!.
value
.
isInitialized
?
AspectRatio
(
aspectRatio:
_controller
!.
value
.
aspectRatio
,
...
...
lib/ui/youtube.dart
0 → 100644
View file @
e617db44
import
'package:flutter/material.dart'
;
import
'package:flutter_html/flutter_html.dart'
;
class
YoutubeVideo
extends
StatefulWidget
{
const
YoutubeVideo
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
YoutubeVideo
>
createState
()
=>
_YoutubeVideoState
();
}
class
_YoutubeVideoState
extends
State
<
YoutubeVideo
>
{
@override
Widget
build
(
BuildContext
context
)
{
var
widthYoutbe
=
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
;
var
heighYoutbe
=
MediaQuery
.
of
(
context
).
size
.
height
;
return
Center
(
child:
Container
(
// color: Colors.green,
child:
Html
(
data:
'<iframe width="
$widthYoutbe
" height="
$heighYoutbe
" src="https://www.youtube.com/embed/Mi72fOuiwA0?rel=0&modestbranding=1&autoplay=1&mute=1&enablejsapi=1&controls=0&loop=1&autohide=1" frameborder="0" clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
,
)),
);
}
}
pubspec.lock
View file @
e617db44
...
...
@@ -43,6 +43,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
chewie:
dependency: transitive
description:
name: chewie
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
chewie_audio:
dependency: transitive
description:
name: chewie_audio
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
clock:
dependency: transitive
description:
...
...
@@ -78,6 +92,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
flutter:
dependency: "direct main"
description: flutter
...
...
@@ -90,6 +111,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.1"
flutter_html:
dependency: "direct main"
description:
name: flutter_html
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
flutter_layout_grid:
dependency: transitive
description:
name: flutter_layout_grid
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.6"
flutter_lints:
dependency: "direct dev"
description:
...
...
@@ -97,6 +132,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_math_fork:
dependency: transitive
description:
name: flutter_math_fork
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
flutter_svg:
dependency: transitive
description:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "0.23.0+1"
flutter_test:
dependency: "direct dev"
description: flutter
...
...
@@ -184,6 +233,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
numerus:
dependency: transitive
description:
name: numerus
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
path:
dependency: transitive
description:
...
...
@@ -191,6 +247,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
path_drawing:
dependency: transitive
description:
name: path_drawing
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.1+1"
path_parsing:
dependency: transitive
description:
name: path_parsing
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
plugin_platform_interface:
dependency: transitive
description:
...
...
@@ -205,6 +282,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1+1"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -252,6 +336,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
tuple:
dependency: transitive
description:
name: tuple
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
typed_data:
dependency: transitive
description:
...
...
@@ -273,6 +364,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
very_good_analysis:
dependency: transitive
description:
name: very_good_analysis
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
video_player:
dependency: "direct main"
description:
...
...
@@ -308,6 +406,83 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
wakelock:
dependency: transitive
description:
name: wakelock
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+2"
wakelock_macos:
dependency: transitive
description:
name: wakelock_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
wakelock_windows:
dependency: transitive
description:
name: wakelock_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.0"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.3"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.1"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
sdks:
dart: ">=2.16.1 <3.0.0"
flutter: ">=2.8.0"
pubspec.yaml
View file @
e617db44
...
...
@@ -32,6 +32,7 @@ dependencies:
flutter
:
sdk
:
flutter
flutter_bloc
:
^8.0.1
flutter_html
:
^2.2.1
http
:
^0.13.4
intl
:
^0.17.0
loading_animations
:
^2.2.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment