added an alert dialog function call in context extension

This commit is contained in:
ashrafzarkanisala
2024-06-12 23:48:39 +03:00
parent 8c8e46f250
commit 4a93bc2892
3 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart'; import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/light_divider.dart'; import 'package:syncrow_app/features/shared_widgets/light_divider.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
@ -71,7 +72,17 @@ class CustomBottomSheetWidget extends StatelessWidget {
size: 16, size: 16,
color: ColorsManager.greyColor, color: ColorsManager.greyColor,
), ),
onPressed: () {}, onPressed: () {
context.customAlertDialog(
height: 300,
child: Material(
child: DefaultContainer(
width: context.width * 0.8,
child: Text('Comming soon'),
),
),
);
},
), ),
], ],
), ),

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart'; import 'package:syncrow_app/features/scene/view/widgets/scene_list_tile.dart';
import 'package:syncrow_app/features/scene/view/widgets/if_then_containers/bottom_sheet_widget.dart'; import 'package:syncrow_app/features/scene/view/widgets/bottom_sheet_widget.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/light_divider.dart'; import 'package:syncrow_app/features/shared_widgets/light_divider.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';

View File

@ -43,4 +43,13 @@ extension ContextExtension on BuildContext {
}, },
); );
} }
void customAlertDialog({required Widget child, required double height}) {
showDialog(
context: this,
builder: (BuildContext context) {
return Dialog(child: SizedBox(height: height, child: child));
},
);
}
} }