Base Flutter App
This commit is contained in:
15
web_native/lib/screens/example2/components/body.dart
Normal file
15
web_native/lib/screens/example2/components/body.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Body extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: RaisedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('Go back!'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
web_native/lib/screens/example2/example2-bloc.dart
Normal file
20
web_native/lib/screens/example2/example2-bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:imagini/models/contact.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imagini/bloc/bloc.dart';
|
||||
|
||||
class Example2Bloc extends Bloc {
|
||||
StreamSubscription _audioPlayerStateSubscription;
|
||||
|
||||
Stream<String> get example => _exampleSubject.stream;
|
||||
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||
|
||||
Example2Bloc();
|
||||
|
||||
void dispose() {
|
||||
_exampleSubject.close();
|
||||
}
|
||||
}
|
||||
40
web_native/lib/screens/example2/examplescreen2.dart
Normal file
40
web_native/lib/screens/example2/examplescreen2.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imagini/screens/example2/components/body.dart';
|
||||
import 'package:imagini/screens/example2/example2-bloc.dart';
|
||||
import 'package:imagini/bloc/bloc-prov.dart';
|
||||
|
||||
class ExScreen2 extends StatefulWidget {
|
||||
@override
|
||||
_ExScreen2State createState() => _ExScreen2State();
|
||||
}
|
||||
|
||||
class _ExScreen2State extends State<ExScreen2> {
|
||||
Example2Bloc example2Bloc;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
example2Bloc = Example2Bloc();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
example2Bloc.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
bloc: Example2Bloc(),
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Second Screen"),
|
||||
),
|
||||
body: Body(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user