Skip to content

Commit

Permalink
feat: dcm: example and readme have been corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
internetova committed Feb 28, 2024
1 parent 4e3f33e commit 8233595
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import 'package:your_app/assets/colors/app_color_scheme.dart';
import 'package:your_app/assets/themes/app_theme_data.dart';
import 'package:your_app/features/app/di/app_scope.dart';
import 'package:your_app/features/common/widgets/di_scope/di_scope.dart';
import 'package:surf_widget_test_composer/surf_widget_test_composer.dart';
import 'package:surf_widget_test_composer/surf_widget_test_composer.dart' as helper;
class MockAppScope extends Mock implements IAppScope {}
Expand All @@ -46,12 +45,12 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) {
/// You can specify your own themes.
/// Stringified is used for naming screenshots.
final themes = [
TestingTheme(
helper.TestingTheme(
data: AppThemeData.dark,
stringified: 'dark',
type: ThemeType.dark,
),
TestingTheme(
helper.TestingTheme(
data: AppThemeData.light,
stringified: 'light',
type: ThemeType.light,
Expand All @@ -60,16 +59,16 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) {
/// You can specify your own devices.
final devices = [
TestDevice(
helper.TestDevice(
name: 'iphone11',
size: const Size(414, 896),
safeArea: const EdgeInsets.only(top: 44, bottom: 34),
),
TestDevice(
helper.TestDevice(
name: 'pixel 4a',
size: const Size(393, 851),
),
TestDevice(
helper.TestDevice(
name: 'iphone_se_1',
size: const Size(640 / 2, 1136 / 2),
),
Expand All @@ -78,7 +77,7 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) {
return helper.testExecutable(
testMain: testMain,
themes: themes,
wrapper: (child, mode, theme) => BaseWidgetTestWrapper(
wrapper: (child, mode, theme, localizations, locales) => helper.BaseWidgetTestWrapper(
childBuilder: child,
mode: mode,
themeData: theme,
Expand Down
21 changes: 9 additions & 12 deletions example/test/flutter_test_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:mocktail/mocktail.dart';
import 'package:provider/provider.dart';
import 'package:surf_widget_test_composer/surf_widget_test_composer.dart'
as helper;
import 'package:surf_widget_test_composer/surf_widget_test_composer.dart';
import 'package:surf_widget_test_composer/surf_widget_test_composer.dart' as helper;
import 'package:surf_widget_test_composer_example/src/localization/app_localizations.dart';
import 'package:surf_widget_test_composer_example/src/settings/settings_controller.dart';

Expand All @@ -17,30 +15,30 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) {
/// You can specify your own themes.
/// Stringified is used for naming screenshots.
final themes = [
TestingTheme(
helper.TestingTheme(
data: ThemeData.dark(),
stringified: 'dark',
type: ThemeType.dark,
type: helper.ThemeType.dark,
),
TestingTheme(
helper.TestingTheme(
data: ThemeData.light(),
stringified: 'light',
type: ThemeType.light,
type: helper.ThemeType.light,
),
];

/// You can specify your own devices.
final devices = [
TestDevice(
helper.TestDevice(
name: 'iphone11',
size: const Size(414, 896),
safeArea: const EdgeInsets.only(top: 44, bottom: 34),
),
TestDevice(
helper.TestDevice(
name: 'pixel 4a',
size: const Size(393, 851),
),
TestDevice(
helper.TestDevice(
name: 'iphone_se_1',
size: const Size(640 / 2, 1136 / 2),
),
Expand All @@ -51,8 +49,7 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) {
themes: themes,
localizations: _localizations,
locales: _locales,
wrapper: (child, mode, theme, localizations, locales) =>
BaseWidgetTestWrapper(
wrapper: (child, mode, theme, localizations, locales) => helper.BaseWidgetTestWrapper(
childBuilder: child,
mode: mode,
themeData: theme,
Expand Down

0 comments on commit 8233595

Please sign in to comment.