start_page.dart 887 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:flutter/material.dart';
  2. import 'login_page.dart';
  3. class StartPage extends StatefulWidget {
  4. final Widget child;
  5. StartPage({Key key, this.child}) : super(key: key);
  6. _StartPageState createState() => _StartPageState();
  7. }
  8. class _StartPageState extends State<StartPage> {
  9. @override
  10. Widget build(BuildContext context) {
  11. return Container(
  12. child: Stack(
  13. alignment:Alignment.center,//如果子widget没有定位,此属性定位
  14. children: <Widget>[
  15. Container(
  16. child:Image.asset(
  17. "lib/images/start_page.png",//本地图片路径必须和配置文件的图片路径一致
  18. fit:BoxFit.cover
  19. )
  20. ),
  21. Positioned(
  22. top: 30.0,
  23. right: 10.0,
  24. child:Text("99",textDirection: TextDirection.ltr,)
  25. )
  26. ],
  27. )
  28. );
  29. }
  30. }