Answers for "stack in flutter"

0

flutter stack imagge on top center of card

Stack(
  children: <Widget>[
    Card(
      margin: const EdgeInsets.only(top: 20.0),
      child: SizedBox(
          height: 100.0,
          width: double.infinity,
          child: Padding(
            padding: const EdgeInsets.only(top: 45.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Text(
                  "Foo",
                  style: Theme.of(context).textTheme.subhead,
                ),
                Text("bar")
              ],
            ),
          )),
    ),
    Positioned(
      top: .0,
      left: .0,
      right: .0,
      child: Center(
        child: CircleAvatar(
          radius: 30.0,
          child: Text("D"),
        ),
      ),
    )
  ],
),
Posted by: Guest on October-22-2020
1

flutter stack

Stack(
  children: <Widget>[
    Container(
      width: 100,
      height: 100,
      color: Colors.red,
    ),
    Container(
      width: 90,
      height: 90,
      color: Colors.green,
    ),
    Container(
      width: 80,
      height: 80,
      color: Colors.blue,
    ),
  ],
)
Posted by: Guest on August-30-2021
0

stack in flutter

class Settings {
  String image;
  String doors;
  String color;
  String type;
  String capacity;
  String private;
  String vehicleMake;
  String vehicleModel;
  String manufactureYear;
  String vehiclePlateNum;

  Settings(
      {this.image,
      this.doors,
      this.color,
      this.type,
      this.capacity,
      this.private,
      this.vehicleMake,
      this.vehicleModel,
      this.manufactureYear,
      this.vehiclePlateNum});

  Settings.fromJson(Map<String, dynamic> json) {
    image = json['image'];
    doors = json['doors'];
    color = json['color'];
    type = json['type'];
    capacity = json['capacity'];
    private = json['private'];
    vehicleMake = json['vehicleMake'];
    vehicleModel = json['vehicleModel'];
    manufactureYear = json['manufactureYear'];
    vehiclePlateNum = json['vehiclePlateNum'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['image'] = this.image;
    data['doors'] = this.doors;
    data['color'] = this.color;
    data['type'] = this.type;
    data['capacity'] = this.capacity;
    data['private'] = this.private;
    data['vehicleMake'] = this.vehicleMake;
    data['vehicleModel'] = this.vehicleModel;
    data['manufactureYear'] = this.manufactureYear;
    data['vehiclePlateNum'] = this.vehiclePlateNum;
    return data;
  }
}
Posted by: Guest on September-27-2021
0

how to make stack not float in flutter

bool isKeyboardVisible = false;

  @override
  void initState() {
    super.initState();

    KeyboardVisibilityNotification().addNewListener(
      onChange: (bool visible) {
        isKeyboardVisible = visible;
      },
    );
  }
Posted by: Guest on June-25-2020

Browse Popular Code Answers by Language