hottabych

dialog example

Nov 14th, 2020
1,010
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3.  
  4. import '../../generated/l10n.dart';
  5. import '../../models/checkup_param.dart';
  6. import '../../utils/colors.dart';
  7. import '../../widgets/analytics/cards.dart';
  8. import '../../widgets/cupertino_fullscreen_dialog_template.dart';
  9. import '../../widgets/shared/toggle.dart';
  10.  
  11. class CheckupParamScreen extends StatefulWidget {
  12.   final CheckupParam param;
  13.  
  14.   const CheckupParamScreen({Key key, @required this.param}) : super(key: key);
  15.  
  16.   @override
  17.   _CheckupParamScreenState createState() => _CheckupParamScreenState();
  18. }
  19.  
  20. class _CheckupParamScreenState extends State<CheckupParamScreen> {
  21.   int _selectedIndex = 0;
  22.  
  23.   @override
  24.   Widget build(BuildContext context) {
  25.     final headlineTextStyle = Theme.of(context).textTheme.headline3;
  26.  
  27.     return CupertinoFullscreenDialogTemplate(
  28.       title: widget.param.title,
  29.       titleWidth: 300,
  30.       content: [
  31.         Text(S.of(context).checkupParamScreenTitle, style: headlineTextStyle),
  32.         const SizedBox(height: 16),
  33.         Toggle(
  34.           tabs: [
  35.             Text(S.of(context).checkupParamSelectorCurrentLabel),
  36.             Text(S.of(context).checkupParamSelectorComparisonLabel),
  37.           ],
  38.           onChanged: (index) => setState(() => _selectedIndex = index),
  39.         ),
  40.         const SizedBox(
  41.           height: 16,
  42.         ),
  43.         Text(S.of(context).checkupParamScreenDescriptionTitle, style: headlineTextStyle),
  44.  
  45.         const SizedBox(
  46.           height: 24,
  47.         ),
  48.         AnimatedSwitcher(
  49.           duration: Duration(milliseconds: 300),
  50.           child: _selectedIndex == 0
  51.               ? Padding(
  52.                 padding: const EdgeInsets.only(bottom: 32),
  53.                 child: ParamCard(checkupParam: widget.param, showTitle: false,),
  54.               )
  55.               : Padding(
  56.                 padding: const EdgeInsets.only(bottom: 24),
  57.                 child: Placeholder(
  58.             color: lightBlue,
  59.             fallbackHeight: 215,
  60.           ),
  61.               ),
  62.         ),
  63.         Text('We take the unique data based on your multi-parameter blood test and create a bespoke supplementation formula delivering a complete range of key micronutrients to your body. Watch your progress in real-time using the proprietary bioniq health monitoring platform.'
  64.             'We take the unique data based on your multi-parameter blood test and create a bespoke supplementation formula delivering a complete',
  65.             style: Theme.of(context).textTheme.subtitle1),
  66.       ],
  67.     );
  68.   }
  69. }
  70.  
RAW Paste Data