-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 初始界面改为 Visibility - 登录后面板添加一个状态标志避免重复请求 - 将自定义颜色种子改为 Material 颜色选取
- Loading branch information
Showing
26 changed files
with
329 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Flutter imports: | ||
import 'package:flutter/material.dart'; | ||
|
||
class ColorUtils { | ||
/// 将 Color 转为 HexCode | ||
static String colorToHex(Color color) => color.value.toRadixString(16).padLeft(8, '0').toUpperCase(); | ||
|
||
/// 将 HexCode 转为 Color | ||
static Color hexToColor(String hexString) { | ||
final buffer = StringBuffer(); | ||
if (hexString.length == 6 || hexString.length == 7) buffer.write('ff'); | ||
buffer.write(hexString.replaceFirst('#', '')); | ||
return Color(int.parse(buffer.toString(), radix: 16)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Flutter imports: | ||
import 'package:flutter/material.dart'; | ||
|
||
// Package imports: | ||
import 'package:flutter_colorpicker/flutter_colorpicker.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
Widget colorPickDialog( | ||
BuildContext context, { | ||
required Color pickerColor, | ||
Function(Color)? onPrimaryChanged, | ||
required Function(Color) onColorChanged, | ||
}) { | ||
return AlertDialog( | ||
title: const Text('选取一个颜色'), | ||
content: SizedBox( | ||
width: 400.0, | ||
child: Container( | ||
margin: EdgeInsets.only(left: 25, right: 20), | ||
child: MaterialPicker( | ||
pickerColor: pickerColor, | ||
portraitOnly: true, | ||
enableLabel: true, | ||
onPrimaryChanged: onPrimaryChanged, | ||
onColorChanged: onColorChanged, | ||
), | ||
), | ||
), | ||
actions: [ | ||
ElevatedButton( | ||
onPressed: () => Get.close(0), | ||
child: Text('完成'), | ||
), | ||
], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.