Skip to content

Commit

Permalink
add -> 详情空白页
Browse files Browse the repository at this point in the history
  • Loading branch information
ducafecat committed Apr 15, 2020
1 parent 6397b43 commit e6759b8
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ lib/generated_plugin_registrant.dart

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

# Tuture-related files

.tuture
8 changes: 5 additions & 3 deletions lib/common/widgets/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Widget transparentAppBar({
return AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
title: Center(
child: title,
),
title: title != null
? Center(
child: title,
)
: null,
leading: leading,
actions: actions,
);
Expand Down
56 changes: 56 additions & 0 deletions lib/pages/details/details.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import 'package:flutter/material.dart';
import 'package:flutter_ducafecat_news/common/values/values.dart';
import 'package:flutter_ducafecat_news/common/widgets/widgets.dart';

class DetailsPage extends StatefulWidget {
DetailsPage({Key key}) : super(key: key);

@override
_DetailsPageState createState() => _DetailsPageState();
}

class _DetailsPageState extends State<DetailsPage> {
// 顶部导航
Widget _buildAppBar() {
return transparentAppBar(
context: context,
leading: IconButton(
icon: Icon(
Icons.arrow_back,
color: AppColors.primaryText,
),
onPressed: () {
Navigator.pop(context);
},
),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.bookmark_border,
color: AppColors.primaryText,
),
onPressed: () {},
),
IconButton(
icon: Icon(
Icons.share,
color: AppColors.primaryText,
),
onPressed: () {},
)
]);
}

// 正文
Widget _buildPageView() {
return Container();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: _buildAppBar(),
body: _buildPageView(),
);
}
}
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
flutter_modular:
dependency: "direct main"
description:
name: flutter_modular
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
flutter_screenutil:
dependency: "direct main"
description:
Expand Down

0 comments on commit e6759b8

Please sign in to comment.