| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- import 'package:bbyyy/my_tools/my_colors.dart';
- import 'package:bbyyy/my_tools/my_cookie.dart';
- import 'package:bbyyy/my_tools/my_tools.dart';
- import 'package:bbyyy/my_tools/my_views.dart';
- import 'package:flutter/material.dart';
- class SystemInformationPage extends StatefulWidget {
- @override
- _SystemInformationPageState createState() => _SystemInformationPageState();
- }
- class _SystemInformationPageState extends State<SystemInformationPage> {
- List<String> sysMsg = [];
- @override
- void initState() {
- // TODO: implement initState
- super.initState();
- String s = MyCookie().prefs.getString('${MyCookie().getUID()}系统消息');
- if (s != null) {
- sysMsg = s.split('!@##@!');
- }
- setState(() {});
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Column(
- children: [
- MyViews().myAppBar('系统消息', context, []),
- Expanded(
- child: ListView.builder(
- itemBuilder: (BuildContext context, int index) {
- return GestureDetector(
- onTap: () {
- MyTools().toPage(context,
- SystemMessageDetailsPage(sysMsg[index]), (then) {});
- },
- behavior: HitTestBehavior.translucent,
- child: Column(
- children: [
- Container(
- color: Colors.white,
- child: Text(
- sysMsg[index],
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
- softWrap: true,
- style:
- TextStyle(color: MyColors.c333333, fontSize: 14),
- ),
- alignment: Alignment.centerLeft,
- padding: EdgeInsets.all(10),
- ),
- Container(
- height: 0.5,
- color: MyColors.cF7F7F7,
- )
- ],
- ),
- );
- },
- itemCount: sysMsg.length,
- padding: EdgeInsets.all(0),
- ),
- )
- ],
- ),
- );
- }
- }
- class SystemMessageDetailsPage extends StatefulWidget {
- String sysMsg;
- SystemMessageDetailsPage(this.sysMsg);
- @override
- _SystemMessageDetailsPageState createState() =>
- _SystemMessageDetailsPageState();
- }
- class _SystemMessageDetailsPageState extends State<SystemMessageDetailsPage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Column(
- children: [
- MyViews().myAppBar('系统消息详情', context, []),
- Expanded(
- child: Container(
- margin: EdgeInsets.all(20),
- child: Text(
- widget.sysMsg,
- style: TextStyle(color: MyColors.c333333, fontSize: 20),
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
|