Skip to main content

Posts

Flutter: DraggableScrollableSheet widget Tutorial

Introduction In this tutorial, we are going to learn about the DraggableScrollableSheet widget. It is a widget that responds to user gestures. When the user drags from the bottom of the screen in the upward direction, the widget opens up and when scrolls down the widget close. The final app will look as follows  Final App DraggableScrollableSheet It is a widget that scrolls up and down of the viewport or screen according to the user's screen gestures. This widget becomes handy when you want to give some extra details which are lengthy content but don't want to navigate to a new screen. You might have come across many apps that implement the same thing. So let us learn to implement DraggableScrollableSheet in our own app. Approach The approach of our project is very simple. In our app, we are going to display some names of countries with the help of the  ListView.builder  and Li...

Flutter: TabView Widget Tutorial

Introduction In this tutorial, we are going to learn how to create Tabs in Flutter using the TabView widget. There are plenty of apps using Tabs and they provide a clean and compact design of the app. Table of Contents Project Setup Code Conclusion Project Setup We do not need and other plugins for this tutorial. Also, you can proceed with your own project or create a new project for this tutorial. Here is the Starting Code of the app. import 'package:flutter/material.dart' ; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @ override Widget build(BuildContext context) { return MaterialApp( title: 'TabView Tutorial All About Flutter' , theme: ThemeData( primarySwatch: Colors.yellow, ), home: HomePage(), ); } } class HomePage extends StatelessWidget { const HomePage({Key? key}) : super (key: key); @ override Widget build(BuildContext co...

Animated Navigation in Flutter

  Introduction By default, Flutter has no animation when navigating from one Screen to another Screen. But in this tutorial, we are going to learn how to animate the Screen Transition.   Introduction By default, Flutter has no animation when navigating from one Screen to another Screen. But in this tutorial, we are going to learn how to animate the Screen Transition. Table of Contents Project Setup Code Result Project Setup Before directly applying to your existing project, practice the code in some example projects. For this tutorial, we are going to name our project screen_animation_tutorial. Open in VSCode or Android Studio. After that, we will make two Screens. The first Screen will be the Starting screen and the next Screen will be the Final Screen. So go ahead and create two dart files under the lib folder. The main.dart file code should look like this Dart import 'package:flutter/material.dart'; import 'package:screen_animation_tutorial/start_screen.dart'; void ...

PageView in Flutter | Everything about PageView in Flutter

 Introduction PageView is one of the best widgets in Flutter. You can make your screen swipeable and in this tutorial, we are going to learn PageView . Table of Contents Project Setup Code Design Extra features Result Project Setup We don't need any package to install for this tutorial. Also this tutorial we are going to use Containers in our PageView for simplicity. So create a new Flutter project and come to the body field of the Scaffold widget. Make sure to delete the rest of the sample code provided. Also, remove the FloatingActionButton widget. We do not need it for our tutorial. Inside the body field of Scaffold , use the PageView widget and declare the children field here. The code should be like below. If cannot delete the code properly copy and paste the code below in main.dart file. import 'package:flutter/material.dart' ; void main() { runApp(MyApp()); } class MyApp extends Statele...

Card View and ListView of Cards using Flutter and Dart. Easy tutorial for Beginners.

Cards are material panel with slightly round corners. The cards make simple apps looks good and easy to use interface. Many apps you come daily across use here and their cards. And with the Flutter framework, we can easily make beautiful cards with absolutely no other dependencies. We will also cover cards in a list in this tutorial. Contents Project setup Code Design Result Project Setup It would be recommended to create a new project and follow this tutorial and later implement it in your own project. But you can also use your own project.  So use your own project or create a new project in Android Studio or Visual Studio Code and name it list_cards or you can use Command Prompt / Terminal to create a new project. flutter create list_card Code Create a new file under the lib folder to keep our code separate and name it list_cards_screen.dart. After that make a stateful class in the file and name it simply ...