m3_lightmeter/lib/screens/film_edit/flow_film_edit.dart

31 lines
860 B
Dart
Raw Normal View History

2024-10-21 10:22:25 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
2024-10-25 11:01:37 +00:00
import 'package:lightmeter/providers/films_provider.dart';
2024-10-21 10:22:25 +00:00
import 'package:lightmeter/screens/film_edit/bloc_film_edit.dart';
import 'package:lightmeter/screens/film_edit/screen_film_edit.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
2024-10-24 10:33:37 +00:00
class FilmEditArgs {
2024-10-25 11:01:37 +00:00
final FilmExponential? film;
2024-10-24 10:33:37 +00:00
2024-10-25 11:01:37 +00:00
const FilmEditArgs({this.film});
2024-10-24 10:33:37 +00:00
}
2024-10-21 10:22:25 +00:00
class FilmEditFlow extends StatelessWidget {
2024-10-24 10:33:37 +00:00
final FilmEditArgs args;
2024-10-21 10:22:25 +00:00
2024-10-24 10:33:37 +00:00
const FilmEditFlow({required this.args, super.key});
2024-10-21 10:22:25 +00:00
@override
Widget build(BuildContext context) {
return BlocProvider(
2024-10-25 11:01:37 +00:00
create: (_) => FilmEditBloc(
FilmsProvider.of(context),
film: args.film,
isEdit: args.film != null,
),
child: FilmEditScreen(isEdit: args.film != null),
2024-10-21 10:22:25 +00:00
);
}
}