FLUTTER CALCULATOR • 1 • UI

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 46

  • @createdbykoko
    @createdbykoko  Рік тому

    🎓 Flutter Beginner Course • ua-cam.com/video/swiMBX4Vt94/v-deo.html
    📖 Flutter Beginner Handbook • mitchkoko.gumroad.com/l/FlutterBeginnerHandbook
    📱 Flutter App Templates • mitchkoko.app/
    📞 Flutter Consultation Call • mitchkoko.gumroad.com/l/CallWithMitch

  • @kahanx10
    @kahanx10 2 роки тому +5

    I loved your approach of coloring the buttons, here's what I followed:
    text color property (will become purple based on setColor's condition):
    var textColor = Colors.white;
    instance method of the custom button class:
    void setColor(String value) {
    if (buttonText == 'C') {
    buttonColor = Colors.green;
    } else if (buttonText == 'DEL') {
    buttonColor = Colors.red;
    } else if ('%/x-+='.split('').contains(buttonText)) {
    buttonColor = Colors.deepPurple;
    } else {
    buttonColor = Colors.white;
    textColor = Colors.deepPurple;
    }
    }
    builder method of the gridview:
    (context, index) {
    var button = MyButton( buttonText: buttons[index] );
    button.setColor(buttons[index]);
    return button;
    }

  • @fabianmuller335
    @fabianmuller335 3 роки тому +2

    At 10:36 you could use '%/*-+='.split('').contains(x)

  • @funnylamb2946
    @funnylamb2946 Рік тому +3

    Use required while declaring buttontext to avoid errors
    Required this.buttontext

  • @vishavjeetsharma5824
    @vishavjeetsharma5824 4 роки тому +2

    if any one is getting error ..... add this line in starting the video was cut when he add this line import 'package:calculator/buttons.dart'; (replace calculator with your project name)

  • @elextheplaner3172
    @elextheplaner3172 Рік тому

    itemCount: buttons.length, please idnt know why button is showing error.....please help me out

  • @thunderemperor7553
    @thunderemperor7553 4 роки тому +2

    Nice tutorial bro but I have one question. When you created List those all were strings but if I want to add different types in the same list is it possible to do so?
    For Example:
    List data = ['clear' , Icons.backspace, '9'];
    this results in type icon is not a sub type of string.
    I tried this also but can't get the result I wanted:
    List data = ['clear' , Icons.backspace, '9'];
    How to add integers, string, icon, and many more data types in the same list?

    • @createdbykoko
      @createdbykoko  3 роки тому +3

      For this just use the ‘var’ type. So instead of ‘List data’, you can do ‘var data’. Inside you can put any type :)

  • @khalidnasser
    @khalidnasser 4 роки тому +8

    I'm New in flutter this is my first week in it
    thank you so much
    i hope one day i'll be good as you
    and Keep posting M right with to to the end

  • @leonardoviana2404
    @leonardoviana2404 4 роки тому +1

    Awesome video!
    But how to keep the buttons responsive when rotating the screen?

    • @Ainigma
      @Ainigma 3 роки тому +3

      Great question. Flutter has you covered.
      From the original documentation (flutter.dev/docs/cookbook/design/orientation):
      OrientationBuilder(
      builder: (context, orientation) {
      return GridView.count(
      // Create a grid with 2 columns in portrait mode,
      // or 3 columns in landscape mode.
      crossAxisCount: orientation == Orientation.portrait ? 2 : 3,
      );
      },
      );

  • @anasyunus3389
    @anasyunus3389 4 роки тому +1

    im also using vs code but your formatting looks far better than mine......Did you add any plugins or what??

  • @NikhilYadav-ru9vf
    @NikhilYadav-ru9vf Рік тому

    3:13 borderRadius not working in my pc

  • @viper379
    @viper379 3 роки тому

    How do I add a voice command that will calculate what I say? Please make a viedo.

    • @createdbykoko
      @createdbykoko  3 роки тому +1

      Interesting! Voice recognition. I will give it a go :)

  • @santoshmaharana4020
    @santoshmaharana4020 3 роки тому

    bro, how can make one button big size of two-button 'ANS ' '=' by replacing it single ' = ' button?

    • @wesleysilveira5692
      @wesleysilveira5692 11 місяців тому +1

      make a gridview with all elements but the last row.
      in that last row you will use the widget Row and then you can personalize it (using three containers with different sizes which you can use the "flex" property to do it in the right ratio)

  • @harrydeora203
    @harrydeora203 4 роки тому

    Which software you are using for coding

  • @ahmedseddik2748
    @ahmedseddik2748 3 роки тому

    Your explanation is very beautiful and clear

  • @Alt-wx6ry
    @Alt-wx6ry 4 роки тому +1

    Subscribed! Keep more coming :)

  • @ai-bloggers
    @ai-bloggers 2 роки тому

    you are the best!!!

  • @sanketpatel7924
    @sanketpatel7924 4 роки тому

    We want more videos

  • @Joshua_Raj1122
    @Joshua_Raj1122 4 роки тому

    hey dude please help me. I am getting the error: The method 'MyButton' isn't defined for the type '_HomePageState'.
    what should i do

    • @createdbykoko
      @createdbykoko  4 роки тому +1

      Josh Gamerz that means you need to import the button.dart file. Click on the MyButton that has red underline on it, it should give you an option to import the file

    • @Joshua_Raj1122
      @Joshua_Raj1122 4 роки тому +1

      @@createdbykoko yes it works now..,...... Thank you very much bro.
      You helped me to build my first app.. Thank you very much

  • @aadityajoshi260
    @aadityajoshi260 4 роки тому

    Awesome content man..
    Keep posting

  • @mahmudizukri
    @mahmudizukri 4 роки тому

    keep it up bro

  • @Kaizokn
    @Kaizokn 3 роки тому

    download code:?

    • @createdbykoko
      @createdbykoko  3 роки тому +1

      Hii its free on my github!

    • @Kaizokn
      @Kaizokn 3 роки тому

      @@createdbykoko link

  • @sanketpatel7924
    @sanketpatel7924 4 роки тому

    Cool bro

  • @sanketpatel7924
    @sanketpatel7924 4 роки тому +2

    And i will share your channel also 😊
    I am guy who send messages in Instagram 😁

  • @letstry.coding_2816
    @letstry.coding_2816 4 роки тому +1

    Very Helpful

  • @wesleysilveira5692
    @wesleysilveira5692 11 місяців тому

    aboout the colors thing, i did the following:
    (isOperator function)
    dynamic isOperator(String x) {
    if ('!%+x/=-'.split("").contains(x)) {
    return [Colors.deepPurple, Colors.white];
    } else if (x == 'C') {
    return [Colors.green, Colors.white];
    } else if (x == 'DEL') {
    return [Colors.red, Colors.white];
    }
    // numbers
    return [Colors.white, Colors.deepPurple[500]];
    }
    (how i implemented:)
    return MyButton(
    buttonText: buttons[index],
    color: isOperator(buttons[index])[0],
    textColor: isOperator(buttons[index])[1]
    );

  • @razuahmed3493
    @razuahmed3493 Рік тому

    that's cool.🤍🤍