旋转图片

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

猜你喜欢

转载自www.cnblogs.com/pythonClub/p/10895876.html
今日推荐