| 1 | import 'package:cake_wallet/src/screens/yat/widgets/yat_bar.dart'; |
| 2 | import 'package:cake_wallet/src/screens/yat/widgets/yat_page_indicator.dart'; |
| 3 | import 'package:cake_wallet/src/widgets/primary_button.dart'; |
| 4 | import 'package:cake_wallet/src/widgets/scrollable_with_bottom_section.dart'; |
| 5 | import 'package:flutter/material.dart'; |
| 6 | import 'package:lottie/lottie.dart'; |
| 7 | import 'package:cake_wallet/generated/i18n.dart'; |
| 8 | |
| 9 | class SecondIntroduction extends StatelessWidget { |
| 10 | SecondIntroduction({required this.onNext, this.onClose}); |
| 11 | |
| 12 | final VoidCallback? onClose; |
| 13 | final VoidCallback onNext; |
| 14 | final animation = Lottie.asset('assets/animation/anim2.json'); |
| 15 | |
| 16 | @override |
| 17 | Widget build(BuildContext context) { |
| 18 | final screenHeight = MediaQuery.of(context).size.height; |
| 19 | final screenWidth = MediaQuery.of(context).size.width; |
| 20 | |
| 21 | return Container( |
| 22 | height: screenHeight, |
| 23 | width: screenWidth, |
| 24 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 25 | child: ScrollableWithBottomSection( |
| 26 | contentPadding: EdgeInsets.only(top: 40, bottom: 40), |
| 27 | content: Column( |
| 28 | children: [ |
| 29 | Container( |
| 30 | height: 45, |
| 31 | padding: EdgeInsets.only(left: 24, right: 24), |
| 32 | child: YatBar(onClose: onClose)), |
| 33 | animation, |
| 34 | Padding( |
| 35 | padding: EdgeInsets.only(top: 40, left: 30, right: 30), |
| 36 | child: Column(children: [ |
| 37 | Text(S.of(context).second_intro_title, |
| 38 | textAlign: TextAlign.center, |
| 39 | style: Theme.of(context).textTheme.bodyMedium!.copyWith( |
| 40 | fontSize: 24, |
| 41 | fontWeight: FontWeight.bold, |
| 42 | color: Theme.of(context).colorScheme.onSurface, |
| 43 | decoration: TextDecoration.none, |
| 44 | )), |
| 45 | Padding( |
| 46 | padding: EdgeInsets.only(top: 20), |
| 47 | child: Text(S.of(context).second_intro_content, |
| 48 | textAlign: TextAlign.center, |
| 49 | style: Theme.of(context).textTheme.bodyMedium!.copyWith( |
| 50 | fontSize: 16, |
| 51 | fontWeight: FontWeight.normal, |
| 52 | color: Theme.of(context).colorScheme.onSurface, |
| 53 | decoration: TextDecoration.none, |
| 54 | ))) |
| 55 | ]), |
| 56 | ), |
| 57 | ], |
| 58 | ), |
| 59 | bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24), |
| 60 | bottomSection: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ |
| 61 | PrimaryButton( |
| 62 | text: S.of(context).restore_next, |
| 63 | textColor: Theme.of(context).colorScheme.onPrimary, |
| 64 | color: Theme.of(context).colorScheme.primary, |
| 65 | onPressed: onNext), |
| 66 | Padding(padding: EdgeInsets.only(top: 24), child: YatPageIndicator(filled: 1)) |
| 67 | ]), |
| 68 | )); |
| 69 | } |
| 70 | } |