Skip to content

Instantly share code, notes, and snippets.

@vasyafromrussia
Last active May 9, 2020 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasyafromrussia/679e20afd75a0f1c8a3311a86d002fb8 to your computer and use it in GitHub Desktop.
Save vasyafromrussia/679e20afd75a0f1c8a3311a86d002fb8 to your computer and use it in GitHub Desktop.
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Gestures demo'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final GlobalKey sliderKey = GlobalKey();
double progress = 0.0;
static const platform = const MethodChannel('sample/gesture');
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Container(
height: 20,
child: Slider(
key: sliderKey,
value: progress,
onChanged: (value) => setState(() => progress = value),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment