@@ -412,78 +412,78 @@ class WordCard extends StatelessWidget {
412412 Widget build (BuildContext context) {
413413 MediaQueryData mediaQuery = MediaQuery .of (context);
414414 bool hide = useMask;
415- return Container (
416- margin: const EdgeInsets .all (16.0 ),
417- //padding: const EdgeInsets.all(16.0),
418- width: width ?? (mediaQuery.size.width * 0.9 ),
419- height: height ?? (mediaQuery.size.height * 0.5 ),
420- decoration: BoxDecoration (
421- color: Theme .of (context).colorScheme.onInverseSurface.withAlpha (150 ),
422- borderRadius: StaticsVar .br,
423- ),
424- child: Column (
425- mainAxisAlignment: MainAxisAlignment .start,
426- children: [
427- ElevatedButton .icon (
428- style: ElevatedButton .styleFrom (
429- fixedSize: Size (width ?? (mediaQuery.size.width * 0.9 ), height == null ? (mediaQuery.size.height * 0.2 ) : height! * 0.4 ),
430- backgroundColor: Theme .of (context).colorScheme.onPrimary.withAlpha (150 ),
431- shape: RoundedRectangleBorder (borderRadius: StaticsVar .br),
432- padding: const EdgeInsets .all (16.0 ),
433- ),
434- icon: const Icon (Icons .volume_up, size: 24.0 ),
435- label: FittedBox (child: Text (word["arabic" ], style: TextStyle (fontSize: 64.0 , fontFamily: context.read <Global >().arFont))),
436- onPressed: (){
437- playTextToSpeech (word["arabic" ], context);
438- },
415+ double useWidth = width ?? mediaQuery.size.width * 0.9 ;
416+ double useHeight = height ?? mediaQuery.size.height * 0.5 ;
417+ return Column (
418+ mainAxisAlignment: MainAxisAlignment .start,
419+ children: [
420+ ElevatedButton .icon (
421+ style: ElevatedButton .styleFrom (
422+ fixedSize: Size (useWidth, useHeight * 0.3 ),
423+ backgroundColor: Theme .of (context).colorScheme.onPrimary.withAlpha (150 ),
424+ shape: RoundedRectangleBorder (borderRadius: BorderRadiusGeometry .vertical (top: Radius .circular (25.0 ))),
425+ padding: const EdgeInsets .all (16.0 ),
439426 ),
440- Stack (
441- children: [
442- Center (
427+ icon: const Icon (Icons .volume_up, size: 24.0 ),
428+ label: FittedBox (child: Text (word["arabic" ], style: TextStyle (fontSize: 64.0 , fontFamily: context.read <Global >().arFont))),
429+ onPressed: (){
430+ playTextToSpeech (word["arabic" ], context);
431+ },
432+ ),
433+ Stack (
434+ children: [
435+ Container (
436+ width: useWidth,
437+ height: useHeight * 0.6 ,
438+ decoration: BoxDecoration (
439+ color: Theme .of (context).colorScheme.onInverseSurface.withAlpha (150 ),
440+ borderRadius: BorderRadius .vertical (bottom: Radius .circular (25.0 )),
441+ ),
442+ child: Center (
443443 child: Text (' 中文:${word ["chinese" ]}\n 示例:${word ["explanation" ]}\n 归属课程:${word ["subClass" ]}' ,
444444 style: Theme .of (context).textTheme.bodyLarge,
445445 textAlign: TextAlign .left,
446446 ),
447447 ),
448- StatefulBuilder (
449- builder: (context, setLocalState) {
450- return TweenAnimationBuilder <double >(
451- tween: Tween (
452- begin: 1.0 ,
453- end: hide ? 1.0 : 0.0
454- ),
455- duration: Duration (milliseconds: 500 ),
456- curve: StaticsVar .curve,
457- builder: (context, value, child) {
458- return ClipRRect (
459- borderRadius: BorderRadiusGeometry .vertical (bottom: Radius .circular (25.0 )),
460- child: BackdropFilter (
461- filter: ImageFilter .blur (sigmaX: 10.0 * value,sigmaY: 10.0 * value),
462- enabled: true ,
463- child: value == 0.0 ? null : ElevatedButton (
464- style: ElevatedButton .styleFrom (
465- fixedSize: Size (width ?? (mediaQuery.size.width * 0.9 ), height == null ? (mediaQuery.size.height * 0.3 ) : height! * 0.6 ),
466- backgroundColor: Colors .transparent,
467- shape: RoundedRectangleBorder (borderRadius: BorderRadiusGeometry .vertical (bottom: Radius .circular (25.0 )))
468- ),
469- onPressed: (){
470- setLocalState (() {
471- hide = false ;
472- },);
473- },
474- child: hide ? Text ("点此查看释义" ) : SizedBox ()
448+ ),
449+ StatefulBuilder (
450+ builder: (context, setLocalState) {
451+ return TweenAnimationBuilder <double >(
452+ tween: Tween (
453+ begin: 1.0 ,
454+ end: hide ? 1.0 : 0.0
455+ ),
456+ duration: Duration (milliseconds: 500 ),
457+ curve: StaticsVar .curve,
458+ builder: (context, value, child) {
459+ return ClipRRect (
460+ borderRadius: BorderRadiusGeometry .vertical (bottom: Radius .circular (25.0 )),
461+ child: BackdropFilter (
462+ filter: ImageFilter .blur (sigmaX: 10.0 * value,sigmaY: 10.0 * value),
463+ enabled: true ,
464+ child: value == 0.0 ? null : ElevatedButton (
465+ style: ElevatedButton .styleFrom (
466+ fixedSize: Size (useWidth, useHeight * 0.6 ),
467+ backgroundColor: Colors .transparent,
468+ shadowColor: Colors .transparent,
469+ shape: RoundedRectangleBorder (borderRadius: BorderRadiusGeometry .vertical (bottom: Radius .circular (25.0 )))
475470 ),
471+ onPressed: (){
472+ setLocalState (() {
473+ hide = false ;
474+ },);
475+ },
476+ child: hide ? Text ("点此查看释义" ) : SizedBox ()
476477 ),
477- );
478- },
479- );
480- }
481- )
482- ],
483- )
484-
485- ],
486- )
478+ ),
479+ );
480+ },
481+ );
482+ }
483+ )
484+ ],
485+ )
486+ ],
487487 );
488488 }
489489}
0 commit comments