content: import 'package:flutter/material.dart';
  import 'package:fraction/fraction.dart';
  import 'package:responsive_design/layouts/res/my_colors.dart';
  
  class AspectRatioLayout extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        backgroundColor: Colors.white,
        body: SafeArea(
          child: Column(
            children: [
              AspectRatioWidget(ratio: '16 / 9'),
              AspectRatioWidget(ratio: '3 / 2'),
            ],
          ),
        ),
      );
    }
  }
  
  class AspectRatioWidget extends StatelessWidget {
    final String ratio;
  
    AspectRatioWidget({@required this.ratio});
  
    @override
    Widget build(BuildContext context) {
      return AspectRatio(
        aspectRatio: Fraction.fromString(ratio).toDouble(),
        child: Container(
          decoration: BoxDecoration(
            color: MyColors.darkGreen,
            border: Border.all(color: Colors.white),
          ),
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Center(
              child: Text(
                'AspectRatio - $ratio',
                style: TextStyle(color: Colors.white, fontSize: 24),
              ),
            ),
          ),
        ),
      );
    }
  }
  