Line data Source code
1 : import 'package:flutter/material.dart'; 2 : import 'package:widgetbook/src/constants/brand_constants.dart'; 3 : import 'package:url_launcher/url_launcher.dart'; 4 : import 'package:widgetbook/src/providers/theme_provider.dart'; 5 : import '../utils/extensions.dart'; 6 : 7 : class BrandHandle extends StatelessWidget { 8 10 : const BrandHandle({Key? key}) : super(key: key); 9 : 10 0 : @override 11 : Widget build(BuildContext context) { 12 0 : var themeProvider = ThemeProvider.of(context)!; 13 0 : return Row( 14 0 : children: [ 15 : // TODO add an own widget for this 16 : // or style the text button.icon appropriately 17 : // TODO make sure the onPresses is triggered on the text as well 18 0 : TextButton( 19 0 : onPressed: () async { 20 0 : if (await canLaunch(BrandConstants.discord)) { 21 0 : await launch(BrandConstants.discord); 22 : } 23 : }, 24 0 : style: TextButton.styleFrom( 25 : splashFactory: InkRipple.splashFactory, 26 : shape: 27 0 : RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)), 28 : minimumSize: Size.zero, 29 : padding: const EdgeInsets.all(12), 30 : ), 31 0 : child: Icon( 32 : Icons.question_answer, 33 0 : color: themeProvider.state == ThemeMode.light 34 0 : ? context.theme.hintColor 35 0 : : context.colorScheme.primary, 36 : ), 37 : ), 38 : const SizedBox( 39 : width: 4, 40 : ), 41 : const Text('discord'), 42 : ], 43 : ); 44 : } 45 : }