Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Dart Regions?

Tags:

dart

region

In c# there's something called regions, which can be useful to structure your code. I was wondering if there is something similar for Google Dart?

like image 513
The Oddler Avatar asked Sep 07 '12 16:09

The Oddler


People also ask

What are Dart zones?

A zone represents an environment that remains stable across asynchronous calls. Code is always executed in the context of a zone, available as Zone. current. The initial main function runs in the context of the default zone (Zone. root).

What language is Dart based on?

Dart is a descendant of the ALGOL language family, alongside C, Java, C#, JavaScript, and others. The method cascade syntax, which provides a syntactic shortcut for invoking several methods one after another on the same object, is adopted from Smalltalk.

Where is Dart used?

Google engineers use Dart to create many apps, including some that are essential to Google's business. For example, if you use the Google Ads web or mobile app, you're using a Dart app that supports much of Google's revenue.

How do you use runZonedGuarded?

runZonedGuarded<R> function Null safety Runs body in its own error zone. Creates a new zone using Zone. fork based on zoneSpecification and zoneValues , then runs body in that zone and returns the result. The onError function is used both to handle asynchronous errors by overriding ZoneSpecification.


2 Answers

//#region Test 

//#endregion

That works in Android Studio & IntelliJ.

like image 88
Majd Kazmoz Avatar answered Nov 05 '22 06:11

Majd Kazmoz


Dart does not support regions as part of the language specification. However, many IDE tools offer this feature using formatted comments. See the answer below identifying Android Studio and IntelliJ as two such examples.

like image 24
John Evans Avatar answered Nov 05 '22 08:11

John Evans