Skip to content

Commit

Permalink
style:部分样式修改
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyezi committed Sep 7, 2020
1 parent ebb41df commit e3a9439
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 62 deletions.
Binary file modified apk/daliy.apk
Binary file not shown.
87 changes: 47 additions & 40 deletions lib/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import 'package:daily/services/add_sevice.dart';
import 'package:daily/styles/colors.dart';
import 'package:daily/styles/iconfont.dart';
import 'package:daily/styles/text_style.dart';
import 'package:daily/utils/custom_floatbutton_location.dart';
import 'package:daily/utils/sqlite_help.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fab_circular_menu/fab_circular_menu.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:oktoast/oktoast.dart';
import 'package:unicorndial/unicorndial.dart';

class Home extends StatefulWidget {
@override
Expand All @@ -29,7 +28,6 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
List<CategoryModel> categoryList;
final sqlLiteHelper = SqlLiteHelper();
final DateFormat formatter = DateFormat('yyyy-MM-dd');
final GlobalKey<FabCircularMenuState> fabKey = GlobalKey();

@override
void initState() {
Expand Down Expand Up @@ -77,8 +75,6 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
value: SystemUiOverlayStyle.dark,
child: Scaffold(
floatingActionButton: loading ? SizedBox() : _buildFoaltButton(context),
floatingActionButtonLocation:
CustomFloatingActionButtonLocation(FloatingActionButtonLocation.centerFloat, -15, -30),
body: loading
? Center(child: SpinKitPumpingHeart(color: Colors.black))
: Container(
Expand All @@ -103,41 +99,52 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {

/// FloatingActionButton
Widget _buildFoaltButton(BuildContext context) {
return FabCircularMenu(
key: fabKey,
fabSize: 50,
ringWidth: 80,
fabColor: Colors.black,
ringColor: Colors.black54,
ringDiameter: MediaQuery.of(context).size.width * 0.6,
fabOpenIcon: Icon(Icons.menu, color: Colors.white),
fabCloseIcon: Icon(Icons.close, color: Colors.white),
children: <Widget>[
IconButton(
icon: Icon(Icons.info_outline, color: Colors.white, size: 26),
onPressed: () {
fabKey.currentState.close();
showToast('努力更新中...');
}),
IconButton(
icon: Icon(Iconfont.wish, color: Colors.white, size: 32),
onPressed: () {
fabKey.currentState.close();
showToast('努力更新中...');
}),
IconButton(
icon: Icon(Icons.add, color: Colors.white, size: 32),
onPressed: () {
fabKey.currentState.close();
Navigator.of(context).push(
MaterialPageRoute(builder: (context) {
return AddNew(categoryList: categoryList);
}),
).then((value) {
if (value) loadAllformSqlite();
});
}),
],
final childButtons = List<UnicornButton>();
childButtons.add(UnicornButton(
hasLabel: false,
currentButton: FloatingActionButton(
mini: true,
heroTag: 'add',
backgroundColor: Colors.black54,
child: Icon(Icons.add, size: 30),
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) {
return AddNew(categoryList: categoryList);
}),
).then((value) {
if (value) loadAllformSqlite();
});
},
)));
childButtons.add(UnicornButton(
hasLabel: false,
currentButton: FloatingActionButton(
mini: true,
heroTag: 'wish',
backgroundColor: Colors.black54,
child: Icon(Iconfont.wish, size: 30),
onPressed: () {
showToast('努力更新中...');
},
)));
childButtons.add(UnicornButton(
hasLabel: false,
currentButton: FloatingActionButton(
mini: true,
heroTag: 'info',
backgroundColor: AppColors.homeBackGorundColor,
child: Icon(Icons.info_outline, size: 26),
onPressed: () {
showToast('努力更新中...');
},
)));
return UnicornDialer(
backgroundColor: Colors.black54.withOpacity(0.3),
parentButtonBackground: Colors.black,
orientation: UnicornOrientation.VERTICAL,
parentButton: Icon(Icons.menu),
childButtons: childButtons,
);
}

Expand Down
14 changes: 0 additions & 14 deletions lib/utils/custom_floatbutton_location.dart

This file was deleted.

14 changes: 7 additions & 7 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.3"
fab_circular_menu:
dependency: "direct main"
description:
name: fab_circular_menu
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -453,6 +446,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
unicorndial:
dependency: "direct main"
description:
name: unicorndial
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.5"
url_launcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
cupertino_icons: ^0.1.3
flutter_spinkit: ^4.1.2
image_picker: ^0.6.7+4
fab_circular_menu: ^1.0.0
unicorndial: ^1.1.5
easy_localization: ^2.0.2
cached_network_image: ^2.0.0
syncfusion_flutter_datepicker: ^18.2.55-beta
Expand Down

0 comments on commit e3a9439

Please sign in to comment.