You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.3 KiB

// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
// Project imports:
4 years ago
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/app_bar_action.dart';
class HomeAppBar extends StatefulWidget {
HomeAppBar({Key key}) : super(key: key);
@override
_HomeAppBarState createState() => _HomeAppBarState();
}
class _HomeAppBarState extends State<HomeAppBar> {
List<Map<String, dynamic>> _actionsList = [
{'title': '扫一扫', 'icon': AntDesign.scan1, 'funtion': null},
{'title': '消息', 'icon': AntDesign.bells, 'funtion': null}
];
List<Widget> _actions() {
return _actionsList
.map((item) => AppBarAction(
title: item['title'],
icon: item['icon'],
))
.toList();
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xffffd000), Color(0xffffbd00)],
),
),
child: AppBar(
elevation: 0,
title: Text(
'皇冠花园二期',
style: TextStyle(
fontWeight: FontWeight.w600,
4 years ago
fontSize: 36.sp,
color: Color(0xff333333),
),
),
centerTitle: true,
backgroundColor: Colors.transparent,
leading: Container(
4 years ago
margin: EdgeInsets.only(left: 32.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'深圳',
style: TextStyle(
fontWeight: FontWeight.w600,
4 years ago
fontSize: 24.sp,
color: Color(0xff333333),
),
),
Text(
'阴 27℃',
style: TextStyle(
4 years ago
fontSize: 20.sp,
color: Color(0xff333333),
),
)
]),
),
actions: _actions(),
),
);
}
}