Hello guys , Im confused with this library how implement it . Does anyone has Example for me . Im very very thankful all you guys.
import 'package:flutter/material.dart';
import 'package:fragment/fragment.dart' ;
class MainPage extends StatefulWidget {
final int key01;
final int key02;
final int key03;
final int key04;
const MainPage({Key key, this.key01, this.key02, this.key03, this.key04}) : super(key: key);
@OverRide
_MainPageState createState() => _MainPageState();
}
class MainPageState extends State with Fragment {
@OverRide
Widget build(BuildContext context) {
return Column(
children: [
fragment( // use fragment method to cache a subtree
(, __) => Container(),
keys: [widget.key01],
),
fragment(
(, __) => Container(),
keys: [widget.key02],
),
fragment(
(, __) => Container(),
keys: [widget.key03],
),
fragment(
(_, __) => Container(),
keys: [widget.key04],
),
],
);
}
@OverRide
StatefulElement createElement() {
// TODO: implement createElement
return null;
}
@OverRide
List debugDescribeChildren() {
// TODO: implement debugDescribeChildren
return null;
}
@OverRide
// TODO: implement key
Key get key => null;
@OverRide
String toStringDeep({String prefixLineOne = '', String prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) {
// TODO: implement toStringDeep
return null;
}
@OverRide
String toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) {
// TODO: implement toStringShallow
return null;
}
}
and they said "The class Fragment can't be use as a maxin because it declare a constructor . "
Hello guys , Im confused with this library how implement it . Does anyone has Example for me . Im very very thankful all you guys.
import 'package:flutter/material.dart';
import 'package:fragment/fragment.dart' ;
class MainPage extends StatefulWidget {
final int key01;
final int key02;
final int key03;
final int key04;
const MainPage({Key key, this.key01, this.key02, this.key03, this.key04}) : super(key: key);
@OverRide
_MainPageState createState() => _MainPageState();
}
class MainPageState extends State with Fragment {
@OverRide
Widget build(BuildContext context) {
return Column(
children: [
fragment( // use fragment method to cache a subtree
(, __) => Container(),
keys: [widget.key01],
),
fragment(
(, __) => Container(),
keys: [widget.key02],
),
fragment(
(, __) => Container(),
keys: [widget.key03],
),
fragment(
(_, __) => Container(),
keys: [widget.key04],
),
],
);
}
@OverRide
StatefulElement createElement() {
// TODO: implement createElement
return null;
}
@OverRide
List debugDescribeChildren() {
// TODO: implement debugDescribeChildren
return null;
}
@OverRide
// TODO: implement key
Key get key => null;
@OverRide
String toStringDeep({String prefixLineOne = '', String prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) {
// TODO: implement toStringDeep
return null;
}
@OverRide
String toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) {
// TODO: implement toStringShallow
return null;
}
}
and they said "The class Fragment can't be use as a maxin because it declare a constructor . "