| 1 | import 'dart:ui'; |
| 2 | |
| 3 | import 'package:cake_wallet/src/screens/base_page.dart'; |
| 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:flutter/services.dart'; |
| 6 | |
| 7 | class ThirdPartyDisclaimerPage extends BasePage { |
| 8 | ThirdPartyDisclaimerPage({this.title = "Disclaimer"}); |
| 9 | |
| 10 | @override |
| 11 | final String title; |
| 12 | |
| 13 | final String filePath = 'assets/text/disclaimer_deuro.txt'; |
| 14 | |
| 15 | @override |
| 16 | Widget body(BuildContext context) => _ThirdPartyDisclaimerPageBody(filePath: filePath); |
| 17 | } |
| 18 | |
| 19 | class _ThirdPartyDisclaimerPageBody extends StatefulWidget { |
| 20 | _ThirdPartyDisclaimerPageBody({required this.filePath}); |
| 21 | |
| 22 | final String filePath; |
| 23 | |
| 24 | @override |
| 25 | _ThirdPartyDisclaimerPageBodyState createState() => _ThirdPartyDisclaimerPageBodyState(); |
| 26 | } |
| 27 | |
| 28 | class _ThirdPartyDisclaimerPageBodyState extends State<_ThirdPartyDisclaimerPageBody> { |
| 29 | String _fileText = ''; |
| 30 | |
| 31 | void getFileLines() => |
| 32 | rootBundle.loadString(widget.filePath).then((text) => setState(() => _fileText = text)); |
| 33 | |
| 34 | @override |
| 35 | void initState() { |
| 36 | super.initState(); |
| 37 | getFileLines(); |
| 38 | } |
| 39 | |
| 40 | @override |
| 41 | Widget build(BuildContext context) => Container( |
| 42 | color: Theme.of(context).colorScheme.surface, |
| 43 | child: Column( |
| 44 | children: <Widget>[ |
| 45 | SizedBox(height: 10.0), |
| 46 | Expanded( |
| 47 | child: Stack( |
| 48 | children: <Widget>[ |
| 49 | SingleChildScrollView( |
| 50 | padding: EdgeInsets.only(left: 24.0, right: 24.0), |
| 51 | child: Column( |
| 52 | children: <Widget>[ |
| 53 | Row( |
| 54 | children: <Widget>[ |
| 55 | Expanded( |
| 56 | child: Text( |
| 57 | _fileText, |
| 58 | style: Theme.of(context).textTheme.bodySmall, |
| 59 | )) |
| 60 | ], |
| 61 | ), |
| 62 | SizedBox( |
| 63 | height: 16.0, |
| 64 | ), |
| 65 | ], |
| 66 | ), |
| 67 | ), |
| 68 | Container( |
| 69 | alignment: Alignment.bottomCenter, |
| 70 | child: Container( |
| 71 | height: 12, |
| 72 | child: ClipRect( |
| 73 | child: BackdropFilter( |
| 74 | filter: ImageFilter.blur(sigmaX: 0.7, sigmaY: 0.7), |
| 75 | child: Container( |
| 76 | decoration: BoxDecoration( |
| 77 | gradient: LinearGradient( |
| 78 | colors: [ |
| 79 | Theme.of(context).colorScheme.surface.withAlpha(0), |
| 80 | Theme.of(context).colorScheme.surface, |
| 81 | ], |
| 82 | begin: FractionalOffset.topCenter, |
| 83 | end: FractionalOffset.bottomCenter, |
| 84 | ), |
| 85 | ), |
| 86 | ), |
| 87 | ), |
| 88 | ), |
| 89 | ), |
| 90 | ) |
| 91 | ], |
| 92 | ), |
| 93 | ), |
| 94 | ], |
| 95 | ), |
| 96 | ); |
| 97 | } |