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
| bool whenNull(dynamic value) { | |
| return value == null; | |
| } | |
| bool whenNotNull(dynamic value) { | |
| return value != null; | |
| } | |
| bool whenNullMap(String key, value) { |
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
| abstract class MyBlocState{} | |
| class Step1State extends MyBlocState{ | |
| String title; | |
| } | |
| class Step2State extends MyBlocState{ | |
| int progress; | |
| } | |
| class Step3State extends MyBlocState{ | |
| } |
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:test/test.dart'; | |
| main() { | |
| test("throw excpetion test",() { | |
| expectException(()=>throw Exception("sample error"), 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
| ///define in module | |
| val stateMachineModule = module { | |
| stateFactory{ TestImplStateMachine() } bind StateMachine::class | |
| } | |
| /// inject or get | |
| val stateMachineTest:StateMachine<MyState> = getSm() | |
| ///class of state machine | |
| class TestImplStateMachine : StateMachine<MyState> { |
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:flutter/material.dart'; | |
| final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override |
OlderNewer