Tags
Flutter
Asked 3 years ago
12 Oct 2021
Views 471
Joanny

Joanny posted

what is SafeArea widget in flutter ?

what is use of SafeArea widget ?
i am trying get how to use SafeArea widget ?
i just see below code :

 return SafeArea(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Container(
            child: Text(
              'Number Generator Progress',
              style: Theme.of(context).textTheme.headline6,
            ),
            padding: const EdgeInsets.all(8),
          ),
          LinearProgressIndicator(
            value: controller.progressPercent,
            backgroundColor: Colors.grey[200],
          ),
          const Expanded(
            child: RunningList(),
          ),
          Column(
            children: [
              ElevatedButton(
                child: const Text('Transfer Data to 2nd Isolate'),
                style: ElevatedButton.styleFrom(
                    primary: (controller.runningTest == 1)
                        ? Colors.blueAccent
                        : Colors.grey[300]),
                onPressed: () => controller.generateRandomNumbers(false),
              ),
              ElevatedButton(
                child: const Text('Transfer Data with TransferableTypedData'),
                style: ElevatedButton.styleFrom(
                    primary: (controller.runningTest == 2)
                        ? Colors.blueAccent
                        : Colors.grey[300]),
                onPressed: () => controller.generateRandomNumbers(true),
              ),
              ElevatedButton(
                child: const Text('Generate on 2nd Isolate'),
                style: ElevatedButton.styleFrom(
                    primary: (controller.runningTest == 3)
                        ? Colors.blueAccent
                        : Colors.grey[300]),
                onPressed: controller.generateOnSecondaryIsolate,
              ),
            ],
          ),
        ],
      ),
    );


what is difference between SafeArea and Scaffold like other container widget ?
Post Answer