FLUTTER CALCULATOR • 1 • UI

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 46

  • @createdbykoko
    @createdbykoko  ปีที่แล้ว

    🥷🏽 FOLLOW ME
    Patreon: www.patreon.com/mitchkoko/
    Instagram: instagram.com/createdbykoko/
    Twitter: twitter.com/createdbykoko/
    TikTok: www.tiktok.com/@createdbykoko/

  • @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 ปีที่แล้ว +3

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

    • @createdbykoko
      @createdbykoko  3 ปีที่แล้ว +1

      This is true :) thanks Fabian

  • @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

  • @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)

  • @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 :)

  • @ai-bloggers
    @ai-bloggers 2 ปีที่แล้ว

    you are the best!!!

  • @ahmedseddik2748
    @ahmedseddik2748 4 ปีที่แล้ว

    Your explanation is very beautiful and clear

  • @anasyunus3389
    @anasyunus3389 4 ปีที่แล้ว +1

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

    • @createdbykoko
      @createdbykoko  4 ปีที่แล้ว

      On vscode you can change the theme :)

  • @elextheplaner3172
    @elextheplaner3172 ปีที่แล้ว

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

  • @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,
      );
      },
      );

  • @Alt-wx6ry
    @Alt-wx6ry 4 ปีที่แล้ว +1

    Subscribed! Keep more coming :)

  • @mahmudizukri
    @mahmudizukri 4 ปีที่แล้ว

    keep it up bro

  • @letstry.coding_2816
    @letstry.coding_2816 4 ปีที่แล้ว +1

    Very Helpful

  • @harrydeora203
    @harrydeora203 4 ปีที่แล้ว

    Which software you are using for coding

    • @ibrahimbangkit
      @ibrahimbangkit 3 ปีที่แล้ว

      its called Visual Studio Code

  • @aadityajoshi260
    @aadityajoshi260 5 ปีที่แล้ว

    Awesome content man..
    Keep posting

  • @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 :)

  • @sanketpatel7924
    @sanketpatel7924 4 ปีที่แล้ว

    Cool bro

  • @santoshmaharana4020
    @santoshmaharana4020 3 ปีที่แล้ว

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

    • @wesleysilveira5692
      @wesleysilveira5692 ปีที่แล้ว +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)

  • @NikhilYadav-ru9vf
    @NikhilYadav-ru9vf ปีที่แล้ว

    3:13 borderRadius not working in my pc

  • @sanketpatel7924
    @sanketpatel7924 4 ปีที่แล้ว +2

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

  • @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

  • @sanketpatel7924
    @sanketpatel7924 4 ปีที่แล้ว

    We want more videos

  • @Kaizokn
    @Kaizokn 3 ปีที่แล้ว

    download code:?

    • @createdbykoko
      @createdbykoko  3 ปีที่แล้ว +1

      Hii its free on my github!

    • @Kaizokn
      @Kaizokn 3 ปีที่แล้ว

      @@createdbykoko link

  • @wesleysilveira5692
    @wesleysilveira5692 ปีที่แล้ว

    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 2 ปีที่แล้ว

    that's cool.🤍🤍