brenoitalo

app_logo.dart

Sep 13th, 2023
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.03 KB | Software | 0 0
  1. // ignore_for_file: public_member_api_docs, sort_constructors_first
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_svg/svg.dart';
  4.  
  5. class AppLogo extends StatelessWidget {
  6.   const AppLogo({
  7.     Key? key,
  8.     this.vertical = false,
  9.     this.horizontal = false,
  10.     this.black = false,
  11.   }) : super(key: key);
  12.  
  13.   final bool? vertical;
  14.   final bool? horizontal;
  15.   final bool? black;
  16.  
  17.   @override
  18.   Widget build(BuildContext context) {
  19.     if (black!) {
  20.       if (horizontal!) {
  21.         return Row(
  22.           mainAxisAlignment: MainAxisAlignment.center,
  23.           children: [
  24.             SvgPicture.asset('assets/brand/logo.svg'),
  25.             const SizedBox(
  26.               width: 10,
  27.             ),
  28.             SvgPicture.asset('assets/brand/white_agendai.svg'),
  29.           ],
  30.         );
  31.       } else if (vertical!) {
  32.         return Column(
  33.           mainAxisAlignment: MainAxisAlignment.center,
  34.           children: [
  35.             SvgPicture.asset('assets/brand/logo.svg'),
  36.             const SizedBox(
  37.               height: 10,
  38.             ),
  39.             SvgPicture.asset('assets/brand/white_agendai.svg'),
  40.           ],
  41.         );
  42.       } else {
  43.         return SvgPicture.asset('assets/brand/logo.svg');
  44.       }
  45.     } else {
  46.       if (horizontal!) {
  47.         return Row(
  48.           mainAxisAlignment: MainAxisAlignment.center,
  49.           children: [
  50.             SvgPicture.asset('assets/brand/logo.svg'),
  51.             const SizedBox(
  52.               width: 10,
  53.             ),
  54.             SvgPicture.asset('assets/brand/black_agendai.svg'),
  55.           ],
  56.         );
  57.       } else if (vertical!) {
  58.         return Column(
  59.           mainAxisAlignment: MainAxisAlignment.center,
  60.           children: [
  61.             SvgPicture.asset('assets/brand/logo.svg'),
  62.             const SizedBox(
  63.               height: 10,
  64.             ),
  65.             SvgPicture.asset('assets/brand/black_agendai.svg'),
  66.           ],
  67.         );
  68.       } else {
  69.         return SvgPicture.asset('assets/brand/logo.svg');
  70.       }
  71.     }
  72.   }
  73. }
Tags: flutter
Advertisement
Add Comment
Please, Sign In to add comment