Untitled

mail@pastecode.io avatar
unknown
dart
2 years ago
1.2 kB
1
Indexable
Never

    
    File profilePic;

  getProfilePicFromServer() async {
    await WebServices.getProfilePictureOfDriver(false).then((value) {
      if (value == null) {
        setState(() {});
      } else if (value != null && value != 0) {
        setState(() {
          profilePic = value;
        });
      }
    });
  }

FittedBox(
            fit: BoxFit.contain,
            child: Material(
              shape: CircleBorder(),
              elevation: 10,
              child: ClipOval(
                child: Container(
                  color: Colors.amber,
                  child: Padding(
                    padding: EdgeInsets.all(width * 0.04),
                    child: ClipOval(
                        child: profilePic == null
                            ? Image(
                                fit: BoxFit.fitWidth,
                                image: AssetImage('assets/defaultpp.png'))
                            : Image(
                                fit: BoxFit.fitWidth,
                                image: FileImage(File(profilePic.path)))),
                  ),
                ),
              ),
            ),
          ),