greatday4april / what-to-eat-ml-backend

Backend for a ML-based restaurant recommendation app
MIT License
3 stars 1 forks source link

[Mobile] Research on swiping UI libraries #5

Closed greatday4april closed 4 years ago

greatday4april commented 4 years ago

Find similar mobile open source libraries or UI kits that 1. works smoothly 2. looks appealing

reference

fish518518 commented 4 years ago

Effect Demo:https://pub.dev/packages/flutter_swiper#build-in-layouts flutter_swiper Installation Guide

  1. Depend on it Add this to your package’s pubspec.yaml file: dependencies: flutter_swiper: ^1.1.6
  2. Install it You can install packages from the command line: flutter pub get
  3. Restart your IDE
  4. Import it Now in your Dart code, you can use: import 'package:flutter_swiper/flutter_swiper.dart';
  5. Sample code
    import 'package:flutter/material.dart';
    import 'package:flutter_swiper/flutter_swiper.dart';
    void main() => runApp(new MyApp());
    class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
    }
    }
    class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
    final String title;
    @override
    _MyHomePageState createState() => new _MyHomePageState();
    }
    class _MyHomePageState extends State<MyHomePage> {
    @override
    Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body:  new Swiper(
        itemBuilder: (BuildContext context,int index){
          return new Image.network("http://via.placeholder.com/350x150",fit: BoxFit.fill,);
        },
        itemCount: 3,
        pagination: new SwiperPagination(),
        control: new SwiperControl(),
      ),
    );
    }
    }
fish518518 commented 4 years ago

How about this one? https://blog.geekyants.com/tinder-swipe-in-flutter-7e4fc56021bc