Showing
3 changed files
with
61 additions
and
24 deletions
| ... | @@ -144,7 +144,7 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver { | ... | @@ -144,7 +144,7 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver { |
| 144 | title: "每日一言", | 144 | title: "每日一言", |
| 145 | poem: | 145 | poem: |
| 146 | "清晨入古寺,初日照高林。\n曲径通幽处,禅房花木深。\n山光悦鸟性,潭影空人心。\n万籁此都寂,但余钟磬音。\n", | 146 | "清晨入古寺,初日照高林。\n曲径通幽处,禅房花木深。\n山光悦鸟性,潭影空人心。\n万籁此都寂,但余钟磬音。\n", |
| 147 | - author: "--《题破山寺后禅院》常建", | 147 | + author: "----《题破山寺后禅院》常建", |
| 148 | onShowDetail: () { | 148 | onShowDetail: () { |
| 149 | tkController.animateToPage(TikTokPagePosition.right); | 149 | tkController.animateToPage(TikTokPagePosition.right); |
| 150 | }, | 150 | }, | ... | ... |
| 1 | import 'dart:ui'; | 1 | import 'dart:ui'; |
| 2 | 2 | ||
| 3 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | +import 'package:one_poem/res/resources.dart'; | ||
| 4 | 5 | ||
| 5 | class TikTokTopInfoColumn extends StatelessWidget { | 6 | class TikTokTopInfoColumn extends StatelessWidget { |
| 6 | final double? bottomPadding; | 7 | final double? bottomPadding; |
| ... | @@ -16,7 +17,7 @@ class TikTokTopInfoColumn extends StatelessWidget { | ... | @@ -16,7 +17,7 @@ class TikTokTopInfoColumn extends StatelessWidget { |
| 16 | return SafeArea( | 17 | return SafeArea( |
| 17 | child: Container( | 18 | child: Container( |
| 18 | margin: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 25.0), | 19 | margin: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 25.0), |
| 19 | - height: 100.0, | 20 | + height: 90.0, |
| 20 | width: double.infinity, | 21 | width: double.infinity, |
| 21 | decoration: BoxDecoration( | 22 | decoration: BoxDecoration( |
| 22 | color: Colors.grey.shade200.withOpacity(0.1), | 23 | color: Colors.grey.shade200.withOpacity(0.1), |
| ... | @@ -30,18 +31,45 @@ class TikTokTopInfoColumn extends StatelessWidget { | ... | @@ -30,18 +31,45 @@ class TikTokTopInfoColumn extends StatelessWidget { |
| 30 | sigmaY: 10.0, | 31 | sigmaY: 10.0, |
| 31 | ), | 32 | ), |
| 32 | child: Container( | 33 | child: Container( |
| 34 | + alignment: Alignment.topLeft, | ||
| 33 | decoration: BoxDecoration( | 35 | decoration: BoxDecoration( |
| 34 | color: Colors.grey.shade200.withOpacity(0.1), | 36 | color: Colors.grey.shade200.withOpacity(0.1), |
| 35 | ), | 37 | ), |
| 36 | child: Padding( | 38 | child: Padding( |
| 37 | - padding: const EdgeInsets.all(10.0), | 39 | + padding: const EdgeInsets.all(5.0), |
| 38 | child: Column( | 40 | child: Column( |
| 39 | - children: const [ | 41 | + children: [ |
| 40 | - Text( | 42 | + const SizedBox( |
| 41 | - '早安', | 43 | + width: double.infinity, |
| 42 | - style: TextStyle( | 44 | + child: Text( |
| 43 | - fontSize: 28.0, | 45 | + '辛丑牛年 庚子月 乙卯日 辰时', |
| 44 | - color: Colors.white, | 46 | + style: TextStyle( |
| 47 | + fontSize: 16.0, | ||
| 48 | + color: Colors.white, | ||
| 49 | + ), | ||
| 50 | + ), | ||
| 51 | + ), | ||
| 52 | + Gaps.vGap10, | ||
| 53 | + SizedBox( | ||
| 54 | + width: double.infinity, | ||
| 55 | + child: Stack( | ||
| 56 | + children: const [ | ||
| 57 | + Text( | ||
| 58 | + '早安', | ||
| 59 | + style: TextStyle( | ||
| 60 | + fontSize: 48.0, | ||
| 61 | + color: Colors.white, | ||
| 62 | + fontFamily: "ZhiMangXing", | ||
| 63 | + ), | ||
| 64 | + ), | ||
| 65 | + Positioned( | ||
| 66 | + right: 10.0, | ||
| 67 | + child: Text( | ||
| 68 | + "02日\n2022年01月", | ||
| 69 | + style: TextStyle(color: Colors.white), | ||
| 70 | + ), | ||
| 71 | + ), | ||
| 72 | + ], | ||
| 45 | ), | 73 | ), |
| 46 | ), | 74 | ), |
| 47 | ], | 75 | ], | ... | ... |
| ... | @@ -4,6 +4,8 @@ import 'package:flutter/cupertino.dart'; | ... | @@ -4,6 +4,8 @@ import 'package:flutter/cupertino.dart'; |
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:one_poem/res/resources.dart'; | 5 | import 'package:one_poem/res/resources.dart'; |
| 6 | 6 | ||
| 7 | +import 'package:one_poem/extension/int_extension.dart'; | ||
| 8 | + | ||
| 7 | class TikTokVidePoem extends StatelessWidget { | 9 | class TikTokVidePoem extends StatelessWidget { |
| 8 | final double? bottomPadding; | 10 | final double? bottomPadding; |
| 9 | final Function? onShowDetail; | 11 | final Function? onShowDetail; |
| ... | @@ -27,9 +29,9 @@ class TikTokVidePoem extends StatelessWidget { | ... | @@ -27,9 +29,9 @@ class TikTokVidePoem extends StatelessWidget { |
| 27 | border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度 | 29 | border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度 |
| 28 | // borderRadius: BorderRadius.circular(2.0), | 30 | // borderRadius: BorderRadius.circular(2.0), |
| 29 | ), | 31 | ), |
| 30 | - height: 220.0, | 32 | + height: 180.px, |
| 31 | width: double.infinity, | 33 | width: double.infinity, |
| 32 | - margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0), | 34 | + margin: EdgeInsets.symmetric(vertical: 10.px, horizontal: 25.px), |
| 33 | child: InkWell( | 35 | child: InkWell( |
| 34 | child: ClipRect( | 36 | child: ClipRect( |
| 35 | child: BackdropFilter( | 37 | child: BackdropFilter( |
| ... | @@ -42,29 +44,36 @@ class TikTokVidePoem extends StatelessWidget { | ... | @@ -42,29 +44,36 @@ class TikTokVidePoem extends StatelessWidget { |
| 42 | color: Colors.grey.shade200.withOpacity(0.1), | 44 | color: Colors.grey.shade200.withOpacity(0.1), |
| 43 | ), | 45 | ), |
| 44 | child: Padding( | 46 | child: Padding( |
| 45 | - padding: const EdgeInsets.all(5.0), | 47 | + padding: EdgeInsets.all(5.px), |
| 46 | child: Column( | 48 | child: Column( |
| 47 | children: [ | 49 | children: [ |
| 48 | - Text( | 50 | + SizedBox( |
| 49 | - title ?? '每日一言', | 51 | + width: double.infinity, |
| 50 | - style: const TextStyle( | 52 | + child: Text( |
| 51 | - fontSize: 28.0, | 53 | + title ?? '每日一言', |
| 52 | - color: Colors.white, | 54 | + style: TextStyle( |
| 55 | + fontSize: 28.px, | ||
| 56 | + color: Colors.white, | ||
| 57 | + ), | ||
| 53 | ), | 58 | ), |
| 54 | ), | 59 | ), |
| 55 | Gaps.vGap10, | 60 | Gaps.vGap10, |
| 56 | Text( | 61 | Text( |
| 57 | poem ?? '#一言 临境', | 62 | poem ?? '#一言 临境', |
| 58 | - style: const TextStyle( | 63 | + style: TextStyle( |
| 59 | color: Colors.white, | 64 | color: Colors.white, |
| 60 | fontFamily: "ZCOOLXiaoWei", | 65 | fontFamily: "ZCOOLXiaoWei", |
| 61 | - fontSize: 24.0), | 66 | + fontSize: 20.px), |
| 62 | ), | 67 | ), |
| 63 | - Text( | 68 | + Container( |
| 64 | - author ?? '诗人', | 69 | + alignment: Alignment.centerRight, |
| 65 | - style: const TextStyle( | 70 | + width: double.infinity, |
| 66 | - fontSize: 16.0, | 71 | + child: Text( |
| 67 | - color: Colors.white, | 72 | + author ?? '诗人', |
| 73 | + style: TextStyle( | ||
| 74 | + fontSize: 16.px, | ||
| 75 | + color: Colors.white, | ||
| 76 | + ), | ||
| 68 | ), | 77 | ), |
| 69 | ), | 78 | ), |
| 70 | ], | 79 | ], | ... | ... |
-
Please register or login to post a comment