|
1 | 1 | import 'package:flutter/material.dart'; |
2 | 2 | import 'package:flutter_inappwebview/flutter_inappwebview.dart'; |
| 3 | +import 'package:flutter_scroll_shadow/flutter_scroll_shadow.dart'; |
3 | 4 | import 'package:freecodecamp/enums/panel_type.dart'; |
4 | 5 | import 'package:freecodecamp/extensions/i18n_extension.dart'; |
5 | 6 | import 'package:freecodecamp/models/learn/challenge_model.dart'; |
@@ -473,58 +474,33 @@ class SymbolBar extends StatelessWidget { |
473 | 474 | margin: const EdgeInsets.only(bottom: 8), |
474 | 475 | height: 50, |
475 | 476 | color: const Color(0xFF1b1b32), |
476 | | - child: Stack( |
477 | | - children: [ |
478 | | - ListView.builder( |
479 | | - scrollDirection: Axis.horizontal, |
480 | | - controller: model.symbolBarScrollController, |
481 | | - itemCount: symbols.length, |
482 | | - itemBuilder: (context, index) { |
483 | | - return Padding( |
484 | | - padding: const EdgeInsets.symmetric( |
485 | | - vertical: 4, |
486 | | - horizontal: 1, |
487 | | - ), |
488 | | - child: TextButton( |
489 | | - onPressed: () { |
490 | | - model.insertSymbol(symbols[index], editor); |
491 | | - }, |
492 | | - style: TextButton.styleFrom( |
493 | | - shape: const RoundedRectangleBorder( |
494 | | - borderRadius: BorderRadius.all(Radius.zero), |
495 | | - ), |
496 | | - ), |
497 | | - child: Text(symbols[index]), |
498 | | - ), |
499 | | - ); |
500 | | - }, |
501 | | - ), |
502 | | - if (model.symbolBarIsScrollable) |
503 | | - Row( |
504 | | - children: [ |
505 | | - Expanded( |
506 | | - child: Align( |
507 | | - alignment: Alignment.centerRight, |
508 | | - child: Container( |
509 | | - width: 15, |
510 | | - height: 66, |
511 | | - foregroundDecoration: BoxDecoration( |
512 | | - gradient: LinearGradient( |
513 | | - begin: Alignment.centerLeft, |
514 | | - end: Alignment.centerRight, |
515 | | - colors: [ |
516 | | - Colors.white.withValues(alpha: 0.13), |
517 | | - Colors.white.withValues(alpha: 0.23), |
518 | | - Colors.white.withValues(alpha: 0.33), |
519 | | - ], |
520 | | - ), |
521 | | - ), |
522 | | - ), |
| 477 | + child: ScrollShadow( |
| 478 | + size: 12, |
| 479 | + child: ListView.builder( |
| 480 | + scrollDirection: Axis.horizontal, |
| 481 | + controller: model.symbolBarScrollController, |
| 482 | + padding: const EdgeInsets.symmetric(horizontal: 8), |
| 483 | + itemCount: symbols.length, |
| 484 | + itemBuilder: (context, index) { |
| 485 | + return Padding( |
| 486 | + padding: const EdgeInsets.symmetric( |
| 487 | + vertical: 4, |
| 488 | + horizontal: 1, |
| 489 | + ), |
| 490 | + child: TextButton( |
| 491 | + onPressed: () { |
| 492 | + model.insertSymbol(symbols[index], editor); |
| 493 | + }, |
| 494 | + style: TextButton.styleFrom( |
| 495 | + shape: const RoundedRectangleBorder( |
| 496 | + borderRadius: BorderRadius.all(Radius.zero), |
523 | 497 | ), |
524 | 498 | ), |
525 | | - ], |
526 | | - ), |
527 | | - ], |
| 499 | + child: Text(symbols[index]), |
| 500 | + ), |
| 501 | + ); |
| 502 | + }, |
| 503 | + ), |
528 | 504 | ), |
529 | 505 | ); |
530 | 506 | } |
|
0 commit comments