Commit 90dd4942 authored by Dio Maulana's avatar Dio Maulana

fix error base url

parent e617db44
......@@ -44,7 +44,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.second_display"
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
......
import 'dart:convert';
import 'package:second_display/helper/config.dart';
import 'package:second_display/main.dart';
import 'package:second_display/models/config_display.dart';
import 'package:second_display/models/order_detail.dart';
import 'package:second_display/models/orders.dart';
......@@ -137,14 +138,17 @@ class Api {
}
}
static Future<List<ConfigDisplay>> getConfigDisplay() async {
String apiUrl = apiUrlConfig;
List<ConfigDisplay> configList = [];
static Future<List<ConfigDisplay>> getConfigDisplay({url = ''}) async {
String apiUrl = url + apiUrlConfig;
try {
List<ConfigDisplay> configList = [];
Map data = {};
var bodi = jsonEncode(data);
var apiresults = await http.post(Uri.parse(apiUrl), body: bodi);
if (apiresults.statusCode != 200) {
navigatorKey.currentState?.pushNamed('/error');
}
var jsonObject = jsonDecode(apiresults.body);
List<dynamic> listConfig = (jsonObject as Map<dynamic, dynamic>)['data'];
......@@ -155,7 +159,8 @@ class Api {
return configList;
} catch (e) {
return [];
navigatorKey.currentState?.pushNamed('/error');
throw Exception("Error to connect API $e");
}
}
}
......@@ -5,13 +5,13 @@ import 'package:bloc/bloc.dart';
class ConfigDisplayBloc extends Cubit<List<ConfigDisplay>> {
ConfigDisplayBloc() : super([]);
Future<List<ConfigDisplay>> getData() async {
var orderDetail = await Api.getConfigDisplay();
Future<List<ConfigDisplay>> getData(String url) async {
var orderDetail = await Api.getConfigDisplay(url: url);
return orderDetail;
}
void getConfigDisplay() {
getData().then((value) {
void getConfigDisplay(String url) {
getData(url).then((value) {
emit(value);
});
}
......
import 'package:flutter/material.dart';
import 'package:second_display/main.dart';
import 'package:second_display/models/orders.dart';
// final Color textColor = Colors.white;
// final Color colorBackgroundOrder = Colors.black.withOpacity(0.8);
final String getOrdersUrl = "http://192.168.2.142:8001/midware/order/get_by_id";
final String apiUrlConfig =
"http://192.168.2.142:8001/queue/config_second_display";
final String getJsonUrl =
"http://192.168.2.142:8001/midware/order/get_for_second_display";
final String? baseUrls = prefs.getString('base_url');
final String urlDefault = '';
late String baseUrl = baseUrls ?? urlDefault;
final String getOrdersUrl = baseUrl + "midware/order/get_by_id";
final String apiUrlConfig = "queue/config_second_display";
final String getJsonUrl = baseUrl + "midware/order/get_for_second_display";
late CustomerOrders modelCustomerOrder = CustomerOrders(
id: "",
total: "",
......@@ -21,11 +22,5 @@ late CustomerOrders modelCustomerOrder = CustomerOrders(
dateOrder: "",
order_user_name: "");
final List<String> imgList = [
'https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80',
'https://images.unsplash.com/photo-1522205408450-add114ad53fe?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=368f45b0888aeb0b7b08e3a1084d3ede&auto=format&fit=crop&w=1950&q=80',
'https://images.unsplash.com/photo-1519125323398-675f0ddb6308?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=94a1e718d89ca60a6337a6008341ca50&auto=format&fit=crop&w=1950&q=80',
'https://images.unsplash.com/photo-1523205771623-e0faa4d2813d?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=89719a0d55dd05e2deae4120227e6efc&auto=format&fit=crop&w=1953&q=80',
'https://images.unsplash.com/photo-1508704019882-f9cf40e475b4?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=8c6e5e3aba713b17aa1fe71ab4f0ae5b&auto=format&fit=crop&w=1352&q=80',
'https://images.unsplash.com/photo-1519985176271-adb1088fa94c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a0c8d632e977f94e5d312d9893258f59&auto=format&fit=crop&w=1355&q=80'
];
final List<String>? imgLists = prefs.getStringList('imageList');
final List<String> imglist = imgLists!;
......@@ -3,12 +3,18 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:second_display/bloc/config_display_blog.dart';
import 'package:second_display/bloc/order_detail.dart';
import 'package:second_display/bloc/orders_bloc.dart';
import 'package:second_display/ui/error.dart';
import 'package:second_display/ui/input_base_url.dart';
import 'package:second_display/ui/main_page.dart';
import 'package:second_display/ui/splash.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_strategy/url_strategy.dart';
late SharedPreferences prefs;
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
void main() async {
WidgetsFlutterBinding.ensureInitialized();
prefs = await SharedPreferences.getInstance();
setPathUrlStrategy();
runApp(const MyApp());
}
......@@ -27,10 +33,13 @@ class MyApp extends StatelessWidget {
],
child: MaterialApp(
debugShowCheckedModeBanner: false,
navigatorKey: navigatorKey,
initialRoute: '/',
routes: {
'/': (context) => Splash(),
'/main': (context) => MainPage(),
'/error': (context) => ErrorPage(),
'/inputbase': (context) => const InputBaseUrl()
},
),
);
......
......@@ -3,12 +3,18 @@ class ConfigDisplay {
final String textColor;
final String backgroundColorOrder;
final String mediaType;
final String youtubeId;
final String videoPromotionUrl;
final String images;
ConfigDisplay(
{required this.backgroundColorCarouselVideo,
required this.textColor,
required this.backgroundColorOrder,
required this.mediaType});
required this.mediaType,
required this.youtubeId,
required this.videoPromotionUrl,
required this.images});
factory ConfigDisplay.createConfig(Map<String, dynamic> json) {
return ConfigDisplay(
......@@ -16,6 +22,9 @@ class ConfigDisplay {
json['background_color_carousel_video'].toString(),
textColor: json['text_color'].toString(),
backgroundColorOrder: json['background_color_order'],
mediaType: json['media_type']);
mediaType: json['media_type'],
youtubeId: json['youtube_id'],
videoPromotionUrl: json['video_promotion_url'],
images: json['images']);
}
}
......@@ -13,8 +13,7 @@ class CarouselIndicator extends StatefulWidget {
class _CarouselIndicatorState extends State<CarouselIndicator> {
int _current = 0;
final CarouselController _controller = CarouselController();
final List<Widget> imageSliders = imgList
final List<Widget> imageSliders = imglist
.map((item) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
......@@ -65,7 +64,7 @@ class _CarouselIndicatorState extends State<CarouselIndicator> {
items: imageSliders,
carouselController: _controller,
options: CarouselOptions(
autoPlay: true,
autoPlay: (imglist.length > 1) ? true : false,
autoPlayInterval: const Duration(seconds: 5),
enlargeCenterPage: true,
viewportFraction: 1.0,
......@@ -77,25 +76,29 @@ class _CarouselIndicatorState extends State<CarouselIndicator> {
}),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: imgList.asMap().entries.map((entry) {
return GestureDetector(
onTap: () => _controller.animateToPage(entry.key),
child: Container(
width: MediaQuery.of(context).size.width * 0.012,
height: MediaQuery.of(context).size.height * 0.012,
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.height * 0.008,
horizontal: MediaQuery.of(context).size.width * 0.0004,
),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white
.withOpacity(_current == entry.key ? 0.8 : 0.4))),
);
}).toList(),
),
(imgLists!.length > 1)
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: imglist.asMap().entries.map((entry) {
return GestureDetector(
onTap: () => _controller.animateToPage(entry.key),
child: Container(
width: MediaQuery.of(context).size.width * 0.012,
height: MediaQuery.of(context).size.height * 0.012,
margin: EdgeInsets.symmetric(
vertical:
MediaQuery.of(context).size.height * 0.008,
horizontal:
MediaQuery.of(context).size.width * 0.0004,
),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white.withOpacity(
_current == entry.key ? 0.8 : 0.4))),
);
}).toList(),
)
: const SizedBox(height: 0),
]),
),
);
......
import 'package:flutter/material.dart';
import 'package:second_display/helper/config.dart';
import 'package:second_display/main.dart';
class ErrorPage extends StatelessWidget {
ErrorPage({Key? key}) : super(key: key);
final String? baseUrls = prefs.getString('base_url');
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: MediaQuery.of(context).size.width * 0.2,
height: MediaQuery.of(context).size.width * 0.2,
child: const Image(
image: AssetImage("assets/images/error.png"),
fit: BoxFit.cover,
)),
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
),
Text(
"Error connect to server, Need to refresh and check the server",
style: TextStyle(
fontSize: MediaQuery.of(context).size.height * 0.03,
fontWeight: FontWeight.w500,
color: Colors.black,
decoration: TextDecoration.none),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Your Base Url: ",
style: TextStyle(
fontSize: MediaQuery.of(context).size.height * 0.02,
fontWeight: FontWeight.w500,
color: Colors.black,
decoration: TextDecoration.none),
),
Text(
baseUrls ?? urlDefault,
style: TextStyle(
fontSize: MediaQuery.of(context).size.height * 0.02,
fontWeight: FontWeight.w500,
color: Colors.red,
decoration: TextDecoration.none),
),
],
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton.icon(
onPressed: () {
Navigator.pushReplacementNamed(context, '/');
},
icon: const Icon(Icons.refresh_sharp),
label: const Text("Refresh")),
SizedBox(
width: MediaQuery.of(context).size.width * 0.01,
),
ElevatedButton.icon(
onPressed: () {
Navigator.pushReplacementNamed(context, '/inputbase');
},
icon: const Icon(Icons.input_outlined),
label: const Text("Input base Url"))
],
)
],
);
}
}
import 'package:flutter/material.dart';
import 'package:second_display/helper/config.dart';
import 'package:second_display/main.dart';
import 'package:second_display/ui/error.dart';
class InputBaseUrl extends StatefulWidget {
const InputBaseUrl({Key? key}) : super(key: key);
@override
State<InputBaseUrl> createState() => _InputBaseUrlState();
}
class _InputBaseUrlState extends State<InputBaseUrl> {
final _baseUrlController = TextEditingController();
late String urlBase;
@override
void initState() {
final String? _baseUrls = prefs.getString('baseUrl');
urlBase = _baseUrls ?? urlDefault;
_baseUrlController.text = urlBase;
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.5,
width: MediaQuery.of(context).size.width * 0.5,
// color: Colors.red,
child: Column(
children: [
TextField(
controller: _baseUrlController,
style: const TextStyle(color: Colors.black),
decoration: InputDecoration(
// border: InputBorder.none,
prefixIcon: const Icon(
Icons.attach_money_rounded,
color: Colors.white30,
),
hintText: urlBase,
hintStyle: TextStyle(color: Colors.black.withOpacity(0.8)),
),
),
const SizedBox(
height: 30,
),
ElevatedButton.icon(
onPressed: () async {
await prefs.setString('base_url', _baseUrlController.text);
final String? baseUrls = prefs.getString('base_url');
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => ErrorPage()));
},
icon: const Icon(Icons.check),
label: const Text("Input base Url"))
],
),
),
),
);
}
}
......@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:second_display/bloc/config_display_blog.dart';
import 'package:second_display/bloc/order_detail.dart';
import 'package:second_display/bloc/orders_bloc.dart';
import 'package:second_display/main.dart';
import 'package:second_display/models/config_display.dart';
import 'package:second_display/ui/carousel.dart';
import 'package:second_display/ui/orders.dart';
......@@ -16,56 +17,74 @@ class MainPage extends StatelessWidget {
Widget build(BuildContext context) {
context.read<OrdersBloc>().getOrderList();
context.read<OrderDetailBloc>().getOrderDetailList();
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(body: BlocBuilder<ConfigDisplayBloc, List<ConfigDisplay>>(
builder: (context, configState) {
int valueIntBackgroundColorCarouselVideo =
int.parse(configState[0].backgroundColorCarouselVideo, radix: 16);
final Color colorBackgroundCarouselandVideo =
Color(valueIntBackgroundColorCarouselVideo);
return SafeArea(
child: MaterialApp(
debugShowCheckedModeBanner: false,
home:
Scaffold(body: BlocBuilder<ConfigDisplayBloc, List<ConfigDisplay>>(
builder: (context, configState) {
if (configState.isEmpty) {
navigatorKey.currentState?.pushNamed('/error');
}
int valueIntBackgroundColorCarouselVideo = int.parse(
configState[0].backgroundColorCarouselVideo,
radix: 16);
final Color colorBackgroundCarouselandVideo =
Color(valueIntBackgroundColorCarouselVideo);
int valueIntTextColor =
int.parse(configState[0].textColor, radix: 16);
final Color textColor = Color(valueIntTextColor);
int valueIntTextColor =
int.parse(configState[0].textColor, radix: 16);
final Color textColor = Color(valueIntTextColor);
int valueIntBackgroundColorOrder =
int.parse(configState[0].backgroundColorOrder, radix: 16);
final Color backgroundColorOrder =
Color(valueIntBackgroundColorOrder);
int valueIntBackgroundColorOrder =
int.parse(configState[0].backgroundColorOrder, radix: 16);
final Color backgroundColorOrder =
Color(valueIntBackgroundColorOrder);
return Row(
children: [
(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(),
)
: (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,
width: MediaQuery.of(context).size.width * 0.4,
color: backgroundColorOrder,
child: OrderPage(textColor: textColor),
)
],
);
},
)),
List<String> images = [];
var imageString = configState[0].images.split(';');
for (int i = 0; i < imageString.length; i++) {
images.add(imageString[i].trim());
}
prefs.setStringList("imageList", images);
return Row(
children: [
(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(
videoUrl: configState[0].videoPromotionUrl),
)
: (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(
backgroundColor:
colorBackgroundCarouselandVideo,
youtubeId: configState[0].youtubeId),
),
Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width * 0.4,
color: backgroundColorOrder,
child: OrderPage(textColor: textColor),
)
],
);
},
)),
),
);
}
}
......@@ -45,7 +45,7 @@ class OrderPage extends StatelessWidget {
children: [
Container(
// color: Colors.red,
height: MediaQuery.of(context).size.height * 0.1,
height: MediaQuery.of(context).size.height * 0.08,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
......@@ -53,7 +53,7 @@ class OrderPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Kasir",
list.order_user_name,
style: TextStyle(
fontSize:
MediaQuery.of(context).size.height * 0.04,
......@@ -95,7 +95,7 @@ class OrderPage extends StatelessWidget {
itemCount: detailOrder.length,
itemBuilder: (context, i) {
var optionStr = detailOrder[i].optionOrder;
var OrderOptionDetail = optionStr.split(';');
var orderOptionDetail = optionStr.split(';');
var amountEachOrder =
double.tryParse(detailOrder[i].total) ?? 0;
var amountEachOrderText =
......@@ -138,7 +138,7 @@ class OrderPage extends StatelessWidget {
),
),
for (int i = 0;
i < OrderOptionDetail.length;
i < orderOptionDetail.length;
i++)
Container(
// color: Colors.green,
......@@ -159,7 +159,7 @@ class OrderPage extends StatelessWidget {
listOforderOption(
context,
Alignment.topLeft,
OrderOptionDetail[i].trim()),
orderOptionDetail[i].trim()),
listOforderOption(context,
Alignment.centerRight, '')
],
......
import 'dart:html';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:loading_animations/loading_animations.dart';
import 'package:second_display/api/api.dart';
import 'package:second_display/bloc/config_display_blog.dart';
import 'package:second_display/helper/config.dart';
import 'package:second_display/main.dart';
import 'package:second_display/models/config_display.dart';
import 'package:second_display/ui/main_page.dart';
class Splash extends StatefulWidget {
......@@ -11,32 +17,45 @@ class Splash extends StatefulWidget {
State<Splash> createState() => _SplashState();
}
class _SplashState extends State<Splash> {
// bool isLoaded = false;
// Future<List<ConfigApl>> config({url = ""}) async {
// // String? base_urlapi = prefs.getString('base_url');
// List<ConfigApl> apiConfigs = [];
// try {
// var apiConfig = await Api.getConfig(url: url);
// apiConfigs = apiConfig;
// return apiConfigs;
// } catch (e) {
// return apiConfigs;
// }
// }
Future<List<ConfigDisplay>> config(String url) async {
List<ConfigDisplay> apiConfigs = [];
try {
var apiConfig = await Api.getConfigDisplay(url: url);
apiConfigs = apiConfig;
return apiConfigs;
} catch (e) {
return apiConfigs;
}
}
class _SplashState extends State<Splash> {
@override
void initState() {
Future.delayed(const Duration(seconds: 2), () {
Navigator.push(context, MaterialPageRoute(builder: (_) => MainPage()));
String? base_urlapi = prefs.getString('base_url');
config(base_urlapi ?? urlDefault).then((value) async {
context
.read<ConfigDisplayBloc>()
.getConfigDisplay(base_urlapi ?? urlDefault);
await prefs.setString('background_color_carousel_video',
value[0].backgroundColorCarouselVideo);
await prefs.setString('text_color', value[0].textColor);
await prefs.setString(
'backgroundColorOrder', value[0].backgroundColorOrder);
await prefs.setString('mediaType', value[0].mediaType);
await prefs.setString('youtubeId', value[0].youtubeId);
await prefs.setString('videoPromotionUrl', value[0].videoPromotionUrl);
await prefs.setString('images', value[0].images);
Future.delayed(const Duration(seconds: 3), () {
Navigator.push(context, MaterialPageRoute(builder: (_) => MainPage()));
});
});
super.initState();
}
@override
Widget build(BuildContext context) {
context.read<ConfigDisplayBloc>().getConfigDisplay();
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
......
......@@ -3,7 +3,8 @@ import 'package:loading_animations/loading_animations.dart';
import 'package:video_player/video_player.dart';
class VideoPromotion extends StatefulWidget {
const VideoPromotion({Key? key}) : super(key: key);
final String videoUrl;
const VideoPromotion({Key? key, required this.videoUrl}) : super(key: key);
@override
State<VideoPromotion> createState() => _VideoPromotionState();
......@@ -13,8 +14,7 @@ class _VideoPromotionState extends State<VideoPromotion> {
VideoPlayerController? _controller;
@override
void initState() {
_controller = VideoPlayerController.network(
'https://media.istockphoto.com/videos/man-in-formal-suit-dancing-and-throwing-money-video-id892877794')
_controller = VideoPlayerController.network(widget.videoUrl)
..setLooping(true)
..initialize().then((_) {
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
......
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter/services.dart';
// import 'package:flutter_html/flutter_html.dart';
import 'package:youtube_player_iframe/youtube_player_iframe.dart';
class YoutubeVideo extends StatefulWidget {
const YoutubeVideo({Key? key}) : super(key: key);
final String youtubeId;
final Color backgroundColor;
const YoutubeVideo(
{Key? key, required this.youtubeId, required this.backgroundColor})
: super(key: key);
@override
State<YoutubeVideo> createState() => _YoutubeVideoState();
}
class _YoutubeVideoState extends State<YoutubeVideo> {
late YoutubePlayerController _controller;
@override
void initState() {
super.initState();
_controller = YoutubePlayerController(
initialVideoId: widget.youtubeId,
params: YoutubePlayerParams(
playlist: [
widget.youtubeId,
],
loop: true,
mute: true,
enableCaption: false,
startAt: const Duration(minutes: 0, seconds: 0),
showControls: false,
showFullscreenButton: false,
desktopMode: true,
privacyEnhanced: true,
useHybridComposition: true,
),
);
_controller.onEnterFullscreen = () {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
};
_controller.onExitFullscreen = () {};
}
@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>',
)),
);
// return Center(
// child: Container(
// color: widget.backgroundColor,
// child: Html(
// data:
// '<iframe width="$widthYoutbe" height="$heighYoutbe" src="https://www.youtube.com/embed/${widget.youtubeId}?rel=0&autoplay=1&mute=1&enablejsapi=1&controls=0&loop=1&playlist=${widget.youtubeId}&autohide=1&modestbranding=1" frameborder="0" clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
// ),
// ),
// );
return YoutubePlayerControllerProvider(
controller: _controller,
child: Container(
width: widthYoutbe,
height: heighYoutbe,
child: YoutubePlayerControllerProvider(
// Provides controller to all the widget below it.
controller: _controller,
child: const YoutubePlayerIFrame(
aspectRatio: 16 / 9,
),
),
));
}
}
......@@ -99,6 +99,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
flutter:
dependency: "direct main"
description: flutter
......@@ -118,6 +125,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
flutter_inappwebview:
dependency: transitive
description:
name: flutter_inappwebview
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.2"
flutter_layout_grid:
dependency: transitive
description:
......@@ -261,6 +275,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
petitparser:
dependency: transitive
description:
......@@ -268,6 +303,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
plugin_platform_interface:
dependency: transitive
description:
......@@ -275,6 +317,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
provider:
dependency: transitive
description:
......@@ -289,6 +338,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1+1"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
shared_preferences_ios:
dependency: transitive
description:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
sky_engine:
dependency: transitive
description: flutter
......@@ -350,6 +455,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
url_launcher:
dependency: transitive
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.20"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.15"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.15"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
url_strategy:
dependency: "direct main"
description:
......@@ -476,6 +637,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+1"
xml:
dependency: transitive
description:
......@@ -483,6 +651,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
youtube_player_iframe:
dependency: "direct main"
description:
name: youtube_player_iframe
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
sdks:
dart: ">=2.16.1 <3.0.0"
flutter: ">=2.8.0"
flutter: ">=2.10.0"
......@@ -36,8 +36,10 @@ dependencies:
http: ^0.13.4
intl: ^0.17.0
loading_animations: ^2.2.0
shared_preferences: ^2.0.13
url_strategy: ^0.2.0
video_player: ^2.3.0
youtube_player_iframe: ^2.2.2
dev_dependencies:
flutter_lints: ^1.0.0
......@@ -56,6 +58,7 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- assets/file.json
- assets/images/
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
......
......@@ -6,6 +6,9 @@
#include "generated_plugin_registrant.h"
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
......@@ -3,6 +3,7 @@
#
list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
)
set(PLUGIN_BUNDLED_LIBRARIES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment