Skip to content

Commit

Permalink
upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
kidozh committed Aug 12, 2024
1 parent 27b0c36 commit 08609b8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/app/MainApp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ class MyApp extends StatelessWidget {
).harmonized(),
useMaterial3: themeColorEntity.useMaterial3,
textTheme: typography.black.useSystemChineseFont(Brightness.light),

);

final materialThemeDataDark = ThemeData.from(
Expand Down Expand Up @@ -236,6 +235,7 @@ class MyApp extends StatelessWidget {
onThemeModeChanged: (themeMode) {
themeMode = themeMode;
},

builder: (context) => UpgradeAlert(
child: PlatformApp(
//title: S.of(context).appName,
Expand Down
62 changes: 54 additions & 8 deletions lib/page/DrawerPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:discuz_flutter/utility/CustomizeColor.dart';
import 'package:discuz_flutter/utility/VibrationUtils.dart';
import 'package:discuz_flutter/widget/UserAvatar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -324,7 +325,15 @@ class DrawerState extends State<DrawerStatefulWidget> {
},
title: Text(S.of(context).incognitoTitle),
subtitle: Text(S.of(context).incognitoTitle),
leading: Icon(Icons.person_pin));
leading: CircleAvatar(
backgroundColor: Theme.of(context).colorScheme.onSecondaryContainer,
child: Icon(
AppPlatformIcons(context).userIncognitoSolid,
color: Theme.of(context).colorScheme.secondaryContainer,
size: 24,
),
)
);
}
});
}
Expand All @@ -349,12 +358,33 @@ class DrawerState extends State<DrawerStatefulWidget> {
if (value.discuz == null || value.user == null) {
return UserAccountsDrawerHeader(
margin: EdgeInsets.zero,
accountEmail: Text(S.of(context).incognitoSubtitle),
accountName: Text(S.of(context).incognitoTitle),
currentAccountPicture: Icon(
Icons.person_pin,
color: Theme.of(context).colorScheme.onPrimary,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer
),
accountEmail: Text(
S.of(context).incognitoSubtitle,
style: TextStyle(
color: Theme.of(context).colorScheme.onSecondaryContainer
),

),
accountName: Text(
S.of(context).incognitoTitle,
style: TextStyle(
color: Theme.of(context).colorScheme.onSecondaryContainer,
fontWeight: FontWeight.bold
),
),
currentAccountPictureSize: Size.square(64),
currentAccountPicture: CircleAvatar(
backgroundColor: Theme.of(context).colorScheme.onSecondaryContainer,
child: Icon(
AppPlatformIcons(context).userIncognitoSolid,
color: Theme.of(context).colorScheme.secondaryContainer,
size: 40,
),
),
arrowColor: Theme.of(context).colorScheme.onSecondaryContainer,
onDetailsPressed: () {
setState(() {
_showUserDetail = !_showUserDetail;
Expand All @@ -364,14 +394,30 @@ class DrawerState extends State<DrawerStatefulWidget> {
} else {
return UserAccountsDrawerHeader(
margin: EdgeInsets.zero,
accountEmail: Text(value.user!.uid.toString()),
accountName: Text(value.user!.username),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary
),
accountEmail: Text(
value.user!.uid.toString(),
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary
),
),
accountName: Text(
value.user!.username,
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary,
fontWeight: FontWeight.bold
),
),
currentAccountPictureSize: Size.square(64),
currentAccountPicture: UserAvatar(
value.discuz!,
value.user!.uid,
value.user!.username,
size: 32,
),
arrowColor: Theme.of(context).colorScheme.onPrimary,
onDetailsPressed: () {
setState(() {
_showUserDetail = !_showUserDetail;
Expand Down
2 changes: 2 additions & 0 deletions lib/utility/AppPlatformIcons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ class AppPlatformIcons{
IconData get loginUserFailedSolid => isMaterial(context)? Icons.error_outline : CupertinoIcons.person_crop_circle_badge_exclam;

IconData get loginUserSuccessSolid => isMaterial(context)? Icons.check_circle : CupertinoIcons.person_crop_circle_badge_checkmark;

IconData get userIncognitoSolid => isMaterial(context)? Icons.airplanemode_active : CupertinoIcons.eyeglasses;
}

0 comments on commit 08609b8

Please sign in to comment.