How to turn on Flutter Dark Mode feature using themeData. Today we will learn how to use Flutter ThemeData. It will help us to turn on Dark mode and light mode and also a system-based mode that is based on devices on flutter apps. Here is how to do that.

flutter dark mode
Flutter Dark Mode

Inside MaterialApp() we will use ThemeData and set dark or light mode.

return MaterialApp(
theme: ThemeData(
brightness: Brightness.light,
),
darkTheme: ThemeData(
brightness: Brightness.dark,
),
themeMode: ThemeMode.system,
home: HomePage(),
);

Here on this code,

theme data brightness light is normal and when we add darkTheme brightness dark then the total flutter app turns into the dark theme.

But if you want to use dark or light depending on System mode then we have to add themeMode to the system.

That's it for today it's so easy and simple.

--

--

Flutter Sqflite tutorial for begineer.

First of all open your project and install sqflite.

flutter pub add sqflite

now add,

flutter pub add path_provider

now go and open pub yaml file and check if everthing is added correctly.

Now I’m creating a Grocery class,

--

--

Hello developers, today we will learn crud operation with Mongodb.

First of all open a folder with Visual Studio Code and open terminal write command,

npm init

complete everything just pressing enter button, I added author option with my name you can do it too and continue pressing enter button, it will ask (yes) then again press enter. You can see package.json has been created.

We need to install express and mongo db so now you should add this command,

npm install express mongodb

to run server using nodemon we also install it using command,

npm install — save-dev nodemon

To use cors we should install this too,

npm install — save cors

now create mongodb atlas account.

--

--

Git atoz guideline

How to change git repo.

Open your old code folder on your computer and open terminal.

git remote rm origin

git remote add origin []

replace this [] with your new repo git link with .git

git remote -v

git branch -M main

git push -u origin main

done you have successfully changed it.

--

--

Mohammad Shohag

Mohammad Shohag

I write about Programming, Tech, SEO, ASO, SMM, Business Idea, Travel and many more things.