Skip to content

Instantly share code, notes, and snippets.

View haidar786's full-sized avatar
🏠
Working from home

Hussnain Haidar haidar786

🏠
Working from home
View GitHub Profile
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:youtube_explode_dart/youtube_explode_dart.dart' as yt;
class VideoPlayerPage extends StatelessWidget {
VideoPlayerPage({this.videoId, this.videoName});
final String videoId;
final String videoName;
@override
{
"id": 1,
"name": "Smith",
"color": "Green",
"pets": [
{
"id": 1,
"breed": "Rottweiler",
"name": "Mackie",
"age": 8
{
"id": 1,
"breed": "Rottweiler",
"name": "Mackie",
"age": 8
}
class Dog {
int id;
String breed;
import 'dart:io';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:image_crop_widget/image_crop_widget.dart';
class FinalImagePage extends StatefulWidget {
final File image;
FinalImagePage(this.image);
@override
import 'package:flutter/material.dart';
import 'package:torch/torch.dart';
class SwithS extends StatefulWidget{
@override
State<StatefulWidget> createState() {
return SwitchWidgetClass();
}
}
import 'dart:convert';
import 'package:flutter/material.dart';
class ListItem extends StatelessWidget {
final posts = News.fromJson({"status":"ok","posts": [{ "title":"Barcelona 0-0 Real Madrid: Bale goal disallowed in tense Clasico","content": "Gareth Bale saw a goal disallowed as Barcelona and Real Madrid played out a 0-0 draw at Camp Nou on Wednesday. LaLiga's top two went into the contest level on points this season and with 72 wins each from previous league meetings, and there was nothing to separate them in a tense clash in Catalonia. The match was rearranged from October after the initial date became a security risk due to the prospect of Catalan independence protests, and there were fans inside and outside the stadium making their voices heard over one of Spain's most divisive issues.", "date": "2019-12-21 11:27:25","thumbnail_image": {"medium_large": { "url": "https://www.livescore.com/newsapi/04/soccer/imageret/barcelona-real-madrid-gareth-bale-goal-disallowed-tense-clasico-7-1cgsl7i
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return MyAppState();
}
}
enum Options { referrals, stats, editProfile }
Future<List<VideoModel>> _getVideosFromStorage() async {
if (_videoModel == null) {
List<VideoModel> videoModel = [];
List<String> directories = [];
List<FileSystemEntity> files = [];
Directory directory = Directory('/storage/emulated/0/');
List<FileSystemEntity> allFiles =
directory.listSync(recursive: true, followLinks: false);
allFiles.forEach((file) {
if (file.path.endsWith('.mp4')) {
import 'package:flutter/material.dart';
class DropDownFormField extends FormField<dynamic> {
final String titleText;
final String hintText;
final bool required;
final String errorText;
final dynamic value;
final List dataSource;
final String textField;