@override
Widget build(BuildContext context) {
final TelegramWebApp telegram = TelegramWebApp.instance;
return Scaffold(
backgroundColor: telegram.backgroundColor ?? Colors.grey,
appBar: TeleAppbar(title: 'Flutter Telegram Demo', top: safeAreaTop),
body: ListView(
padding: const EdgeInsets.all(8),
children: [
ListButton('Expand', onPress: telegram.expand),
InfoExpandableTile(
'Init Data',
telegram.initData.toString(),
),
InfoExpandableTile(
'Init Data Unsafe',
telegram.initDataUnsafe?.toReadableString() ?? 'null',
),
InfoExpandableTile(
'isVerticalSwipesEnabled',
telegram.isVerticalSwipesEnabled.toString(),
),
ListButton('enableVerticalSwipes', onPress: telegram.enableVerticalSwipes),
ListButton('disableVerticalSwipes', onPress: telegram.disableVerticalSwipes),
InfoExpandableTile('Version', telegram.version),
InfoExpandableTile('Platform', telegram.platform),
InfoExpandableTile('Color Scheme', telegram.colorScheme.name),
ThemeParamsWidget(telegram.themeParams),
InfoExpandableTile('isActive', telegram.isActive.toString()),
InfoExpandableTile('isExpanded', telegram.isExpanded.toString()),
InfoExpandableTile('viewportHeight', telegram.viewportHeight.toString()),
InfoExpandableTile('viewportStableHeight', telegram.viewportStableHeight.toString()),
InfoExpandableTile('safeAreaInset', telegram.safeAreaInset.toString()),
InfoExpandableTile('contentSafeAreaInset', telegram.contentSafeAreaInset.toString()),
OneColorExpandableTile('headerColor', telegram.headerColor),
OneColorExpandableTile('backgroundColor', telegram.backgroundColor),
OneColorExpandableTile('bottomBarColor', telegram.bottomBarColor),
],
),
);
}