Giter VIP home page Giter VIP logo

cookio's Introduction

cookio

A new Flutter application taking over your decisions for the next meal.

UI design concept

UI-concept

Database

ER-Diagram

cookio's People

Contributors

v411e avatar

Stargazers

 avatar Timo Schwarzer avatar  avatar

Watchers

James Cloos avatar  avatar Timo Schwarzer avatar

cookio's Issues

Gesture improvements

  • pull-up gesture on DraggableScrollableSheet does not work on the text
  • Improve pageview swipe angle
  • let the pageview snap faster in position

Product icons

The app needs icons or small pictograms for each product. (For shoppinglist and storage overview) Ideas and inspiration can be taken from "Bring! Shoppinglist". A uniform appearance needs to be preferred.

Show search bar only when pulling down

This saves screen space. Possible implementation: pull_to_reveal

import 'dart:math';

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

class Reveal extends StatefulWidget {
  final String title;
  final bool revealWhenEmpty;

  Reveal({Key key, this.revealWhenEmpty = true, this.title}) : super(key: key);

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

class _RevealState extends State<Reveal> {
  int _counter = 0;
  String _filter;
  List<String> items = [];
  TextEditingController searchController;

  void initState() {
    searchController = TextEditingController();
    searchController.addListener(_onSearch);
    super.initState();
  }

  void _onSearch() {
    setState(() {
      _filter = searchController.text;
    });
  }

  void addToList() {
    setState(() {
      _counter++;
      items.add(names[Random.secure().nextInt(names.length - 1)]);
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: PullToRevealTopItemList(
          revealWhenEmpty: widget.revealWhenEmpty,
          itemCount: _counter,
          revealableHeight: 50,
          itemBuilder: (BuildContext context, int index) {
            if (_filter != null && !items[index].contains(_filter)) {
              return Container();
            }
            return Card(
              margin: EdgeInsets.all(10),
              child: Center(
                child: Container(
                  height: 150,
                  padding: EdgeInsets.all(10),
                  child: Center(
                    child: Text('${items[index]}', key: Key('$index'), style: TextStyle(fontSize: 20)),
                  ),
                ),
              ),
            );
          },
          dividerBuilder: (BuildContext context) {
            return Container(
              alignment: Alignment.topLeft,
              padding: EdgeInsets.all(10),
              child: Text('Items', style: Theme.of(context).textTheme.headline),
            );
          },
          revealableBuilder: (BuildContext context, RevealableToggler opener, RevealableToggler closer, BoxConstraints constraints) {
            return Row(
              key: Key('scrollable-row'),
              children: <Widget>[
                SizedBox(width: 10),
                Flexible(
                  child: TextFormField(
                    controller: searchController,
                    decoration: InputDecoration(
                      hintText: 'Search',
                      suffixIcon: Icon(Icons.search, color: Theme.of(context).backgroundColor),
                    ),
                  ),
                ),
                IconButton(
                  icon: Icon(Icons.cancel),
                  onPressed: () {
                    // Handles closing the `Revealable`
                    closer(completer: RevealableCompleter.snap);
                    // Removes any filtering effects
                    searchController.text = '';
                    setState(() {
                      _filter = null;
                    });
                  },
                )
              ],
            );
          },
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: addToList,
        tooltip: 'Add to List',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

const List<String> names = [
  "Michael",
  "James",
  "John",
  "Robert",
  "David",
  "William",
  "Mary",
  "Christopher",
  "Joseph",
  "Richard",
  "Daniel",
  "Thomas",
  "Matthew",
  "Jennifer",
  "Charles",
  "Anthony",
  "Patricia",
  "Linda",
  "Mark",
  "Elizabeth",
  "Joshua",
  "Steven",
  "Andrew",
  "Kevin",
  "Brian",
  "Barbara",
  "Jessica",
  "Jason",
  "Susan",
  "Timothy",
  "Paul",
  "Kenneth",
  "Lisa",
  "Ryan",
  "Sarah",
  "Karen",
  "Jeffrey",
  "Donald",
  "Ashley",
  "Eric",
  "Jacob",
  "Nicholas",
  "Jonathan",
  "Ronald",
  "Michelle",
  "Kimberly",
  "Nancy",
  "Justin",
  "Sandra",
  "Amanda",
  "Brandon",
  "Stephanie",
  "Emily",
  "Melissa",
  "Gary",
  "Edward",
  "Stephen",
  "Scott",
  "George",
  "Donna",
  "Jose",
  "Rebecca",
  "Deborah",
  "Laura",
  "Cynthia",
  "Carol",
  "Amy",
  "Margaret",
  "Gregory",
  "Sharon",
  "Larry",
  "Angela",
  "Maria",
  "Alexander",
  "Benjamin",
  "Nicole",
  "Kathleen",
  "Patrick",
  "Samantha",
  "Tyler",
  "Samuel",
  "Betty",
  "Brenda",
  "Pamela",
  "Aaron",
  "Kelly",
  "Heather",
  "Rachel",
  "Adam",
  "Christine",
  "Zachary",
  "Debra",
  "Katherine",
  "Dennis",
  "Nathan",
  "Christina",
  "Julie",
  "Jordan",
  "Kyle",
  "Anna",
];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.