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:dio/dio.dart'; | |
| import 'package:mockito/annotations.dart'; | |
| @GenerateMocks([Dio]) | |
| void 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
| import 'package:json_annotation/json_annotation.dart'; | |
| part 'city_model.g.dart'; | |
| @JsonSerializable() | |
| class CityModel { | |
| final List<CitySearchModel> results; | |
| CityModel({required this.results}); | |
| factory CityModel.fromJson(Map<String, dynamic> json) => |
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_test/flutter_test.dart'; | |
| import 'package:integration_test/integration_test.dart'; | |
| import 'package:untitled/main.dart'; // Adjust if your main.dart is in another folder | |
| void main() { | |
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | |
| testWidgets("Full app integration test", (WidgetTester tester) async { | |
| await tester.pumpWidget(const MyApp()); |
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_driver.dart'; | |
| Future<void> main() => integrationDriver(); |
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_test/flutter_test.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:untitled/main.dart'; | |
| void main() { | |
| testWidgets('App loads and shows counter UI', (WidgetTester tester) async { | |
| // Run the full app (includes main(), MyApp, Home) | |
| await tester.pumpWidget(const MyApp()); | |
| // Ensure title is present |
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:bloc_test/bloc_test.dart'; | |
| import 'package:flutter_test/flutter_test.dart'; | |
| import 'package:untitled/counter_bloc/counter_bloc.dart'; | |
| void main() { | |
| group('CounterBloc', () { | |
| late CounterBloc counterBloc; | |
| setUp(() { | |
| counterBloc = CounterBloc(); |
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_bloc/flutter_bloc.dart'; | |
| import 'package:untitled/counter_bloc/counter_bloc.dart'; // This should contain the CounterBloc and CounterEvent | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); |
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_bloc/flutter_bloc.dart'; | |
| // Define the events | |
| abstract class CounterEvent {} | |
| class CounterIncrement extends CounterEvent {} | |
| class CounterDecrement extends CounterEvent {} |
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 StrictRangeFilteringTextInputFormatter extends FilteringTextInputFormatter { | |
| final double min; | |
| final double max; | |
| final bool allowNegative; | |
| final bool unlimitedDecimals; | |
| final int? decimalPlaces; | |
| StrictRangeFilteringTextInputFormatter({ | |
| required this.min, | |
| required this.max, |
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/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| class CustomDialogLayout extends SingleChildLayoutDelegate { | |
| CustomDialogLayout({ | |
| required this.anchorRect, | |
| required this.textDirection, | |
| required this.alignment, | |
| required this.alignmentOffset, | |
| required this.menuPadding, |