w_play 0.0.2 copy "w_play: ^0.0.2" to clipboard
w_play: ^0.0.2 copied to clipboard

A new Flutter project.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:w_play/w_play.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool isPlay = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("语音播放效果"),
      ),
      body: Center(
        child: Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          color: Colors.white,
          child: InkWell(
            onTap: () {
              isPlay = !isPlay;
              setState(() {});
            },
            child: Player(
              isPlays: isPlay,
              size: Size(100, 100),
            ),
          ),
        ),
      ),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
1
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter project.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on w_play