Algorithm Pattern – Rotate & Spiral Array (LC 48 54 59)

Thought For the rotation question, we could get an easy approach by observing the rotation result. For the Spiral question, we should set the four dimension ranges and keep updating them. Example 48. Rotate Image (https://leetcode.com/problems/rotate-image/) You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). …

How to upload project to another GitHub repo

Sometimes we may combine our own project with a GitHub remote repository, it may be school repo or work repo. However, what if you want to upload the project into your own repository for future review? Try this: git remote rename origin upstream git remote add origin URL_TO_GITHUB_REPO git push origin master

How to configure Firebase in Flutter?

1. Configure Dependencies $ flutter pub add firebase_core Resolving dependencies… + firebase_core 1.10.5 + firebase_core_platform_interface 4.2.2 + firebase_core_web 1.5.2 + flutter_web_plugins 0.0.0 from sdk flutter + js 0.6.3 test_api 0.4.3 (0.4.8 available) Changed 5 dependencies! $ flutter pub add firebase_auth Resolving dependencies… + firebase_auth 3.3.3 + firebase_auth_platform_interface 6.1.8 + firebase_auth_web 3.3.4 + intl 0.17.0 test_api …

How to call multiple functions in onPressed() in Flutter?

There are one example to do it: RaisedButton( color: Colors.blueAccent, onPressed: () { sendData(); //fun1 signupPage(context); //fun2 }, child: Text("Signup"), ) This is how I add a SnackBar into my code: Padding( padding: const EdgeInsets.all(8.0), child: Center( child: ElevatedButton( onPressed: () { const postSuccessfullySnackBar = SnackBar( content: Text('Your item posted! 0v0'), ); _addNewItemInfoEntry(); ScaffoldMessenger.of(context) .showSnackBar(postSuccessfullySnackBar); …