We will create a custom button which will take string, icon, onPress event and fontSize. But our will have default values for string, icon, onPress event and fontSize.
Month: November 2022
Flutter Custom Divider
Let’s learn how to make a custom divider using Flex, List.generate() and LayoutBuilder() in flutter. We will wrap everything inside LayoutBuilder() and it has builder property. Inside LayoutBuilder‘s builder property we will return Flex and inside Flex we will return List.generate(). We will create a class named CustomDivider() and it will named optional parameters. The…
Flutter Create TextStyle Class with Roboto Font
We will create class for Roboto font family. Just simple create a dart class name styles.dart and save the below code. Each of the TextStyle class returns an TextStyle object. So for Text() widget style you can call any of them based on your needs. If you wanna style your text like The above line…
Flutter Responsive Helper Class
Let’s learn how to create a responsive helper class, in flutter dart. Here we will focus on how to detect Mobile, Desktop or Tablet. In this class, we will create some basic functions and these functions should have access to a context. And based on the context we will if we are on Mobile, Desktop…
Flutter Getx Route Management
If you use Getx for routing, it becomes much easier to manage routing. Just create a new dart class and name it RouteHelper.dart This class will contain a routes list of List<GetPage> type. The variable would be static type. Let’s see the class The above RouteHelper class static properties and methods. You may call both…
Flutter CustomClipper | getClip
Flutter CustomClipper is a great class drawing custom shape or clipping the shape of a widget. Here, we will see how to clip the shape of a star and give it different color. Your own class should extend CustomClipper class. CustomClipper class is used by number widgets. So we may also use it in our…
Flutter ScaffoldMessenger, showSnackBar and snackBar
Here we will use ScaffoldMessenger, showSnackBar and snackBar together to show a message on button press from the bottom. Flutter ScaffoldMassenger is works for like showing pop up message. ScaffoldMassenger shows, hide and remove snackBar. The MaterialApp widget provides a root ScaffoldMessenger. If you show a SnackBar using the root ScaffoldMessenger, it becomes possible for all descendant Scaffolds to receive the SnackBar. However,…
Flutter Custom Date Converter
Learn about creating a date converter class in flutter. You may use this convert string to date and to different format. It supports below features formatDate dateToDateAndTime dateTimeStringToDateTime dateTimeStringToDate estimatedDate convertStringToDatetime isoStringToLocalDate isoStringToDateTimeString stringToLocalDateOnly localDateToIsoString convertStringToDatetime
Flutter Rating Widget | Star Rating Bar
Let’s learn how to create a star rating widget in flutter. This widget would be responsible to creating stars on the UI. It should be fed the data from the backend. But for now we will use hard coded value. RatingBar class, checks for whether the number of stars are integer or with floating point…
Flutter Not Found Animated Page | TweenAnimationBuilder | Text Animation
Let’s how do we use TweenAnimationBuilder to create not found page with animation. This is actually a text animation. We will do animation to make font bigger. The properties like curve, tween and duration plays an important role about the animation. The property tween value begin and end tell you where to start from and…