mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
More merge fixes
This commit is contained in:
@@ -11,7 +11,6 @@ import 'package:wger/screens/routine_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
import 'package:wger/widgets/routines/gym_mode/summary.dart';
|
||||
|
||||
// import '../test/routine/gym_mode/gym_mode_test.mocks.dart';
|
||||
import '../test_data/exercises.dart';
|
||||
import '../test_data/routines.dart';
|
||||
|
||||
@@ -70,12 +69,6 @@ Widget createGymModeResultsScreen({String locale = 'en'}) {
|
||||
final routine = getTestRoutine(exercises: getScreenshotExercises());
|
||||
routine.sessions.first.date = clock.now();
|
||||
|
||||
final mockRoutinesProvider = MockRoutinesProvider();
|
||||
final mockExerciseProvider = MockExercisesProvider();
|
||||
|
||||
when(mockRoutinesProvider.fetchAndSetRoutineFull(1)).thenAnswer((_) async => routine);
|
||||
when(mockRoutinesProvider.findById(1)).thenAnswer((_) => routine);
|
||||
|
||||
return riverpod.UncontrolledProviderScope(
|
||||
container: riverpod.ProviderContainer.test(
|
||||
overrides: [
|
||||
@@ -88,31 +81,23 @@ Widget createGymModeResultsScreen({String locale = 'en'}) {
|
||||
showTimerPages: true,
|
||||
),
|
||||
),
|
||||
routinesRiverpodProvider.overrideWithValue(RoutinesState(routines: [routine])),
|
||||
],
|
||||
),
|
||||
child: MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<RoutinesProvider>(
|
||||
create: (context) => mockRoutinesProvider,
|
||||
),
|
||||
ChangeNotifierProvider<ExercisesProvider>(
|
||||
create: (context) => mockExerciseProvider,
|
||||
),
|
||||
],
|
||||
child: MaterialApp(
|
||||
locale: Locale(locale),
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
navigatorKey: key,
|
||||
theme: wgerLightTheme,
|
||||
home: Scaffold(
|
||||
body: PageView(
|
||||
controller: controller,
|
||||
children: [
|
||||
WorkoutSummary(controller),
|
||||
],
|
||||
),
|
||||
|
||||
child: MaterialApp(
|
||||
locale: Locale(locale),
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
navigatorKey: key,
|
||||
theme: wgerLightTheme,
|
||||
home: Scaffold(
|
||||
body: PageView(
|
||||
controller: controller,
|
||||
children: [
|
||||
WorkoutSummary(controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -763,10 +763,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_ios
|
||||
sha256: "997d100ce1dda5b1ba4085194c5e36c9f8a1fb7987f6a36ab677a344cd2dc986"
|
||||
sha256: "956c16a42c0c708f914021666ffcd8265dde36e673c9fa68c81f7d085d9774ad"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.13+2"
|
||||
version: "0.8.13+3"
|
||||
image_picker_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -44,7 +44,11 @@ void main() {
|
||||
testRoutine = getTestRoutine();
|
||||
mockRepository = MockWorkoutSessionRepository();
|
||||
|
||||
container = ProviderContainer.test();
|
||||
container = ProviderContainer.test(
|
||||
overrides: [
|
||||
workoutSessionRepositoryProvider.overrideWithValue(mockRepository),
|
||||
],
|
||||
);
|
||||
notifier = container.read(gymStateProvider.notifier);
|
||||
notifier.state = notifier.state.copyWith(
|
||||
showExercisePages: true,
|
||||
@@ -54,32 +58,27 @@ void main() {
|
||||
routine: getTestRoutine(),
|
||||
);
|
||||
notifier.calculatePages();
|
||||
when(mockRoutinesProvider.editSession(any)).thenAnswer(
|
||||
when(mockRepository.editLocalDrift(any)).thenAnswer(
|
||||
(_) => Future.value(testRoutine.sessions[0]),
|
||||
);
|
||||
});
|
||||
|
||||
Widget renderSessionPage({locale = 'en'}) {
|
||||
//final controller = PageController(initialPage: 0);
|
||||
final pageController = PageController(initialPage: 0);
|
||||
|
||||
return UncontrolledProviderScope(
|
||||
overrides: [
|
||||
workoutSessionRepositoryProvider.overrideWithValue(mockRepository),
|
||||
],
|
||||
container: container,
|
||||
child: ChangeNotifierProvider<RoutinesProvider>(
|
||||
create: (context) => mockRoutinesProvider,
|
||||
child: MaterialApp(
|
||||
locale: Locale(locale),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: Scaffold(
|
||||
body: PageView(
|
||||
controller: controller,
|
||||
children: [
|
||||
SessionPage(controller),
|
||||
],
|
||||
),
|
||||
|
||||
child: MaterialApp(
|
||||
locale: Locale(locale),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: Scaffold(
|
||||
body: PageView(
|
||||
controller: pageController,
|
||||
children: [
|
||||
SessionPage(pageController),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user