[meal] view
This commit is contained in:
		
							parent
							
								
									985ed670e4
								
							
						
					
					
						commit
						8b7f8b7011
					
				
					 3 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -5,8 +5,9 @@ import 'package:fooder/widgets/macro.dart';
 | 
			
		|||
 | 
			
		||||
class MealScreen extends BasedScreen {
 | 
			
		||||
  final Meal meal;
 | 
			
		||||
  final Function() refresh;
 | 
			
		||||
 | 
			
		||||
  const MealScreen({super.key, required super.apiClient, required this.meal});
 | 
			
		||||
  const MealScreen({super.key, required super.apiClient, required this.refresh, required this.meal});
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  State<MealScreen> createState() => _AddMealScreen();
 | 
			
		||||
| 
						 | 
				
			
			@ -69,6 +70,8 @@ class _AddMealScreen extends State<MealScreen> {
 | 
			
		|||
              onPressed: () {
 | 
			
		||||
                _deleteMeal(widget.meal);
 | 
			
		||||
                Navigator.pop(context);
 | 
			
		||||
                Navigator.pop(context);
 | 
			
		||||
                widget.refresh();
 | 
			
		||||
              },
 | 
			
		||||
            ),
 | 
			
		||||
          ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,8 +57,8 @@ class DiaryWidget extends StatelessWidget {
 | 
			
		|||
                ),
 | 
			
		||||
              )),
 | 
			
		||||
          SliverToBoxAdapter(
 | 
			
		||||
            child: SizedBox(
 | 
			
		||||
              height: 30,
 | 
			
		||||
            child: Container(
 | 
			
		||||
              padding: const EdgeInsets.all(8),
 | 
			
		||||
              child: TextButton(
 | 
			
		||||
                onPressed: () {
 | 
			
		||||
                  Navigator.push(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,6 +29,7 @@ class MealWidget extends StatelessWidget {
 | 
			
		|||
            builder: (context) => MealScreen(
 | 
			
		||||
              apiClient: apiClient,
 | 
			
		||||
              meal: meal,
 | 
			
		||||
              refresh: refreshParent,
 | 
			
		||||
            ),
 | 
			
		||||
          ),
 | 
			
		||||
        ).then((_) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue