flag_widget.dart
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class FlagWidget extends StatelessWidget {
final String code;
const FlagWidget({
Key key,
@required this.code,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final urlImage = 'assets/countries/$code.svg';
return SvgPicture.asset(
urlImage,
height: 30,
width: 30,
fit: BoxFit.cover,
);
}
}
home_header.dart
import 'package:flutter/material.dart';
import 'package:shop_app/home/components/search_field.dart';
import 'package:shop_app/size_config.dart';
class HomeHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(20)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SearchField(),
],
),
);
}
}
Do'stlaringiz bilan baham: |