Skip to main content

Featured

Building a gRPC Service with Nested Messages, Repeated Fields, and Oneof in Python

Introduction:  gRPC is a high-performance, open-source framework developed by Google for building efficient and scalable distributed systems. It provides a language-agnostic way to define and implement services using Protocol Buffers (protobuf) as the interface definition language. In this tutorial, we'll explore how to build a gRPC service in Python that incorporates advanced features such as nested messages, repeated fields, and oneof. These features allow us to create complex data structures and handle scenarios where multiple values or mutually exclusive fields are involved.   Prerequisites: Basic understanding of gRPC and Protocol Buffers. Python development environment set up.   Step 1: Define the Protocol Buffers (protobuf) File  Start by defining the service and message definitions in a proto file. Here's an example of a proto file named example.proto that defines a gRPC service with nested messages, repeated fields, and oneof: syntax = "proto3" ; package

How to Install Flutter on Windows


Acording to Flutter documentation on their site, to install and run Flutter, your PC must meet these minimum requirements:

1. Operating Systems: Windows 10 or later (64-bit), x86-64 based.
2. Disk Space: 1.64 GB (does not include disk space for IDE/tools).

And make sure you have these above installed on your environment:

1. Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10 so you don't need to intall them)
2. Git for Windows 2.x, with the Use Git from the Windows Command Prompt option.

If Git for Windows is already installed, make sure you can run git commands from the command prompt or PowerShell. for example run git --version.

Next, let clone the stable Flutter SDK repository by cd to desire path on your computer then run this command:

- mkdir src
- cd src

- git clone https://github.com/flutter/flutter.git -b stable

After that you need add "flutter\bin" to Path,

- search "Edit environment variables for your account" and click it to open
- Under User variables check if there is an entry called Path, then if the entry exists, append the full path to flutter\bin

You need to reload your Powershell or Git Bash to refresh.

Run command: flutter doctor

Run the above command to see if there are any platform dependencies you need to complete the setup. This command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform.

For Windows desktop development, you need Visual Studio 2022 or Visual Studio Build Tools 2022. When installing Visual Studio or only the Build Tools, you need the “Desktop development with C++” workload installed for building windows, including all of its default components.

it will eat your time so be patient...

Flutter also relies on a full installation of Android Studio to supply its Android platform dependencies. Get ready to install Android Studio:

1. Download and install Android Studio.

2. Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.

3. Run flutter doctor to confirm that Flutter has located your installation of Android Studio. If Flutter cannot locate it, run flutter config --android-studio-dir (directory) to set the directory that Android Studio is installed to.

Before you can use Flutter, you must agree to the licenses of the Android SDK platform. Open an elevated console window and run the following command to begin signing licenses.

flutter doctor --android-licenses

Done! if you only want to develope windows or web applications..

Well there is more to cover if you need develope android applications, like setup Android Emulator and etc. For more info, visit https://docs.flutter.dev/get-started/install/windows

Comments