修复如下问题:UI、注销逻辑、App名称

This commit is contained in:
胡天 2023-07-25 13:43:22 +08:00
parent f71a539e81
commit 0a4854eb4c
7 changed files with 55 additions and 28 deletions

View File

@ -6,6 +6,16 @@ if (localPropertiesFile.exists()) {
} }
} }
// android/key.properties
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystorePropertiesFile.withReader('UTF-8') { reader ->
keystoreProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk') def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) { if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
@ -46,11 +56,22 @@ android {
versionName flutterVersionName versionName flutterVersionName
} }
//
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug // signingConfig signingConfigs.debug
signingConfig signingConfigs.release
} }
} }
} }

View File

@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.news_getx"> package="com.example.news_getx">
<application <application
android:label="news_getx" android:label="哈哈新闻"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/launcher_icon"> android:icon="@mipmap/launcher_icon">
<activity <activity
@ -38,4 +38,6 @@
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
</application> </application>
<!-- 设置网络权限 -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest> </manifest>

View File

@ -5,8 +5,8 @@ import 'package:news_getx/data/services/config.dart';
import 'package:news_getx/data/services/storage.dart'; import 'package:news_getx/data/services/storage.dart';
import 'package:news_getx/data/services/user.dart'; import 'package:news_getx/data/services/user.dart';
import 'package:news_getx/modules/widgets/button.dart'; import 'package:news_getx/modules/widgets/button.dart';
import 'package:news_getx/routes/app_pages.dart';
import 'package:news_getx/theme/app_colors.dart'; import 'package:news_getx/theme/app_colors.dart';
import 'package:news_getx/theme/app_radii.dart';
import 'account_controller.dart'; import 'account_controller.dart';
@ -69,7 +69,7 @@ class AccountPage extends GetView<AccountController> {
// crossAxisAlignment会导致设置的宽度时效 // crossAxisAlignment会导致设置的宽度时效
FlatButton( FlatButton(
height: 40.h, height: 40,
width: double.infinity, width: double.infinity,
onPressed: () {}, onPressed: () {},
title: "Get Premium - \$9.99", title: "Get Premium - \$9.99",
@ -203,8 +203,8 @@ class AccountPage extends GetView<AccountController> {
title: "Log out", title: "Log out",
hasArrow: true, hasArrow: true,
onTap: () { onTap: () {
print('Log out');
UserService.to.onLogout(); UserService.to.onLogout();
Get.offAllNamed(AppRoutes.Signin);
}, },
), ),
_divider10(), _divider10(),

View File

@ -8,8 +8,10 @@ class BookmarksPage extends GetView<BookmarksController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Center(
child: Container(
child: Text('BookmarksPage'), child: Text('BookmarksPage'),
),
); );
} }
} }

View File

@ -15,7 +15,7 @@ class NewsListItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: 161.h, height: 170.h,
padding: EdgeInsets.all(20.w), padding: EdgeInsets.all(20.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -46,7 +46,7 @@ class NewsListItem extends StatelessWidget {
children: [ children: [
// //
Container( Container(
margin: EdgeInsets.all(0), margin: EdgeInsets.zero,
child: Text( child: Text(
newsItem.author ?? '', newsItem.author ?? '',
style: TextStyle( style: TextStyle(
@ -54,6 +54,7 @@ class NewsListItem extends StatelessWidget {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: AppColors.thirdElementText, color: AppColors.thirdElementText,
fontSize: 14.sp, fontSize: 14.sp,
height: 1,
), ),
), ),
), ),
@ -74,6 +75,7 @@ class NewsListItem extends StatelessWidget {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.primaryText, color: AppColors.primaryText,
fontSize: 16.sp, fontSize: 16.sp,
height: 1,
), ),
), ),
), ),
@ -127,7 +129,7 @@ class NewsListItem extends StatelessWidget {
child: Icon( child: Icon(
Icons.more_horiz, Icons.more_horiz,
color: AppColors.primaryText, color: AppColors.primaryText,
size: 24, size: 24.sp,
), ),
onTap: () { onTap: () {
print('查看更多...'); print('查看更多...');

View File

@ -11,7 +11,7 @@ class NewsChannelsWidget extends GetView<MainController> {
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
width: 70.w, width: 70.w,
height: 97.h, height: 110.h,
child: InkWell( child: InkWell(
// splashColor文档 splashColor是透明纯黑色 // splashColor文档 splashColor是透明纯黑色
// splashColor: Colors.cyanAccent, // splashColor: Colors.cyanAccent,
@ -43,9 +43,8 @@ class NewsChannelsWidget extends GetView<MainController> {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
Padding( Spacer(),
padding: const EdgeInsets.only(top: 12.0), Text(
child: Text(
item.title, item.title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
@ -55,8 +54,7 @@ class NewsChannelsWidget extends GetView<MainController> {
fontFamily: "Avenir", fontFamily: "Avenir",
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 14.sp, fontSize: 14.sp,
height: 14.sp / 14, height: 1,
),
), ),
), ),
], ],

View File

@ -13,7 +13,7 @@ import 'package:news_getx/utils/date.dart';
class NewsListWidget extends GetView<MainController> { class NewsListWidget extends GetView<MainController> {
Widget _buildListItem(NewsItem item) { Widget _buildListItem(NewsItem item) {
return Container( return Container(
height: 161.h, height: 170.h,
padding: EdgeInsets.all(20.w), padding: EdgeInsets.all(20.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -42,7 +42,7 @@ class NewsListWidget extends GetView<MainController> {
children: [ children: [
// //
Container( Container(
margin: EdgeInsets.all(0), margin: EdgeInsets.zero,
child: Text( child: Text(
item.author ?? '', item.author ?? '',
style: TextStyle( style: TextStyle(
@ -50,6 +50,7 @@ class NewsListWidget extends GetView<MainController> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: AppColors.thirdElementText, color: AppColors.thirdElementText,
fontSize: 14.sp, fontSize: 14.sp,
height: 1,
), ),
), ),
), ),
@ -70,6 +71,7 @@ class NewsListWidget extends GetView<MainController> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.primaryText, color: AppColors.primaryText,
fontSize: 16.sp, fontSize: 16.sp,
height: 1,
), ),
), ),
), ),
@ -123,7 +125,7 @@ class NewsListWidget extends GetView<MainController> {
child: Icon( child: Icon(
Icons.more_horiz, Icons.more_horiz,
color: AppColors.primaryText, color: AppColors.primaryText,
size: 24, size: 24.sp,
), ),
onTap: () { onTap: () {
print('查看更多...'); print('查看更多...');