Skip to content

Commit fda18f9

Browse files
committed
Added more help classes, moved files to public
1 parent e34ecaa commit fda18f9

26 files changed

Lines changed: 833 additions & 6 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.1+2
2+
3+
* Added a lot more help classes
4+
15
## 0.0.1+1
26

37
* Exposed Help classes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Flutter dev utils to make your life easier
99
* CallerLogger
1010
* Built off logger package with functionality to print caller, ignore certain callers, and filter printed logs by caller type
1111
* Help
12-
* HelpFoo classes which can be used for inline code help.
12+
* Stop clicking those purple stackoverflow links! HelpFoo classes can be used for inline code help.
1313

1414
![Alt Text](https://github.com/Kek-Tech/flutter_dev_utils/blob/main/assets/HelpClass.gif)
1515

lib/flutter_dev_utils.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
library flutter_dev_utils;
22

3-
export 'package:flutter_dev_utils/src/inline_help/help_error.dart';
4-
export 'package:flutter_dev_utils/src/inline_help/help_singleton.dart';
5-
63
export 'package:flutter_dev_utils/src/try_handler/sync_try_handler.dart';
74
export 'package:flutter_dev_utils/src/try_handler/async_try_handler.dart';
85
export 'package:flutter_dev_utils/src/caller_logger/caller_logger.dart';
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/// TODO
2+
/// # Help with Abstract classes
3+
///
4+
/// * Abstract classes cannot be instantiated.
5+
///
6+
/// ## Use cases
7+
///
8+
/// ### Extending an abstract class to override its function
9+
/// ```
10+
/// abstract class AbstractClass {
11+
/// void function();
12+
/// }
13+
///
14+
/// class Example extends AbstractClass {
15+
/// @override
16+
/// void function() => print('hi');
17+
/// }
18+
/// ```
19+
///
20+
/// ### Extending an abstract class to inherit its instance variable
21+
///
22+
/// * Instance variable has to be declared on instantiation of subclass.
23+
///
24+
/// ```
25+
/// abstract class AbstractClass {
26+
/// final String instanceVar;
27+
/// AbstractClass(this.instanceVar);
28+
/// }
29+
///
30+
/// class Example extends AbstractClass {
31+
/// Example(super.instanceVar);
32+
/// }
33+
/// ```
34+
///
35+
/// ### Implementing an abstract class to override its instance variable
36+
/// ```
37+
/// abstract class AbstractClass {
38+
/// final String instanceVar;
39+
/// AbstractClass(this.instanceVar);
40+
/// }
41+
///
42+
/// class Example implements AbstractClass {
43+
/// @override
44+
/// final String instanceVar = 'const';
45+
/// Example();
46+
/// }
47+
/// ```
48+
/// ### Mixing in an abstract class to inherit its instance variable
49+
///
50+
/// * Declaration of instance variable not necessary on instantiation of subclass
51+
///
52+
/// ```
53+
/// abstract class AbstractClass {
54+
/// String? instanceVar;
55+
/// }
56+
///
57+
/// class Example with AbstractClass {
58+
/// Example();
59+
/// }
60+
/// ```
61+
///
62+
/// ### Implementing an abstract class to inherit its members (interface)
63+
///
64+
/// * An interface is a superclass that acts as a blueprint for a subclass
65+
/// * Implementing an abstract class forces the subclass to override all members of the super
66+
/// * See HelpInterface for more details on `implements`
67+
///
68+
/// ```
69+
/// abstract class AbstractClass {
70+
/// String? instanceVariable;
71+
///
72+
/// void _function();
73+
/// }
74+
///
75+
/// class Example implements AbstractClass {
76+
/// @override
77+
/// void _function() => null;
78+
///
79+
/// @override
80+
/// String? instanceVariable = '';
81+
/// }
82+
/// ```
83+
84+
abstract class HelpAbstractClass {}

lib/inline_help/classes/help_annotations.dart

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// TODO
2+
abstract class HelpInterface {}
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// Help with important concepts in Dart
2+
///
3+
///
4+
5+
class HelpDart {}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/// # Help with Dart syntax
2+
///
3+
/// ## Multiple if
4+
/// ```
5+
/// (() {
6+
/// /// your code here
7+
/// }())
8+
/// ```
9+
///
10+
/// ## Spread Operator
11+
/// - Can be used to return multiple widgets
12+
/// ```
13+
/// if (Responsive.isDesktop()) ...[
14+
/// Text('Desktop')
15+
/// Text('Mode')
16+
/// ]
17+
/// ```
18+
///
19+
/// ## Cascade Notation
20+
///
21+
/// Prevents repeating target for several call methods on same object.
22+
///
23+
/// ```
24+
/// List list = [];
25+
/// list.add(color1);
26+
/// list.add(color2);
27+
///
28+
/// list
29+
/// ..add(color1)
30+
/// ..add(color2);
31+
/// ```
32+
///
33+
/// ## Arrow
34+
/// ```
35+
/// => expression,
36+
/// /// is equivalent to
37+
/// {return expression;},
38+
/// ```
39+
///
40+
/// ## Closure/Inline Functions
41+
/// ```
42+
/// () => expression
43+
///
44+
/// /// is equivalent to
45+
/// function () {
46+
/// return expression
47+
/// }
48+
/// ```
49+
///
50+
/// ## Anonymous Multiline Function
51+
/// ```
52+
/// () {expression}
53+
/// /// is equivalent to
54+
/// function () {
55+
/// return expression
56+
/// }
57+
/// ```
58+
class HelpDartSyntax {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/// # Inheritance
2+
///
3+
/// ## extends
4+
///
5+
/// - making all properties, variables, functions of superclass available to subclass
6+
///
7+
/// ## implements
8+
///
9+
/// - making type of superclass available to subclass
10+
/// - all functions must be implemented/overridden
11+
///
12+
/// ## with (mixin)
13+
///
14+
/// - making properties, variables, functions of a different class available to a subclass
15+
class HelpInheritance {}

0 commit comments

Comments
 (0)