chobilib_flutter 0.4.17 copy "chobilib_flutter: ^0.4.17" to clipboard
chobilib_flutter: ^0.4.17 copied to clipboard

A flutter package includes basic functions for various use

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:chobilib_flutter/chobilib_flutter.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
  String _platformVersion = 'Unknown';

  late final AnimationController _testAnimationController;

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

    _testAnimationController = AnimationController(
      duration: const Duration(milliseconds: 150),
      vsync: this,
    );

    WidgetsBinding.instance.addPostFrameCallback((_) async {
      final rs = RandomString.withDigitsChars();
      debugPrint(rs.getRandomString(20));
    });
  }

  @override
  void dispose() {
    _testAnimationController.dispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          //child: Text('Running on: $_platformVersion\n'),
          child: Column(
            children: [
              Shaker(
                animation: _testAnimationController,
                builder: (context, value) {
                  return Container(
                    width: 128,
                    height: 32,
                    color: Colors.blue,
                  );
                },
              ),
              Gaps.vertical48,
              TextButton(
                onPressed: () {
                  _testAnimationController.forward(from: 0.0);
                },
                child: Text("animate"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
1.34k
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package includes basic functions for various use

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_hooks, flutter_web_plugins, hooks_riverpod, path, path_provider, plugin_platform_interface, riverpod_annotation, web

More

Packages that depend on chobilib_flutter