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
testWidget('my test', (tester) async { | |
final robot = MyWidgetRobot(tester); | |
await robot.show(); | |
await robot.tapHelloWorldButton(); | |
robot.expectHelloWorldAppears(); | |
}); |
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
testWidget('my test', (tester) async { | |
await tester.pumpWidget(MaterialApp(home: MyWidget())); | |
await tester.tap(find.byKey(const Key('my_widget_key'))); | |
await tester.pumpAndSettle(); | |
expect(find.text('Hello, World!'), findsOneWidget); | |
}); |
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:use_reducer_example/store_injector.dart'; | |
import 'reducer.dart'; | |
final itemsForDropdown1 = ['A', 'B', 'C']; | |
final itemsForDropdown2 = ['1', '2', '3']; | |
class MyFormUseReducerWithStoreInjectorView extends HookWidget { |
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
typedef Aspect<State> = bool Function(State oldState, State newState); | |
typedef ListenState<State, Selected> = Selected Function(State state); | |
bool unaspect(dynamic oldState, dynamic newState) => false; | |
class StoreInjector<State, Action> extends StatelessWidget { | |
const StoreInjector({super.key, required this.store, required this.child}); |
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
import 'package:equatable/equatable.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
class MyFormState extends Equatable { | |
const MyFormState( | |
this.formKey, | |
this.textInputController, [ | |
this.dropdown1Value, | |
this.textInput, |
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:use_reducer_example/reducer.dart'; | |
final itemsForDropdown1 = ['A', 'B', 'C']; | |
final itemsForDropdown2 = ['1', '2', '3']; | |
class MyFormUseReducerView extends HookWidget { | |
const MyFormUseReducerView({super.key}); | |
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:use_reducer_example/reducer.dart'; | |
final itemsForDropdown1 = ['A', 'B', 'C']; | |
final itemsForDropdown2 = ['1', '2', '3']; | |
enum Stage { dropdown1, textInput, dropdown2, finished } | |
class MyFormUseStateView extends HookWidget { |
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
local function Split (inputstr, sep) | |
if sep == nil then | |
sep = "%s" | |
end | |
local t={} | |
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do | |
table.insert(t, str) | |
end | |
return t | |
end |
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
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
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
"macros": { | |
"commentLine": [ | |
"editor.action.commentLine", | |
"cursorDown" | |
] | |
} |
NewerOlder