新增代码文件支持行号显示

This commit is contained in:
jyuesong
2022-06-15 11:05:49 +08:00
parent 4e3f8a0df9
commit 2005083d2e
117 changed files with 4625 additions and 136 deletions

View File

@@ -2,10 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:qinglong_app/base/routes.dart';
import 'package:qinglong_app/base/sp_const.dart';
import 'package:qinglong_app/base/theme.dart';
import 'package:qinglong_app/base/userinfo_viewmodel.dart';
import 'package:qinglong_app/main.dart';
import 'package:qinglong_app/utils/extension.dart';
import 'package:qinglong_app/utils/sp_utils.dart';
class OtherPage extends ConsumerStatefulWidget {
const OtherPage({Key? key}) : super(key: key);
@@ -175,6 +177,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
const Divider(
indent: 15,
),
GestureDetector(
onTap: () {
if (getIt<UserInfoViewModel>().useSecretLogined) {
@@ -251,10 +254,42 @@ class _OtherPageState extends ConsumerState<OtherPage> {
],
),
),
const Divider(
indent: 15,
),
Padding(
padding: const EdgeInsets.only(
left: 15,
right: 15,
bottom: 5,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"查看代码是否显示行号",
style: TextStyle(
color: ref.watch(themeProvider).themeColor.titleColor(),
fontSize: 16,
),
),
const Spacer(),
CupertinoSwitch(
activeColor: ref.watch(themeProvider).primaryColor,
value: SpUtil.getBool(spShowLine, defValue: false),
onChanged: (open) async {
await SpUtil.putBool(spShowLine, open);
setState(() {});
},
),
],
),
),
const Divider(
indent: 15,
height: 1,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@@ -265,7 +300,7 @@ class _OtherPageState extends ConsumerState<OtherPage> {
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 5,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,