search_list 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 46

Flutter Rotated View #

A widget which can be rotated and can have virtual inertia and drag or a sensor that controls its rotation

Installation #

Add rotated_view as a dependency in your pubspec.yaml file (how?).

Import Rotated View:

import 'package:rotated_view/rotated_view.dart';

usage #

Given a child Widget :

@override
Widget build(BuildContext context) {
  return Container(
    child: RotatedView(
      child: AssetImage("assets/Nightmare_MYS.png"),
    )
  );
}

Result:

More screenshots #

CHANGELOG #

version: 1.0.0 #

想要做这样的控件,初步实现

version: 1.0.1 #

更新几个可选择

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  ScrollController _scrollController;
  List<String> _list = [];
  List<int> ser = [];
  @override
  void initState() {
    for (int i = 1; i <= 100; i++) {
      _list.add("$i");
    }
    _scrollController = ScrollController();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Search(
            itemheight: 30,
            callback: (value) {
              ser = value;
              setState(() {});
            },
            list: _list,
            controll: _scrollController,
            endwidget: Text(""),
          ),
        ),
        body: ListView.builder(
          controller: _scrollController,
          itemCount: 100,
          itemBuilder: (BuildContext context, int index) {
            return SizedBox(
              height: 30,
              child: Text(
                _list[index],
                style: TextStyle(
                  color: ser.contains(index) ? Colors.red : Colors.black,
                ),
              ),
            );
          },
        ));
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  search_list: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:search_list/search_list.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Apr 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/search_list.dart.

Run flutter format to format lib/search_list.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test