This file contains hidden or 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
    
  
  
    
  | /// Please first check out how ArrangeBuilder should be used in a simpler example: | |
| /// https://gist.github.com/tomaszpolanski/abd4725d4e07ba637d5540b5fe10aa1e | |
| abstract class ExampleUsecase { | |
| Future<String> fetchMessage(); | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import 'example.dart'; | |
| import 'package:mocktail/mocktail.dart'; | |
| /// An example of a mixing that needs to be implemented once and can be used | |
| /// in multiple tests without doing `when(() => ...)` in every test file | |
| mixin ApiMixin { | |
| Api api = _MockApi(); | |
| /// Function that prepares the mixin to be in a usable state. | |
| /// This would be mixin's constructor if mixins would support constructor | 
  
    
      This file contains hidden or 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
    
  
  
    
  | final String? text; | |
| @override | |
| Widget build(BuildContext context) { | |
| final _text = text; // Assign field to local final variable | |
| return Column( | |
| children: [ | |
| if (_text != null) Text(_text), // The `!` is not longer needed | |
| ], | |
| ); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | void main() { | |
| final A example = B(); | |
| if (example.text != null) { | |
| print(example.text!.length); // Throws null reference exception | |
| } | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class A { | |
| A(this.text); | |
| final String? text; // Final field | |
| } | |
| class B implements A { | |
| bool _first = true; | |
| @override | 
  
    
      This file contains hidden or 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
    
  
  
    
  | final String? text; | |
| @override | |
| Widget build(BuildContext context) { | |
| return Column( | |
| children: [ | |
| if (text != null) Text(text!), // Won't compile without `!` in `text!` | |
| ], | |
| ); | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class A { | |
| A(this.text); | |
| final String? text; // Final field | |
| } | |
| class B implements A { | |
| bool _first = true; | |
| @override | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ### Keybase proof | |
| I hereby claim: | |
| * I am tomaszpolanski on github. | |
| * I am tomekpolanski (https://keybase.io/tomekpolanski) on keybase. | |
| * I have a public key ASCKUlioKVilX-ZWBBM_SSeGjxkVO-nssaEU9BDiqg8bSQo | |
| To claim this, I am signing this object: | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import 'package:integration_test/integration_test.dart'; | |
| import 'route_test.dart' as route; | |
| import 'simple_test.dart' as simple; | |
| import 'subfolder/sub_test.dart' as subfolder_sub; | |
| import 'testing_test.dart' as testing; | |
| void main() { | |
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | |
| route.main(); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | final finder = find.text('Done'); | |
| for (int i = 0; i < 10; i++) { | |
| await tester.pump(const Duration(seconds: 1)); | |
| if (findsOneWidget.matches(finder, {})) { | |
| break; | |
| } | |
| } | 
NewerOlder