旋转图片

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:rotated_view/rotated_view.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  StreamSubscription _subscription;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    if (_subscription != null) {
      _subscription.cancel();
    }
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      color: Colors.black,
      home: Scaffold(
        body: Center(
            child: Column(
              children: <Widget>[
                Padding(
                  padding: EdgeInsets.fromLTRB(0, 100, 0, 0),
                ),
                Container(
                  width: 400,
                  height: 400,
                  child: RotatedView(
                    child: Image.asset("assets/images/launcher_background.png"),
                    usesensor: false,
                    issame: false,
                    haveinertia: true,
                  ),
                ),
                Text(""),
              ],
            )),
      ),
    );
  }
}

  

 

import 

rotated_view: ^1.0.1
assets -- images

posted @ 2019-05-20 18:51  CrossPython  阅读(224)  评论(0编辑  收藏  举报