~cytrogen/fluent-reader-mobile

ref: 32b630c0ebb868af399e1e1a81fae63696d9bca9 fluent-reader-mobile/lib/components/dismissible_background.dart -rw-r--r-- 708 bytes
32b630c0 — Bruce Liu update dependencies 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import 'package:flutter/cupertino.dart';

class DismissibleBackground extends StatelessWidget {
  final IconData icon;
  final bool isToRight;

  DismissibleBackground(this.icon, this.isToRight, {Key key})
    : super(key: key);

  @override
  Widget build(BuildContext context) => Container(
    color: CupertinoColors.systemGrey5.resolveFrom(context),
    padding: EdgeInsets.symmetric(horizontal: 24),
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: isToRight
        ? CrossAxisAlignment.start
        : CrossAxisAlignment.end,
      children: [Icon(
        icon,
        color: CupertinoColors.secondaryLabel.resolveFrom(context),
      )],
    ),
  );
}