ChenNyan 1 month ago
parent
commit
ba55aedc0f
16 changed files with 188 additions and 142 deletions
  1. BIN
      .DS_Store
  2. BIN
      android/app/src/main/res/drawable-v21/background.png
  3. 5
      android/app/src/main/res/drawable-v21/launch_background.xml
  4. BIN
      android/app/src/main/res/drawable/background.png
  5. 5
      android/app/src/main/res/drawable/launch_background.xml
  6. 19
      android/app/src/main/res/values-night-v31/styles.xml
  7. 6
      android/app/src/main/res/values-night/styles.xml
  8. 19
      android/app/src/main/res/values-v31/styles.xml
  9. 6
      android/app/src/main/res/values/styles.xml
  10. BIN
      assets/.DS_Store
  11. BIN
      assets/images/splash.png
  12. BIN
      ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png
  13. 2
      ios/Runner/Info.plist
  14. 2
      lib/pages/home/real_home_page.dart
  15. 264
      lib/pages/mine/phone_login_page.dart
  16. 2
      lib/pages/mine/real_login_page.dart

BIN
.DS_Store

BIN
android/app/src/main/res/drawable-v21/background.png

Before After
Width: 1500  |  Height: 3248  |  Size: 1.8 MiB

5
android/app/src/main/res/drawable-v21/launch_background.xml

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item>
<bitmap android:gravity="fill" android:src="@drawable/splash"/>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
</layer-list>

BIN
android/app/src/main/res/drawable/background.png

Before After
Width: 1500  |  Height: 3248  |  Size: 1.8 MiB

5
android/app/src/main/res/drawable/launch_background.xml

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item>
<bitmap android:gravity="fill" android:src="@drawable/splash"/>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
</layer-list>

19
android/app/src/main/res/values-night-v31/styles.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

6
android/app/src/main/res/values-night/styles.xml

@ -5,6 +5,10 @@
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
@ -14,4 +18,4 @@
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
</resources>

19
android/app/src/main/res/values-v31/styles.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

6
android/app/src/main/res/values/styles.xml

@ -5,6 +5,10 @@
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
@ -14,4 +18,4 @@
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
</resources>

BIN
assets/.DS_Store

BIN
assets/images/splash.png

Before After
Width: 1500  |  Height: 3248  |  Size: 1.8 MiB Width: 1500  |  Height: 3248  |  Size: 1.8 MiB

BIN
ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png

Before After
Width: 1500  |  Height: 3248  |  Size: 1.8 MiB Width: 1500  |  Height: 3248  |  Size: 1.8 MiB

2
ios/Runner/Info.plist

@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>快乐星球</string>
<string>星球奇遇记</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>

2
lib/pages/home/real_home_page.dart

@ -35,7 +35,7 @@ class _RealHomePageState extends State<RealHomePage> with AutomaticKeepAliveClie
),
Scaffold(
backgroundColor: Colors.transparent,
appBar: PageAppbar(title: "快乐星球", color: Colors.white, backgroundColor: Colors.transparent,),
appBar: PageAppbar(title: "星球奇遇记", color: Colors.white, backgroundColor: Colors.transparent,),
body: Container(
width: 375.w,
padding: EdgeInsets.symmetric(horizontal: 15.w),

264
lib/pages/mine/phone_login_page.dart

@ -16,149 +16,151 @@ class PhoneLoginPage extends StatelessWidget {
builder: (controller){
return Scaffold(
backgroundColor: Colors.white,
body: !(controller.isSend.value) ? Container(
width: 375.w,
padding: EdgeInsets.only(
top: 310.w,
left: 25.w,
right: 25.w
),
child: Column(
children: [
Container(
height: 52.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
border: Border.all(width: 1.w, color: const Color.fromRGBO(230, 230, 230, 1))
),
child: Center(
child: TextField(
decoration: const InputDecoration(
hintText: '请输入你的手机号',
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 0,
body: SingleChildScrollView(
child: !(controller.isSend.value) ? Container(
width: 375.w,
padding: EdgeInsets.only(
top: 310.w,
left: 25.w,
right: 25.w
),
child: Column(
children: [
Container(
height: 52.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
border: Border.all(width: 1.w, color: const Color.fromRGBO(230, 230, 230, 1))
),
child: Center(
child: TextField(
decoration: const InputDecoration(
hintText: '请输入你的手机号',
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 0,
),
counterText: '',
),
counterText: '',
keyboardType: TextInputType.phone,
inputFormatters: [
// 0-9
FilteringTextInputFormatter.digitsOnly,
],
maxLength: 11,
onChanged: (value) {
controller.phoneNumber.value = value;
},
style: const TextStyle(fontSize: 16),
),
keyboardType: TextInputType.phone,
inputFormatters: [
// 0-9
FilteringTextInputFormatter.digitsOnly,
],
maxLength: 11,
onChanged: (value) {
controller.phoneNumber.value = value;
},
style: const TextStyle(fontSize: 16),
),
),
),
SizedBox(height: 10.w,),
Text(
"未注册的手机号将在登录后自动注册",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(189, 189, 189, 1)
),
),
SizedBox(height: 30.w,),
Container(
width: 325.w,
height: 52.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(52.w)),
gradient: controller.phoneNumber.value.isNotEmpty ? LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(131, 89, 255, 1),
Color.fromRGBO(61, 138, 224, 1),
],
) : null,
color: const Color.fromRGBO(217, 217, 217, 1)
SizedBox(height: 10.w,),
Text(
"未注册的手机号将在登录后自动注册",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(189, 189, 189, 1)
),
),
child: Center(
child: Text(
"获取验证码",
style: TextStyle(
fontSize: 18.w,
color: Colors.white
SizedBox(height: 30.w,),
Container(
width: 325.w,
height: 52.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(52.w)),
gradient: controller.phoneNumber.value.isNotEmpty ? LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(131, 89, 255, 1),
Color.fromRGBO(61, 138, 224, 1),
],
) : null,
color: const Color.fromRGBO(217, 217, 217, 1)
),
child: Center(
child: Text(
"获取验证码",
style: TextStyle(
fontSize: 18.w,
color: Colors.white
),
),
),
).onTap(() {
controller.isSendingCode.value ||
controller.countdownSeconds.value > 0
? null
: controller.getVerificationCode();
}),
],
),
) : Container(
width: 375.w,
padding: EdgeInsets.only(
top: 271.w,
left: 25.w,
right: 25.w
),
child: Column(
children: [
Text(
"已发送到${controller.phoneNumber.value}",
style: TextStyle(
fontSize: 14.w
),
),
).onTap(() {
controller.isSendingCode.value ||
controller.countdownSeconds.value > 0
? null
: controller.getVerificationCode();
}),
],
),
) : Container(
width: 375.w,
padding: EdgeInsets.only(
top: 271.w,
left: 25.w,
right: 25.w
),
child: Column(
children: [
Text(
"已发送到${controller.phoneNumber.value}",
style: TextStyle(
fontSize: 14.w
),
),
SizedBox(height: 20.w,),
SizedBox(height: 20.w,),
Pinput(
length: 6,
controller: controller.passwordController.value,
inputFormatters: [
// 0-9
FilteringTextInputFormatter.digitsOnly,
],
onCompleted: (pin) {
controller.verificationCode.value = pin;
controller.isLoggingIn.value
? null
: controller.login();
},
),
SizedBox(height: 40.w,),
Container(
width: 325.w,
height: 52.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(52.w)),
gradient: controller.countdownSeconds.value <= 0 ? LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(131, 89, 255, 1),
Color.fromRGBO(61, 138, 224, 1),
],
) : null,
color: const Color.fromRGBO(217, 217, 217, 1)
Pinput(
length: 6,
controller: controller.passwordController.value,
inputFormatters: [
// 0-9
FilteringTextInputFormatter.digitsOnly,
],
onCompleted: (pin) {
controller.verificationCode.value = pin;
controller.isLoggingIn.value
? null
: controller.login();
},
),
child: Center(
child: Text(
controller.countdownSeconds.value > 0 ? "获取验证码 ${controller.countdownSeconds.value}s" : "获取验证码",
style: TextStyle(
fontSize: 18.w,
color: Colors.white
SizedBox(height: 40.w,),
Container(
width: 325.w,
height: 52.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(52.w)),
gradient: controller.countdownSeconds.value <= 0 ? LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(131, 89, 255, 1),
Color.fromRGBO(61, 138, 224, 1),
],
) : null,
color: const Color.fromRGBO(217, 217, 217, 1)
),
child: Center(
child: Text(
controller.countdownSeconds.value > 0 ? "获取验证码 ${controller.countdownSeconds.value}s" : "获取验证码",
style: TextStyle(
fontSize: 18.w,
color: Colors.white
),
),
),
),
).onTap(() {
controller.isSendingCode.value ||
controller.countdownSeconds.value > 0
? null
: controller.getVerificationCode();
}),
],
).onTap(() {
controller.isSendingCode.value ||
controller.countdownSeconds.value > 0
? null
: controller.getVerificationCode();
}),
],
),
),
),
);

2
lib/pages/mine/real_login_page.dart

@ -52,7 +52,7 @@ class _RealLoginPageState extends State<RealLoginPage> {
),
SizedBox(height: 12.w,),
Text(
"快乐星球",
"星球奇遇记",
style: TextStyle(
fontSize: 24.w
),

Loading…
Cancel
Save