CupertinoAlertDialog Properties

title → Widget : The (optional) title of the dialog is displayed in a large font at the top of the dialog.

content → Widget : The (optional) content of the dialog is displayed in the center of the dialog in a lighter font.

actions → List : The (optional) set of actions that are displayed at the bottom of the dialog.

scrollController → ScrollController : A scroll controller that can be used to control the scrolling of the content in the dialog.

actionScrollController → ScrollController : A scroll controller that can be used to control the scrolling of the actions in the dialog.

Example 1 – Show CupertinoDialog with Title,Content and Button

Video tutorial(ProgrammingWizards TV Channel)

Well we have a video tutorial as an alternative to this. If you prefer tutorials like this one then it would be good you subscribe to our YouTube channel. Basically we have a TV for programming where do daily tutorials especially android.

Here are the files we explore:

pubspec.yaml

lib/main.dart

(a). pubspec.yaml

Flutter supports using shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows you to quickly build your app without having to develop everything from scratch.

We will be adding packages under this file.

Open the pubspec.yaml file located inside your app folder, and add dependencies under dependencies.

If it is a third party then you have to install it.
From the terminal: Run flutter packages get

OR

From Android Studio/IntelliJ: Click ‘Packages Get’ in the action ribbon at the top of pubspec.yaml
From VS Code: Click ‘Get Packages’ located in right side of the action ribbon at the top of pubspec.yaml

flutter is always our sdk dependency as we use it to develop our ios and android apps.

Here’s our pubspec.yaml file:

name: mr_cupertino_dialog
description: A new Flutter project.
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg

(b). main.dart

This is where we write our flutter code in dart programming language. In Dart it is very common to write several classes in a single file. So this simple file will have three classes.

Share Article:

Tags:

When I was a 2nd year Software Engineering student, I buillt a now defunct online tool called Camposha(from Campus Share) using my then favorite language C#(ASP.NET) to compete OLX in my country(Kenya). The idea was to target campus students in Kenya. I got a few hundred signups but competing OLX proved too daunting. I decided to focus on my studies, learning other languages like Java,Python,Kotlin etc while meanwhile publishing tutorials at my YouTube Channel ProgrammingWizards TV which led to this site(camposha.info). Say hello or post me a suggestion: oclemmi@gmail.com .
Follow me below;
Github
, and on my channel:
ProgrammingWizards TV