-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more help classes, moved files to public
- Loading branch information
Showing
26 changed files
with
833 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.0.1+2 | ||
|
||
* Added a lot more help classes | ||
|
||
## 0.0.1+1 | ||
|
||
* Exposed Help classes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/// TODO | ||
/// # Help with Abstract classes | ||
/// | ||
/// * Abstract classes cannot be instantiated. | ||
/// | ||
/// ## Use cases | ||
/// | ||
/// ### Extending an abstract class to override its function | ||
/// ``` | ||
/// abstract class AbstractClass { | ||
/// void function(); | ||
/// } | ||
/// | ||
/// class Example extends AbstractClass { | ||
/// @override | ||
/// void function() => print('hi'); | ||
/// } | ||
/// ``` | ||
/// | ||
/// ### Extending an abstract class to inherit its instance variable | ||
/// | ||
/// * Instance variable has to be declared on instantiation of subclass. | ||
/// | ||
/// ``` | ||
/// abstract class AbstractClass { | ||
/// final String instanceVar; | ||
/// AbstractClass(this.instanceVar); | ||
/// } | ||
/// | ||
/// class Example extends AbstractClass { | ||
/// Example(super.instanceVar); | ||
/// } | ||
/// ``` | ||
/// | ||
/// ### Implementing an abstract class to override its instance variable | ||
/// ``` | ||
/// abstract class AbstractClass { | ||
/// final String instanceVar; | ||
/// AbstractClass(this.instanceVar); | ||
/// } | ||
/// | ||
/// class Example implements AbstractClass { | ||
/// @override | ||
/// final String instanceVar = 'const'; | ||
/// Example(); | ||
/// } | ||
/// ``` | ||
/// ### Mixing in an abstract class to inherit its instance variable | ||
/// | ||
/// * Declaration of instance variable not necessary on instantiation of subclass | ||
/// | ||
/// ``` | ||
/// abstract class AbstractClass { | ||
/// String? instanceVar; | ||
/// } | ||
/// | ||
/// class Example with AbstractClass { | ||
/// Example(); | ||
/// } | ||
/// ``` | ||
/// | ||
/// ### Implementing an abstract class to inherit its members (interface) | ||
/// | ||
/// * An interface is a superclass that acts as a blueprint for a subclass | ||
/// * Implementing an abstract class forces the subclass to override all members of the super | ||
/// * See HelpInterface for more details on `implements` | ||
/// | ||
/// ``` | ||
/// abstract class AbstractClass { | ||
/// String? instanceVariable; | ||
/// | ||
/// void _function(); | ||
/// } | ||
/// | ||
/// class Example implements AbstractClass { | ||
/// @override | ||
/// void _function() => null; | ||
/// | ||
/// @override | ||
/// String? instanceVariable = ''; | ||
/// } | ||
/// ``` | ||
abstract class HelpAbstractClass {} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// TODO | ||
abstract class HelpInterface {} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// Help with important concepts in Dart | ||
/// | ||
/// | ||
class HelpDart {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/// # Help with Dart syntax | ||
/// | ||
/// ## Multiple if | ||
/// ``` | ||
/// (() { | ||
/// /// your code here | ||
/// }()) | ||
/// ``` | ||
/// | ||
/// ## Spread Operator | ||
/// - Can be used to return multiple widgets | ||
/// ``` | ||
/// if (Responsive.isDesktop()) ...[ | ||
/// Text('Desktop') | ||
/// Text('Mode') | ||
/// ] | ||
/// ``` | ||
/// | ||
/// ## Cascade Notation | ||
/// | ||
/// Prevents repeating target for several call methods on same object. | ||
/// | ||
/// ``` | ||
/// List list = []; | ||
/// list.add(color1); | ||
/// list.add(color2); | ||
/// | ||
/// list | ||
/// ..add(color1) | ||
/// ..add(color2); | ||
/// ``` | ||
/// | ||
/// ## Arrow | ||
/// ``` | ||
/// => expression, | ||
/// /// is equivalent to | ||
/// {return expression;}, | ||
/// ``` | ||
/// | ||
/// ## Closure/Inline Functions | ||
/// ``` | ||
/// () => expression | ||
/// | ||
/// /// is equivalent to | ||
/// function () { | ||
/// return expression | ||
/// } | ||
/// ``` | ||
/// | ||
/// ## Anonymous Multiline Function | ||
/// ``` | ||
/// () {expression} | ||
/// /// is equivalent to | ||
/// function () { | ||
/// return expression | ||
/// } | ||
/// ``` | ||
class HelpDartSyntax {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// # Inheritance | ||
/// | ||
/// ## extends | ||
/// | ||
/// - making all properties, variables, functions of superclass available to subclass | ||
/// | ||
/// ## implements | ||
/// | ||
/// - making type of superclass available to subclass | ||
/// - all functions must be implemented/overridden | ||
/// | ||
/// ## with (mixin) | ||
/// | ||
/// - making properties, variables, functions of a different class available to a subclass | ||
class HelpInheritance {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// # Initialiser List (:) | ||
/// | ||
/// Used to: | ||
/// - Initialise list of expressions that can: | ||
/// - access constructor parameters | ||
/// - assign to instance fields (even final instance fields!) | ||
/// - Call other constructors | ||
/// - e.g., superclass | ||
/// - Assert constructor parameters | ||
/// | ||
/// NOTE: | ||
/// - Initialiser list is executed before constructor body | ||
/// - Use `this.instanceVariable` when there is a name conflict, else omit | ||
class HelpInitialiserList {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// # Modifiers | ||
/// | ||
/// ## static | ||
/// | ||
/// - modifies members of a class (variables, functions) | ||
/// - only affects the class, not on instances of the class | ||
/// | ||
/// ## final | ||
/// | ||
/// - modifies variables (`var, int, double`) | ||
/// - must be assigned on init | ||
/// - shallow immutability: e.g., final collection members can be mutable, collection itself is immutable | ||
/// | ||
/// ## const | ||
/// | ||
/// - modifies values and objects (`[1,2,3], Point(2,3)`) | ||
/// - compile time constant: state can be determined at compile time and is then frozen (e.g., `1+2` is compile time const, `DateTime.now()` is not) | ||
/// - deep (transitive) immutability: e.g., const collection members are immutable, recursively | ||
/// - canonicalised values and objects: all assignments of the const value/object will refer to the same instance | ||
class HelpModifiers {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/// # Sizing | ||
/// ## Sizes, Constraints and Positions | ||
/// ### Rules | ||
/// - Constraints go down | ||
/// - Sizes go up | ||
/// - Parent sets position | ||
/// ### Process | ||
/// For an arbitrary widget X, its parent Y, and its children Z | ||
/// 1. Y passes its constraints down to X | ||
/// - min/max height/width | ||
/// 2. X passes its constraints down to Z | ||
/// 3. X asks Z what size they are | ||
/// - width/height | ||
/// 4. X sets positions of Z | ||
/// 5. X tells Y its final size | ||
/// | ||
/// ### Limitations | ||
/// - Size defined in widget only within constraints of parent | ||
/// - Widget does not know/decide its position | ||
/// - Defining alignment must be specific or child size may be ignored | ||
/// | ||
/// ### Mechanisms | ||
/// - RenderBox | ||
/// - Underlying object used to render widgets | ||
/// | ||
/// ### Types of Constraints | ||
/// #### As Big As Possible | ||
/// - e.g., | ||
/// - Center | ||
/// - ListView | ||
/// - Container (null width and height) | ||
/// #### Same Size if Possible | ||
/// - e.g., | ||
/// - Transform | ||
/// - Opacity | ||
/// - Container (non null width or height) | ||
/// #### Fixed Size if Possible | ||
/// - e.g., | ||
/// - Image | ||
/// - Text | ||
/// ## BoxConstraints | ||
/// - Passed to Container.constraints | ||
/// - Can specify max/min width/height | ||
/// | ||
/// ## LayoutBuilder | ||
/// - Provides parent constraints to child | ||
/// - Builds at layout time | ||
/// | ||
/// ## FractionallySizedBox | ||
/// - Provides percentage of parent size to child | ||
/// ``` | ||
/// ParentWidget( | ||
/// child: FractionallySizedBox( | ||
/// widthFactor: 0.5, | ||
/// heightFactor: 0.5, | ||
/// child: Container( | ||
/// /// this container won't be larger than | ||
/// /// half of its parent size | ||
/// ), | ||
/// ) | ||
/// ) | ||
/// ``` | ||
class HelpSizing {} |
5 changes: 5 additions & 0 deletions
5
lib/src/inline_help/help_error.dart → lib/inline_help/debugging/help_error.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// # Exceptions | ||
/// | ||
/// An Exception in Dart should be thrown for regular, expected program flow and is intended to be caught: | ||
/// An Exception is intended to convey information to the user about a failure, so that the error can be addressed programmatically. It is intended to be caught, and it should contain useful data fields. | ||
class HelpExceptions {} |
Oops, something went wrong.