Skip to content

Instantly share code, notes, and snippets.

View theindianappguy's full-sized avatar
:octocat:
Working...

Sanskar Tiwari theindianappguy

:octocat:
Working...
View GitHub Profile
getTrendingWallpaper() async {
await http.get(
"https://api.pexels.com/v1/curated?per_page=$noOfImageToLoad&page=1",
headers: {"Authorization": apiKEY}).then((value) {
//print(value.body);
Map<String, dynamic> jsonData = jsonDecode(value.body);
jsonData["photos"].forEach((element) {
//print(element);
PhotosModel photosModel = new PhotosModel();
class CategoriesTile extends StatelessWidget {
final String imgUrls, categorie;
CategoriesTile({@required this.imgUrls, @required this.categorie});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.push(
class PhotosModel {
String url;
String photographer;
String photographerUrl;
int photographerId;
SrcModel src;
PhotosModel(
{this.url,
this.photographer,
Container(
height: 80,
child: ListView.builder(
padding: EdgeInsets.symmetric(horizontal: 24),
itemCount: categories.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
/// Create List Item tile
return CategoriesTile(
@theindianappguy
theindianappguy / search_bar_wallapaper_app_fluter.dart
Created May 18, 2020 08:58
Search Bar for Wallpaper App FLutter by Sanskar Tiwari (theindianappguy)
Container(
decoration: BoxDecoration(
color: Color(0xfff5f8fd),
borderRadius: BorderRadius.circular(30),
),
margin: EdgeInsets.symmetric(horizontal: 24),
padding: EdgeInsets.symmetric(horizontal: 24),
child: Row(
children: <Widget>[
Expanded(
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
@theindianappguy
theindianappguy / signup_function_in_signup.dart
Last active December 11, 2020 15:12
Signup function in signup.dart Chat App with Flutter and Firebase
singUp() async {
if(formKey.currentState.validate()){
setState(() {
isLoading = true;
});
await authService.signUpWithEmailAndPassword(emailEditingController.text,
passwordEditingController.text).then((result){
@theindianappguy
theindianappguy / auth_chat_app.dart
Created May 12, 2020 07:45
auth.dart file for Chat App Tutorial
import 'package:chatapp/models/user.dart';
import 'package:chatapp/views/chat.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
class AuthService {
final FirebaseAuth _auth = FirebaseAuth.instance;
User _userFromFirebaseUser(FirebaseUser user) {
@theindianappguy
theindianappguy / widgets.dart
Created May 12, 2020 06:13
InputDecoration textFieldInputDecoration for Flutter Chat App
InputDecoration textFieldInputDecoration(String hintText) {
return InputDecoration(
hintText: hintText,
hintStyle: TextStyle(color: Colors.white54),
focusedBorder:
UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)),
enabledBorder:
UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)));
}
@theindianappguy
theindianappguy / signin.dart
Created May 12, 2020 06:06
SignIn Screen UI for ChatApp
import 'package:flutter/material.dart';
class SignIn extends StatefulWidget {
@override
_SignInState createState() => _SignInState();
}
class _SignInState extends State<SignIn> {