import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:touch_demonstrator/src/blocs/BlocProvider.dart'; //bloc: class LogoWithText extends StatelessWidget { final _heightLogo; LogoWithText(this._heightLogo); @override Widget build(BuildContext context) { return Column( children: [ TextAboveLogo(), Logo(_heightLogo), ], ); } } class Logo extends StatelessWidget { final _heightLogo; Logo(this._heightLogo); _buildLogo() { // returns Logo of PolyIC return Container( key: Key('Logo'), // for integration test height: _heightLogo, child: Center( child: Image.asset( 'assets/PolyIC/PolyIC_Logo.png', ), ), ); } @override Widget build(BuildContext context) { final debugBloc = BlocProvider.of(context).debugBlocGetter; return Hero( tag: 'logoHero', child: Padding( padding: EdgeInsets.all(10.0), child: GestureDetector( onTap: () => debugBloc.debugCounterIncrement.add(null), // onLongPress: () => debugBloc.debugEnable.add(null), child: _buildLogo()), ), ); } } class TextAboveLogo extends StatelessWidget { /// Line of text above the logo that adds information to it. static const _textStyle = TextStyle(fontSize: 18); static const _buildText = Text('Touchpad Demonstrator by', textDirection: TextDirection.ltr, style: _textStyle); @override Widget build(BuildContext context) => _buildText; }