~cytrogen/fluent-reader-mobile

ref: 06e740abdfab1698e03bc0d4ad921b2c5a7161af fluent-reader-mobile/lib/pages/setup_page.dart -rw-r--r-- 1.9 KiB
06e740ab — 刘浩远 add inoreader support 5 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'package:fluent_reader_lite/components/list_tile_group.dart';
import 'package:fluent_reader_lite/components/my_list_tile.dart';
import 'package:fluent_reader_lite/generated/l10n.dart';
import 'package:fluent_reader_lite/utils/colors.dart';
import 'package:fluent_reader_lite/utils/global.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';

class SetupPage extends StatelessWidget {
  void _configure(BuildContext context, String route) {
    Navigator.of(context).pushNamed(route);
  }

  @override
  Widget build(BuildContext context) {
    final welcomeStyle = TextStyle(
      color: CupertinoColors.label.resolveFrom(context),
      fontSize: 24,
      fontWeight: FontWeight.bold,
      height: 1.5,
    );
    final top = Container(
      padding: EdgeInsets.symmetric(vertical: 100),
      child: Column(
        children: [
          Image.asset("assets/icons/logo.png", width: 80, height: 80),
          Text(S.of(context).welcome, style: welcomeStyle),
        ],
      ),
    );
    final services = ListTileGroup([
      MyListTile(
        title: Text("Fever API"),
        onTap: () { _configure(context, "/settings/service/fever"); },
      ),
      MyListTile(
        title: Text("Google Reader API"),
      ),
      MyListTile(
        title: Text("Inoreader"),
        onTap: () { _configure(context, "/settings/service/inoreader"); },
      ),
      MyListTile(
        title: Text("Feedbin"),
        onTap: () { _configure(context, "/settings/service/feedbin"); },
      ),
    ], title: S.of(context).service);
    final page = CupertinoPageScaffold(
      backgroundColor: MyColors.background,
      child: ListView(children: [
        top,
        services,
      ]),
    );
    final b = Global.currentBrightness(context) == Brightness.light;
    return AnnotatedRegion<SystemUiOverlayStyle>(
      value: b ? SystemUiOverlayStyle.dark : SystemUiOverlayStyle.light,
      child: page,
    );
  }
}