Flutter Clip Path Tutorial | Custom Shape | Design Challenge 2023

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 73

  • @ThePilli41
    @ThePilli41 Год назад +6

    the king is back!

  • @vuongqtvn
    @vuongqtvn Год назад +4

    Thank you for the very detailed tutorial, I'm looking forward to your flutter ecommece product

    • @CodingwithT
      @CodingwithT  Год назад +1

      I'm glad it was helpful ☺️

  • @mohamedalhamri9714
    @mohamedalhamri9714 4 месяца назад +1

    These are of the best flutter tutorials if not the best. Thank you brother

  • @legardemontcho6739
    @legardemontcho6739 Месяц назад

    Great session Againt ! But one suggestion: Flutter's ClipOval widget should be used for TCiruclarContainer to avoid the radius, padding and decorations params. You can even have just a size and a color if the circle is never oval. Here's the code:
    class TClipOval extends StatelessWidget {
    final double size;
    final Widget? child;
    final Color backgroundColor;
    const TClipOval({
    this.size = 400,
    this.child,
    this.backgroundColor = Colors.white,
    super.key,
    });
    @override
    Widget build(BuildContext context) {
    return ClipOval(
    child: Container(
    height: size,
    width: size,
    color: backgroundColor,
    child: child,
    ),
    );
    }
    }

  • @zakariaelaaliji7747
    @zakariaelaaliji7747 5 месяцев назад +1

    please I want to create a logo for my application so I can use it in the splash screen, any recommandations ?

  • @scottfarestrand2364
    @scottfarestrand2364 6 месяцев назад +1

    I am wondering if there is another option to get the curves. Could we use a stack to have a container (the blue one) followed by another container that has the curves and position it overlaying the bottom 20 pixels of the first container?

    • @Senior302
      @Senior302 29 дней назад

      import 'package:best_uis/utils/constants/colors.dart';
      import 'package:best_uis/utils/constants/helper_functions.dart';
      import 'package:flutter/material.dart';
      class Home extends StatelessWidget {
      const Home({super.key});
      @override
      Widget build(BuildContext context) {
      return Scaffold(
      body: Stack(
      children: [
      Container(
      color: AppColors.primary,
      ),
      Positioned(
      top: 50,
      left: HelperFunctions.screenWidth(context) * .95,
      child: CustomPaint(
      painter: CircledShape(),
      )),
      Positioned(
      top: 300,
      left: HelperFunctions.screenWidth(context) * .999,
      child: CustomPaint(
      painter: CircledShape(),
      )),
      Positioned(
      left: 1,
      top: HelperFunctions.screenHeight(context) * .5,
      child: Container(
      height: HelperFunctions.screenHeight(context) * .5,
      width: HelperFunctions.screenHeight(context) * .5,
      decoration: BoxDecoration(
      color: AppColors.white,
      borderRadius: BorderRadius.only(
      topLeft: Radius.circular(20),
      topRight: Radius.circular(20),
      )),
      ),
      ),
      ],
      ),
      );
      }
      }
      class CircledShape extends CustomPainter {
      @override
      void paint(Canvas canvas, Size size) {
      canvas.drawCircle(
      Offset(25, 25),
      170,
      Paint()
      ..color = AppColors.white.withOpacity(.1)
      ..style = PaintingStyle.fill);
      }
      @override
      bool shouldRepaint(covariant CustomPainter oldDelegate) {
      return false;
      }
      }

  • @gridzzle
    @gridzzle Год назад +3

    why u removed the sizedbox with 400 height inside primaryheadercontainer after u extracted it ? and how come we still can see the shapes after you removed it ? after i removed the sizedbox, nothing is showing , only full white background.... thanks in advance

    • @gridzzle
      @gridzzle Год назад +2

      i can see in the next video you inserted the sizedbox back, sorry for the misunderstanding

    • @ryansumbele3552
      @ryansumbele3552 10 месяцев назад +1

      please how did you solve this problem i am facing thesame issue

    • @gridzzle
      @gridzzle 10 месяцев назад

      insert the sizedbox again @@ryansumbele3552

  • @kyungsooswifeu8240
    @kyungsooswifeu8240 8 месяцев назад

    Definitely a savior! Thanks a lot!

    • @CodingwithT
      @CodingwithT  8 месяцев назад +1

      Glad it's helpful 😁

  • @kyungsooswifeu8240
    @kyungsooswifeu8240 5 месяцев назад

    The other widgets placed after this curve are not positioned directly after it there's some extra space on top.
    I have no extra padding added in any widget is there a way to display them directly in the top of the white space ? Thank you.

  • @kb047_ff7
    @kb047_ff7 4 месяца назад +1

    you could have easily achieved thiss using stack and then positioned or alignment widget which child is white container theh have given border radius.only at top left and top right ie.ciruclar

  • @MohamedIslamDJOUABLIA
    @MohamedIslamDJOUABLIA 3 месяца назад +1

    AMAZING , but i should try to understand the clippath widget better , thanks

    • @CodingwithT
      @CodingwithT  3 месяца назад +1

      You're welcome! Understanding the ClipPath widget can really enhance your designs.

  • @pjagannadham2540
    @pjagannadham2540 Год назад +2

    Which state management you are using

  • @FelipeCampelo0
    @FelipeCampelo0 8 месяцев назад +1

    this is a whole calculus class 😃

  • @aswinsubhash7581
    @aswinsubhash7581 10 месяцев назад

    I have a doubt , when we are navigating the getx controllers are not getting disposed, all controllers are in intialized state , so is it a good thing? because getx advantage is there route system, it will dispose the controllers automatically

  • @LotOFfactories
    @LotOFfactories 4 месяца назад

    I learnt 50% of knowledge from this video and I being learning flutter for 2 years..

    • @CodingwithT
      @CodingwithT  4 месяца назад

      That’s huge buddy.
      I am really glad you like this and it’s helpful.

  • @zumbarto
    @zumbarto 2 месяца назад

    Why not stack with containers? The container on the top will have borderRadius and it will have the same result. Am I missing something?

    • @CodingwithT
      @CodingwithT  2 месяца назад

      Using a CustomClipper allows for more complex shapes and precise control compared to Container with borderRadius. For intricate designs like this, CustomClipper is the better choice.

  • @mr.saurabhpatil
    @mr.saurabhpatil Год назад

    Although I have purchased a kit... I'm still waiting for your videos... Please upload every part as fast as you can... Please....

  • @flutterIgnite
    @flutterIgnite 7 месяцев назад

    Master T as always . awesome

    • @CodingwithT
      @CodingwithT  7 месяцев назад

      Thank you so much for your appreciation! Keep up the great work!

  • @MyDreams007
    @MyDreams007 11 месяцев назад

    Merci. Le code est bon mais rien ne s'affiche sur mon emulateur. C'est seulement la bottom navigation bar qui apparaît. Pouvez vous m'aider svp ?

  • @SpaceXplorer_2024
    @SpaceXplorer_2024 9 месяцев назад +1

    How to solve this problem
    Failed assertion: line 599 pos 12: 'size.isFinite': is not true.

  • @elncart
    @elncart Год назад

    very nice. can you explain riverpod with one small project.

    • @CodingwithT
      @CodingwithT  Год назад

      Yes sure, I will try to make a playlist on that along with other State Managements 💕

  • @muhendis_
    @muhendis_ 3 месяца назад

    I should learn more about ClipPath

    • @CodingwithT
      @CodingwithT  3 месяца назад

      Learning more about ClipPath can really enhance your design skills! 🎨 It's a powerful widget for creating custom clip shapes in Flutter.

  • @noumankarim92
    @noumankarim92 Год назад +1

    Very nice and informative... thanks

  • @ishuraa-b
    @ishuraa-b 2 месяца назад

    Why did you take 0 as the offset x of second first curve?

    • @CodingwithT
      @CodingwithT  2 месяца назад

      The 0 offset for the secondFirstCurve is used to maintain the horizontal alignment for the second curve along the x-axis. Since the second curve is intended to start from the same vertical level as the first one, the x-coordinate remains at 0, ensuring that the curve is positioned correctly without any horizontal shift.

    • @ishuraa-b
      @ishuraa-b 2 месяца назад

      @@CodingwithT but if i replace 0 with 100 in the code, then also I amgetting the same result

  • @dhalle
    @dhalle Год назад +1

    Its amazing tutorial and understandably sir but i want to tell you and requested you to make your editor to zoom because its var away to see nicely plz zoom sir 🎉

    • @CodingwithT
      @CodingwithT  Год назад +1

      I tried to zoom but in upcoming videos I'll increase the zoom.
      Thankyou 💖

    • @dhalle
      @dhalle Год назад

      @CodingwithT Sir Thankfully 💥🙏🤩

  • @berkantyurtsever41
    @berkantyurtsever41 7 месяцев назад

    Hello friend, I did everything as it is. However, when I put the container position in the stack, I cannot see the container. If you have email I can show you the code and what it looks like.

    • @CodingwithT
      @CodingwithT  7 месяцев назад

      Hi,
      You have to use positioned widget while using stack.
      api.flutter.dev/flutter/widgets/Positioned-class.html

  • @dextrogaming369
    @dextrogaming369 Месяц назад

    Pls solve the problem
    size.isFinite : is not true

  • @ANKURTIWARY-l2y
    @ANKURTIWARY-l2y 10 месяцев назад

    what extension did u used to get the small box of colors near the line number, can you tell

    • @CodingwithT
      @CodingwithT  10 месяцев назад

      Which one?

    • @ANKURTIWARY-l2y
      @ANKURTIWARY-l2y 9 месяцев назад

      when u are using a color in the code, u r getting a small box near the line number which shows which color is used , how do u get that?
      @@CodingwithT

  • @adamilham_
    @adamilham_ 9 месяцев назад

    Sir, in primary_header_container.dart, can you tell me the code for background custom shape? I can't see the code because of the emulator

  • @takundachamaona
    @takundachamaona Месяц назад

    i finished the whole video till end and when i was done nothing is popping up on my home screen, please help

    • @CodingwithT
      @CodingwithT  Месяц назад

      Make sure to add child property in your widget

  • @AmiringPRO
    @AmiringPRO 8 месяцев назад +1

    class HomeScreen extends StatelessWidget {
    const HomeScreen({super.key});
    @override
    Widget build(BuildContext context) {
    return Scaffold(
    body: SingleChildScrollView(
    child: Column(
    children: [
    TPrimaryHeaderContainer(
    child: Container(),
    ),
    ],
    ),
    )
    );
    }
    }
    it is not working it doesn't show me a custom shape help me please?

    • @fanocs
      @fanocs 3 месяца назад

      Give the container a height property of 400.

  • @activegoogle4501
    @activegoogle4501 5 месяцев назад

    😊

  • @aouadicharaf1038
    @aouadicharaf1038 11 месяцев назад

    ❤❤❤

  • @manishmg3994
    @manishmg3994 Год назад +2

    if possible make source code free

    • @goodview360
      @goodview360 Год назад

      He needs the support to keep giving us current tutorials, lets support

  • @JalalTech-i2g
    @JalalTech-i2g 11 месяцев назад

    Source code please 🥺😢

    • @CodingwithT
      @CodingwithT  11 месяцев назад

      Link to download source code is available in the description 🎉

  • @hunterxx6744
    @hunterxx6744 5 месяцев назад

    Like for you salam

    • @CodingwithT
      @CodingwithT  5 месяцев назад

      W.Salam Thank you for your support.

  • @abdelouahebbenouar6157
    @abdelouahebbenouar6157 3 месяца назад

    I understand that you want to keep a clean code , but factoring everything to a custom widget became annoying, it's not clean code anymore and trying to find a specific widget in a pile of widgets is kinda annoying, i like your videos , but i hope you change this part

  • @FelipeCampelo0
    @FelipeCampelo0 8 месяцев назад

    I made a Path Element class so we can name properly the edges and the horizontal line:
    class PathElement {
    PathElement(this.curveBeginning, this.curveEnding, this.path);
    final Offset curveBeginning;
    final Offset curveEnding;
    final Path path;
    void quadraticBezierTo() {
    path.quadraticBezierTo(
    curveBeginning.dx,
    curveBeginning.dy,
    curveEnding.dx,
    curveEnding.dy,
    );
    }
    }
    FULL: curved_edges.dart
    import 'package:flutter/material.dart';
    class TCustomCurvedEdges extends CustomClipper {
    @override
    Path getClip(Size size) {
    var path = Path();
    path.lineTo(0, size.height);
    PathElement firstEdge = PathElement(
    Offset(0, size.height - 20),
    Offset(30, size.height - 20),
    path,
    );
    firstEdge.quadraticBezierTo();
    PathElement horizontalLine = PathElement(
    Offset(0, size.height - 20),
    Offset(size.width - 30, size.height - 20),
    path,
    );
    horizontalLine.quadraticBezierTo();
    PathElement lastEdge = PathElement(
    Offset(size.width, size.height - 20),
    Offset(size.width, size.height),
    path,
    );
    lastEdge.quadraticBezierTo();
    path.lineTo(size.width, 0);
    path.close();
    return path;
    }
    @override
    bool shouldReclip(covariant CustomClipper oldClipper) {
    return true;
    }
    }
    class PathElement {
    PathElement(this.curveBeginning, this.curveEnding, this.path);
    final Offset curveBeginning;
    final Offset curveEnding;
    final Path path;
    void quadraticBezierTo() {
    path.quadraticBezierTo(
    curveBeginning.dx,
    curveBeginning.dy,
    curveEnding.dx,
    curveEnding.dy,
    );
    }
    }