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
| await tester.pump(); |
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
| await tester.tap(find.byType(ElevatedButton)); | |
| await tester.pumpAndSettle(); |
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
| await tester.enterText( | |
| find.byKey(const Key('emailField')), | |
| 'test@example.com', | |
| ); |
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
| await tester.tap(find.text('Login')); | |
| await tester.pumpAndSettle(); | |
| expect(find.text('Dashboard'), findsOneWidget); |
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
| await tester.ensureVisible(find.byKey(Key('signup_submit'))); | |
| await tester.tap(find.byKey(Key('signup_submit'))); | |
| await tester.pumpAndSettle(); |
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 'package:flutter_test/flutter_test.dart'; | |
| import 'package:my_app/main.dart' as app; | |
| void main() { | |
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | |
| testWidgets('User sign-up flow', (tester) async { | |
| app.main(); | |
| await tester.pumpAndSettle(); |
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 'package:flutter_test/flutter_test.dart'; | |
| import 'package:my_app/main.dart' as app; | |
| void main() { | |
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | |
| testWidgets('User login flow works correctly', (tester) async { | |
| app.main(); // Launch the app | |
| await tester.pumpAndSettle(); |
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 UIKit | |
| import Flutter | |
| @UIApplicationMain | |
| @objc class AppDelegate: FlutterAppDelegate { | |
| override func application( | |
| _ application: UIApplication, | |
| didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | |
| ) -> Bool { | |
| let controller = window?.rootViewController as! FlutterViewController |
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 io.flutter.embedding.android.FlutterActivity | |
| import io.flutter.embedding.engine.FlutterEngine | |
| import io.flutter.plugin.common.MethodChannel | |
| class MainActivity: FlutterActivity() { | |
| private val CHANNEL = "battery" | |
| override fun configureFlutterEngine(flutterEngine: FlutterEngine) { | |
| super.configureFlutterEngine(flutterEngine) | |
| MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) |
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'; | |
| import 'package:flutter/services.dart'; | |
| class BatteryLevel extends StatefulWidget { | |
| @override | |
| _BatteryLevelState createState() => _BatteryLevelState(); | |
| } | |
| class _BatteryLevelState extends State<BatteryLevel> { | |
| static const platform = MethodChannel('battery'); |