diff --git a/README.md b/README.md index 69de941..fe1d5f9 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ Building a WhatsApp Clone in Flutter. > If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of :coffee: > > * [PayPal](https://www.paypal.me/imthepk/) - +yutyutyu # License - +###### Copyright 2018 Pawan Kumar Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/lib/HomePage.dart b/lib/HomePage.dart new file mode 100644 index 0000000..c85b475 --- /dev/null +++ b/lib/HomePage.dart @@ -0,0 +1,208 @@ +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +const bottomcontainerheight = 80.0; +const activecardcolour = Color(0xFF0F432D); +const inactivecardcolour = Color(0xFF0F332D); +const bottomcontainercolour = Color(0xFFEB155); + +enum Gender { + male, + female, +} + +class MyHomePage extends StatefulWidget { + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + Gender selectedGender = Gender.male; + int hight = 180; + // Color maelcardcolour=inactivecardcolour; + // Color femaleardcolour=inactivecardcolour; + // void updatecolour(Gender selectedgender ){ + // if (selectedgender==Gender.male){ + // if(maelcardcolour==inactivecardcolour){ + // maelcardcolour=activecardcolour; + // femaleardcolour=inactivecardcolour; + // } + // else{ + // maelcardcolour==inactivecardcolour; + // } + // } + // else if(selectedgender==Gender.female){ + // if(femaleardcolour==inactivecardcolour){ + // femaleardcolour=activecardcolour; + // maelcardcolour=inactivecardcolour; + // } + // else{ + // femaleardcolour=inactivecardcolour; + // } + // + // } + // } + @override + Widget build(BuildContext context) { + return SafeArea( + child: Scaffold( + appBar: AppBar(backgroundColor: const Color(0xFF0F132D)), + body: Column(children: [ + Expanded( + child: Row(children: [ + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + selectedGender = Gender.male; + print("object"); + // Colors.blueAccent; + }); + }, + child: Reusable( + colour: selectedGender == Gender.male + ? activecardcolour + : inactivecardcolour, + Cardchild: + Re1(icon: FontAwesomeIcons.mars, lable: 'Male'), + ), + ), + ), + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + selectedGender = Gender.female; + }, + ); + }, + child: Reusable( + colour: selectedGender == Gender.female + ? activecardcolour + : inactivecardcolour, + Cardchild: + Re1(icon: FontAwesomeIcons.venus, lable: 'famel'), + ), + ), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Container( + // padding: const EdgeInsets.only(top: 10,left: 125), + child: Text( + "$hight", + style: TextStyle( + // color: Color(0xFFDCBC3C), + fontSize: 49, + ), + ), + ), + Text("cm") + ], + ), + // SliderTheme( + // data: SliderTheme.of(context).copyWith( + // activeTrackColor: Colors.white, + // thumbColor: Color(0xFFEB1555), + // overlayColor: Color(0x29EB15550), + // thumbShape: RoundSliderThumbShape( + // enabledThumbRadius: 15.0), + // overlayShape: RoundSliderOverlayShape( + // overlayRadius: 30.0), + // ), + Slider( + value: hight.toDouble(), + min: 120, + max: 220, + onChanged: (double newValue) { + setState(() { + hight = newValue.round(); + }); + }, + ), + + Expanded( + child: Row( + children: [ + Expanded( + child: Reusable( + colour: const Color(0xFF0F132D), + Cardchild: Re1( + icon: FontAwesomeIcons.mars, + lable: 'Male'), + ), + ), + Expanded( + child: Reusable( + colour: const Color(0xFF0F132D), + Cardchild: Re1( + icon: FontAwesomeIcons.mars, + lable: 'Male'), + ), + ), + ], + )) + ])), + // ) + + + + ); + } +} + +class Re1 extends StatelessWidget { + Re1({required this.icon, required this.lable}); + final IconData icon; + final String lable; + + @override + Widget build(BuildContext context) { + return Expanded( + child: Reusable( + colour: Color(0xFF0F232D), + Cardchild: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + icon, + size: 60, + color: const Color(0xFFDCBC3C), + ), + const SizedBox( + height: 15.0, + ), + Text( + lable, + style: const TextStyle(fontSize: 18.0, color: Color(0xFFDCBC3C)), + ) + ], + ), + ), + ); + } +} + +class Reusable extends StatelessWidget { + Reusable({required this.colour, required this.Cardchild}); + final Color colour; + final Widget Cardchild; + + @override + Widget build(BuildContext context) { + return Container( + child: Cardchild, + margin: const EdgeInsets.all(15.0), + decoration: BoxDecoration( + color: colour, borderRadius: BorderRadius.circular(10.0)), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 5656045..869d9b9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; import 'package:flutterwhatsapp/whatsapp_home.dart'; - +// import 'package:flutterwhatsapp/whatsapp_home.dart'; List cameras; Future main() async { diff --git a/pubspec.yaml b/pubspec.yaml index f8cfe2a..2bad893 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,12 +62,12 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic + fonts: + - family: Schyler + fonts: + - asset: fonts/Schyler-Regular.ttf + - asset: fonts/Schyler-Italic.ttf + style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf