This file contains hidden or 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
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(); |
This file contains hidden or 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
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( |
This file contains hidden or 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
class PhotosModel { | |
String url; | |
String photographer; | |
String photographerUrl; | |
int photographerId; | |
SrcModel src; | |
PhotosModel( | |
{this.url, | |
this.photographer, |
This file contains hidden or 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
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( |
This file contains hidden or 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
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( |
This file contains hidden or 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
class HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
This file contains hidden or 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
singUp() async { | |
if(formKey.currentState.validate()){ | |
setState(() { | |
isLoading = true; | |
}); | |
await authService.signUpWithEmailAndPassword(emailEditingController.text, | |
passwordEditingController.text).then((result){ |
This file contains hidden or 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
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) { |
This file contains hidden or 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
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))); | |
} |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
class SignIn extends StatefulWidget { | |
@override | |
_SignInState createState() => _SignInState(); | |
} | |
class _SignInState extends State<SignIn> { | |